Skip to content

refactor(sierra-gas): inlined small functions that are only used once.#9548

Merged
orizi merged 1 commit intomainfrom
orizi/01-27-refactor_sierra-gas_inlined_small_functions_that_are_only_used_once
Jan 27, 2026
Merged

refactor(sierra-gas): inlined small functions that are only used once.#9548
orizi merged 1 commit intomainfrom
orizi/01-27-refactor_sierra-gas_inlined_small_functions_that_are_only_used_once

Conversation

@orizi
Copy link
Collaborator

@orizi orizi commented Jan 27, 2026

Summary

Removed unused helper functions core_libfunc_postcost and core_libfunc_precost from the Sierra gas module, and inlined their functionality directly into the calling functions in core_libfunc_cost_expr.rs. This simplifies the codebase by eliminating deprecated functions that were marked with TODOs for removal.


Type of change

Please check one:

  • Bug fix (fixes incorrect behavior)
  • New feature
  • Performance improvement
  • Documentation change with concrete technical impact
  • Style, wording, formatting, or typo-only change

Why is this change needed?

The codebase contained deprecated helper functions that were marked with TODOs for removal. These functions were intermediaries that added unnecessary complexity. By removing them and inlining their functionality directly where needed, we simplify the code and potentially improve performance by eliminating function call overhead.


What was the behavior or documentation before?

The code used two helper functions (core_libfunc_postcost and core_libfunc_precost) that were marked with TODOs for removal, indicating they were deprecated but still in use.


What is the behavior or documentation after?

The functionality of these helper functions has been inlined directly into the calling functions in core_libfunc_cost_expr.rs, maintaining the same behavior while simplifying the codebase.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor

@eytan-starkware eytan-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@eytan-starkware reviewed 2 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ilyalesokhin-starkware and @TomerStarkware).

@orizi orizi changed the base branch from orizi/01-27-performance_sierra-to-casm_better_top-stack-check_data-structure to graphite-base/9548 January 27, 2026 13:00
SIERRA_UPDATE_PATCH_CHANGE_TAG=Internal change only.
@orizi orizi force-pushed the graphite-base/9548 branch from 8f204b9 to 7ddbf0e Compare January 27, 2026 13:15
@orizi orizi force-pushed the orizi/01-27-refactor_sierra-gas_inlined_small_functions_that_are_only_used_once branch from dfafadc to 4071973 Compare January 27, 2026 13:15
@orizi orizi changed the base branch from graphite-base/9548 to main January 27, 2026 13:15
@orizi orizi enabled auto-merge January 27, 2026 13:17
Copy link
Collaborator Author

@orizi orizi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@orizi reviewed 1 file and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ilyalesokhin-starkware and @TomerStarkware).

@orizi orizi added this pull request to the merge queue Jan 27, 2026
Merged via the queue into main with commit a8d2185 Jan 27, 2026
108 checks passed
@orizi orizi deleted the orizi/01-27-refactor_sierra-gas_inlined_small_functions_that_are_only_used_once branch January 27, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants