-
-
Notifications
You must be signed in to change notification settings - Fork 793
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
add some small LLL optimizations #2493
Conversation
peephole stack ops optimize JUMPIs
vyper/lll/compile_lll.py
Outdated
if assembly[i:i+3] == ["DUP1", "SWAP1", "POP"]: | ||
del assembly[i:i+2] | ||
continue | ||
if assembly[i:i+3] == ["SWAP1", "POP", "POP"]: | ||
del assembly[i] | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a little comment explaining why the optimization works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fubuloubu see d73f6ee
Codecov Report
@@ Coverage Diff @@
## master #2493 +/- ##
==========================================
- Coverage 84.60% 83.44% -1.16%
==========================================
Files 93 93
Lines 9228 9133 -95
Branches 2086 2087 +1
==========================================
- Hits 7807 7621 -186
- Misses 935 1023 +88
- Partials 486 489 +3
Continue to review full report at Codecov.
|
What I did
Add a couple peephole assembly optimizations and an LLL optimization for truthy sequences. Code size for three large-ish contracts comes down about 2.5%.
How I did it
How to verify it
Use the
vyper-lll
tool to inspect the output of this LLLDescription for the changelog
Optimize truthy sequences and peephole stack operations.
Cute Animal Picture