-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
MultipleReturnTerminators + SingleReturnTerminator #106550
Conversation
r? @davidtwco (rustbot has picked a reviewer for you, use r? to override) |
Ah crap sorry I forgot to ask for review from ghost @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit ca521b0e1fb89c0813cd1d75f1fa8d0112d818c4 with merge ebf0d2d3df7ddf24af902c6cb1401231a299dc2d... |
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (ebf0d2d3df7ddf24af902c6cb1401231a299dc2d): 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.
|
Can the SingleReturnTerminator be done on-the-fly during codegen? |
ca521b0
to
00b71b9
Compare
This comment has been minimized.
This comment has been minimized.
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit b878a1c88dad18f70c45c3753469a49ce1e1bca6 with merge 0c68d2596c4617e0a308139af6ad56d4ac858bf1... |
☀️ Try build successful - checks-actions |
1 similar comment
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (0c68d2596c4617e0a308139af6ad56d4ac858bf1): 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.
|
Finished benchmarking commit (597042ea7995e0681a2e2fbdcbaa41ff8bcd6c3b): 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.
|
MultipleReturnTerminators is maybe good for us but bad for LLVM. So this enables MultipleReturnTerminators and runs a SingleReturnTerminator pass at the end of optimizations.
I also noticed that MultipleReturnTerminators doesn't seem to preserve the SourceInfo quite as well as it could, the tweak to it here might improve debuginfo.
9031375
to
b9e06f1
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit b9e06f1 with merge cdbe287ec197b4df04fec87680c5779610f69a85... |
☀️ Try build successful - checks-actions |
@rust-timer queue |
This comment has been minimized.
This comment has been minimized.
@rust-timer build cdbe287ec197b4df04fec87680c5779610f69a85 |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (cdbe287ec197b4df04fec87680c5779610f69a85): 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.
|
Marking as waiting on author given that it's a draft and has conflicts. |
The theoretical benefit of this pass is that it could reduce the size of our MIR on disk. But based on the experimentation in this PR, it looks like this pass has a very marginal impact on the amount of MIR we produce. In addition, it looks to me like encoding/decoding MIR isn't a large enough fraction of our compile time to be concerned about marginal tweaks like this. |
MultipleReturnTerminators
was added with the thinking that we would do better MIR optimizations with that form. But LLVM does better when there is a single return terminator. So adding a new pass which turns back into the single terminator form should give us the best of both worlds.Locally, it looks like this change just rearranges/renames some things. If this doesn't look like an improvement in perf, I'm going to suggest that we remove
MultipleReturnTerminators
.