feat[venom]: add codesize optimization pass#4333
Merged
charles-cooper merged 24 commits intovyperlang:masterfrom Dec 20, 2024
Merged
feat[venom]: add codesize optimization pass#4333charles-cooper merged 24 commits intovyperlang:masterfrom
charles-cooper merged 24 commits intovyperlang:masterfrom
Conversation
harkal
reviewed
Oct 29, 2024
Comment on lines
+12
to
+15
| i = 0 | ||
| while i < len(bb.instructions): | ||
| inst = bb.instructions[i] | ||
| i += 1 |
Collaborator
There was a problem hiding this comment.
Suggested change
| i = 0 | |
| while i < len(bb.instructions): | |
| inst = bb.instructions[i] | |
| i += 1 | |
| for inst in bb.instructions: |
harkal
reviewed
Oct 29, 2024
|
|
||
| val = op.value | ||
|
|
||
| if val == (2**256 - 1): |
Collaborator
There was a problem hiding this comment.
Make use of constants that we have for numbers like these
harkal
reviewed
Oct 29, 2024
harkal
reviewed
Oct 29, 2024
harkal
reviewed
Oct 29, 2024
harkal
requested changes
Oct 29, 2024
Collaborator
harkal
left a comment
There was a problem hiding this comment.
I have made some comments in the code above. Additionally, we could add some tests for the optimization cases.
Member
Author
|
@cyberthirst could you take a look at the tests and see if you want to add any cases? |
…hen not but both of them could be applied
Tests for venom codesize and better chosing of optimization
HodanPlodky
approved these changes
Dec 20, 2024
harkal
approved these changes
Dec 20, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
How I did it
How to verify it
saves 450 bytes (2.5%) on https://gist.github.com/charles-cooper/eed70340aee2a47478ca0fc2ea6d5140
Commit message
Description for the changelog
Cute Animal Picture