Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added breaking of stack if no longer holding a var as temp. #4777

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

orizi
Copy link
Collaborator

@orizi orizi commented Jan 10, 2024

Closes #4744


This change is Reviewable

@ilyalesokhin-starkware
Copy link
Contributor

crates/cairo-lang-sierra-generator/src/store_variables/state.rs line 152 at r1 (raw file):

            self.known_stack.insert_signed(res, idx);
        } else if let Some(idx) = removed {
            self.known_stack.handle_possible_hole(idx);

is this an optimization to reduce the memory usage of the compiler?

Code quote:

   self.known_stack.handle_possible_hole(idx);

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.

Reviewable status: 0 of 3 files reviewed, 2 unresolved discussions (waiting on @ilyalesokhin-starkware)


crates/cairo-lang-sierra-generator/src/store_variables/state.rs line 152 at r1 (raw file):

Previously, ilyalesokhin-starkware wrote…

is this an optimization to reduce the memory usage of the compiler?

no - added an edit in the added test to show what was the result before.


crates/cairo-lang-sierra-generator/src/store_variables/test.rs line 869 at r1 (raw file):

            "store_temp<felt252>(100) -> (200)",
            "store_temp<felt252>(101) -> (201)",
            "return(201)",

which is the wrong result.

Suggestion:

            "make_local(102) -> (102)",
            "rename<felt252>(100) -> (200)",
            "rename<felt252>(101) -> (201)",
            "return(201)",

@orizi orizi force-pushed the orizi/break-stack branch from d7471ef to 50d698c Compare January 11, 2024 09:04
Copy link
Contributor

@ilyalesokhin-starkware ilyalesokhin-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:

Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: 2 of 3 files reviewed, 1 unresolved discussion

@orizi orizi added this pull request to the merge queue Jan 11, 2024
Merged via the queue into main with commit fb1e2d1 Jan 11, 2024
@orizi orizi deleted the orizi/break-stack branch January 15, 2024 08:20
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.

bug: One of the arguments does not satisfy the requirements of the libfunc.
2 participants