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 support for div-rem const folding. #6433

Merged
merged 1 commit into from
Oct 6, 2024
Merged

Added support for div-rem const folding. #6433

merged 1 commit into from
Oct 6, 2024

Conversation

orizi
Copy link
Collaborator

@orizi orizi commented Sep 30, 2024

Copy link
Contributor

@gilbens-starkware gilbens-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 4 of 4 files at r1.
Reviewable status: 3 of 4 files reviewed, 1 unresolved discussion (waiting on @orizi)


crates/cairo-lang-lowering/src/optimizations/const_folding.rs line 229 at r1 (raw file):

        &mut self,
        stmt: &mut StatementCall,
    ) -> Option<(StatementConst, Option<StatementConst>)> {

Isn't a potentially empty vec of additional consts more expressive in this case?

Suggestion:

Vec<StatementConst>

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: 3 of 4 files reviewed, 1 unresolved discussion (waiting on @gilbens-starkware)


crates/cairo-lang-lowering/src/optimizations/const_folding.rs line 229 at r1 (raw file):

Previously, gilbens-starkware (Gil Ben-Shachar) wrote…

Isn't a potentially empty vec of additional consts more expressive in this case?

maybe just adding the additionals vec as a parameter.
returning a vec entitled more.

@orizi orizi changed the base branch from spr/main/51f0d664 to main October 6, 2024 07:29
@orizi orizi force-pushed the spr/main/b582d31f branch from 5325582 to aad1e74 Compare October 6, 2024 07:29
Copy link
Contributor

@gilbens-starkware gilbens-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed all commit messages.
Reviewable status: 3 of 4 files reviewed, 1 unresolved discussion (waiting on @orizi)


crates/cairo-lang-lowering/src/optimizations/const_folding.rs line 229 at r1 (raw file):

Previously, orizi wrote…

maybe just adding the additionals vec as a parameter.
returning a vec entitled more.

I'm fine with any of these

Copy link
Contributor

@gilbens-starkware gilbens-starkware 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: 3 of 4 files reviewed, 1 unresolved discussion (waiting on @orizi)


crates/cairo-lang-lowering/src/optimizations/const_folding.rs line 229 at r1 (raw file):

Previously, gilbens-starkware (Gil Ben-Shachar) wrote…

I'm fine with any of these

But yes, a vec parameter seems good, as the output simply extends a vec anyway

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: 3 of 4 files reviewed, 1 unresolved discussion (waiting on @gilbens-starkware)


crates/cairo-lang-lowering/src/optimizations/const_folding.rs line 229 at r1 (raw file):

Previously, gilbens-starkware (Gil Ben-Shachar) wrote…

But yes, a vec parameter seems good, as the output simply extends a vec anyway

it is somewhat of a discrepancy with the other block-end handler.
(and there we directly add to the block statements - which is somewhat better than prepending)
but will do anyway.

@orizi orizi force-pushed the spr/main/b582d31f branch from aad1e74 to e4398cb Compare October 6, 2024 07:47
@orizi orizi enabled auto-merge October 6, 2024 07:50
Copy link
Contributor

@gilbens-starkware gilbens-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 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @orizi)

@orizi orizi added this pull request to the merge queue Oct 6, 2024
Merged via the queue into main with commit 71c7391 Oct 6, 2024
44 checks passed
@orizi orizi deleted the spr/main/b582d31f branch October 10, 2024 08:36
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.

2 participants