-
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][optimization] Create and retain temps for each arg #15514
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
⏱️ 1h 39m total CI duration on this PR
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
f1475b9
to
55e3631
Compare
55e3631
to
92aaf1d
Compare
brmataptos
reviewed
Dec 7, 2024
third_party/move/move-compiler-v2/src/pipeline/dead_store_elimination.rs
Show resolved
Hide resolved
third_party/move/move-compiler-v2/src/pipeline/flush_writes_processor.rs
Show resolved
Hide resolved
92aaf1d
to
49843f8
Compare
3 tasks
rahxephon89
approved these changes
Dec 13, 2024
fEst1ck
approved these changes
Dec 13, 2024
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
|
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
vineethk
added a commit
that referenced
this pull request
Dec 16, 2024
vineethk
added a commit
that referenced
this pull request
Dec 16, 2024
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
This PR builds on the optimization made in #15445 where we optimized
Assign
stackless-bytecode instructions. In this PR, when generating stackless-bytecode, we create temporaries for each argument (even if they are simple variables), retain those assignments (through dead-store elimination) if they represent cross-block def-uses. In this way, the file-format bytecode generator knows when to load the cross-block definitions (fixes #15339, by essentially implementing eager loads optimization in a different way). The flush writes optimization needs additional logic to handle this pipeline.With the optimization in this PR, on the aptos-framework and all its dependencies (std libs):
Note that all changes introduced here should be hidden behind
OPTIMIZE_WAITING_FOR_COMPARE_TESTS
experiment (which is turned off by default), so landing this PR should not affect code generated.Safety arguments:
x = x
should be safeA couple of examples of this optimization working:
This code:
produces before this PR:
after this PR:
This code:
produces before this PR:
after this PR:
How Has This Been Tested?
I've gone through all the test output changes:
Key Areas to Review
Type of Change
Which Components or Systems Does This Change Impact?