-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Perform opportunistic simplifications during value numbering #111344
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 7e731ee19e9a11414f711e82aa3f220342a97532 with merge d0c89341fa5520a74ff1a0c782163343027a602d... |
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (d0c89341fa5520a74ff1a0c782163343027a602d): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 654.499s -> 657.369s (0.44%) |
Optimization contributors just have to have a special place in their hearts for keccak. |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #111556) made this pull request unmergeable. Please resolve the merge conflicts. |
…illot,tmiasko Preprocess and cache dominator tree Preprocessing dominators has a very strong effect for rust-lang#111344. That pass checks that assignments dominate their uses repeatedly. Using the unprocessed dominator tree caused a quadratic runtime (number of bbs x depth of the dominator tree). This PR also caches the dominator tree and the pre-processed dominators in the MIR cfg cache. Rebase of rust-lang#107157 cc `@tmiasko`
…asko Preprocess and cache dominator tree Preprocessing dominators has a very strong effect for rust-lang/rust#111344. That pass checks that assignments dominate their uses repeatedly. Using the unprocessed dominator tree caused a quadratic runtime (number of bbs x depth of the dominator tree). This PR also caches the dominator tree and the pre-processed dominators in the MIR cfg cache. Rebase of rust-lang/rust#107157 cc `@tmiasko`
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #112418) made this pull request unmergeable. Please resolve the merge conflicts. |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #112724) made this pull request unmergeable. Please resolve the merge conflicts. |
Perform opportunistic simplifications during value numbering Based on rust-lang#109597 Opening mostly for discussion. In its current form, I think this pass does too much. I want to remove the const-propagation part to make it simpler.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (01915ea): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 668.324s -> 669.679s (0.20%) |
Implement constant propagation on top of MIR SSA analysis This implements the idea I proposed in rust-lang/rust#110719 (comment) Based on rust-lang/rust#109597 The value numbering "GVN" pass formulates each rvalue that appears in MIR with an abstract form (the `Value` enum), and assigns an integer `VnIndex` to each. This abstract form can be used to deduplicate values, reusing an earlier local that holds the same value instead of recomputing. This part is proposed in #109597. From this abstract representation, we can perform more involved simplifications, for example in rust-lang/rust#111344. With the abstract representation `Value`, we can also attempt to evaluate each to a constant using the interpreter. This builds a `VnIndex -> OpTy` map. From this map, we can opportunistically replace an operand or a rvalue with a constant if their value has an associated `OpTy`. The most relevant commit is [Evaluated computed values to constants.](rust-lang/rust@2767c49)" r? `@oli-obk`
935e283
to
dd79fd1
Compare
Fold arithmetic identities in GVN Extracted from rust-lang#111344 This PR implements a few arithmetic folds for unary and binary operations. This should take care of the missed optimizations introduced by rust-lang#116012.
Fold arithmetic identities in GVN Extracted from rust-lang#111344 This PR implements a few arithmetic folds for unary and binary operations. This should take care of the missed optimizations introduced by rust-lang#116012.
Fold arithmetic identities in GVN Extracted from rust-lang/rust#111344 This PR implements a few arithmetic folds for unary and binary operations. This should take care of the missed optimizations introduced by rust-lang/rust#116012.
dd79fd1
to
0167761
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Perform opportunistic simplifications during value numbering ~Based on rust-lang#109597 ~Based on rust-lang#119439 Opening mostly for discussion.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (2cd7dda): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 663.584s -> 667.018s (0.52%) |
Based on #109597Based on #119439Opening mostly for discussion.