-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[compiler-v2] Optimize stackless-bytecode assign instructions #15445
Merged
Conversation
This file contains 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
⏱️ 4h 48m total CI duration on this PR
|
vineethk
force-pushed
the
vk/assign-optimize
branch
from
December 2, 2024 20:26
c9f3ff7
to
427f426
Compare
vineethk
requested review from
areshand,
davidiw,
movekevin and
wrwg
as code owners
December 2, 2024 20:27
vineethk
requested review from
rahxephon89,
fEst1ck and
brmataptos
and removed request for
davidiw,
areshand and
movekevin
December 2, 2024 20:28
vineethk
commented
Dec 2, 2024
8: Add | ||
9: StLoc[3](loc0: u64) | ||
10: Branch(2) | ||
6: MoveLoc[2](Arg2: u64) |
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.
This is the only test case where we produce more instructions.
fEst1ck
approved these changes
Dec 3, 2024
brmataptos
approved these changes
Dec 3, 2024
vineethk
force-pushed
the
vk/assign-optimize
branch
from
December 4, 2024 02:06
be5ac38
to
abbfcf5
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
vineethk
force-pushed
the
vk/assign-optimize
branch
from
December 4, 2024 16:11
085c1fc
to
bc67f8b
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
✅ Forge suite
|
2 tasks
danielxiangzl
pushed a commit
that referenced
this pull request
Dec 12, 2024
danielxiangzl
pushed a commit
that referenced
this pull request
Dec 12, 2024
3 tasks
georgemitenkov
pushed a commit
that referenced
this pull request
Jan 6, 2025
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.
Description
When translating an
Assign(dst, src)
stackless bytecode instruction to file format bytecode, we copy or movesrc
onto the stack, then eagerly store it to a local corresponding todst
.Instead, now, when the
AVOID_STORE_IN_ASSIGNS
experiment is enabled, once we copy or movesrc
onto the stack, we just rename that value todst
(in many cases, this avoids a store).Another way to think about this optimization: when we have
dst = src;
, it is now treated similar todst = noop_function(src);
: we pushsrc
as if it were an argument, "consume" it (leading to popping it off the abstract stack), and then pushdst
onto the abstract stack as a result of thisnoop_function
call.The max gas taken for executing gov. proposal also goes down (by about 2.5%) with compiler v2 compared to compiler v1.
How Has This Been Tested?
Key Areas to Review
Type of Change
Which Components or Systems Does This Change Impact?