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

feat[venom]: optimize mem2var and store/variable elimination pass sequences #4032

Merged
merged 5 commits into from
May 20, 2024

Conversation

harkal
Copy link
Collaborator

@harkal harkal commented May 18, 2024

What I did

Apply mem2var pass after we are in SSA form -as appropriate-, and add an additional store elimination pass after SCCP. Improves code size a bit.

How I did it

How to verify it

Commit message

The `Mem2Var` pass needs to operate on SSA form. This commit 
updates the order of passes to accommodate for this. Additionally
we add an extra `StoreElimination` pass after `SCCP` to further
reduce the generated code size.

Additionally, it updates the `RemoveUnusedVariablesPass` to eliminate
all unused variables without the need to be run multiple times.

Description for the changelog

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@harkal harkal marked this pull request as ready for review May 18, 2024 15:28
@charles-cooper
Copy link
Member

this seems fine. should we also add back in the loop for remove_unused_variables?

@charles-cooper
Copy link
Member

i think we call the store elimination pass too many times now -- i get identical bytecode across a range of contracts after removing the first store elimination pass

@harkal
Copy link
Collaborator Author

harkal commented May 20, 2024

i think we call the store elimination pass too many times now -- i get identical bytecode across a range of contracts after removing the first store elimination pass

I updated the pass to not require multiple calls!

@harkal harkal changed the title feat[venom]: optimize mem2var and store elimination pass sequence feat[venom]: optimize mem2var and store/variable elimination pass sequence May 20, 2024
Copy link
Member

@charles-cooper charles-cooper left a comment

Choose a reason for hiding this comment

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

lgtm. thanks!

@charles-cooper charles-cooper enabled auto-merge (squash) May 20, 2024 17:28
@charles-cooper charles-cooper changed the title feat[venom]: optimize mem2var and store/variable elimination pass sequence feat[venom]: optimize mem2var and store/variable elimination pass sequences May 20, 2024
@charles-cooper charles-cooper merged commit ac19367 into vyperlang:master May 20, 2024
154 checks passed
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.

None yet

2 participants