-
Notifications
You must be signed in to change notification settings - Fork 13.3k
CopyProp: Propagate moves of constants #120689
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
Conversation
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
CopyProp: Propagate moves of constants Yet another try of rust-lang#120650 - this time, keep track of SSA locals with a constant value and propagate it. Then, re-run `SimplifyConstCondition` to take advantage of it (simply reordering the pass regressed some tests). r? `@ghost`
I suggest you take a look at the discussion about determinism of MIR constants in gvn.rs. There are case where the same MIR constant will yield a different value each time it is evaluated.
|
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (25ba6e3): 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: 660.166s -> 663.073s (0.44%) |
18f27f4
to
7a6abd5
Compare
Removed the pass ordering part. If perf looks happier, perhaps we can use this to simplify #120650 - rather than needing to @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
CopyProp: Propagate moves of constants Yet another try of rust-lang#120650 - this time, keep track of SSA locals with a constant value and propagate it. Then, re-run `SimplifyConstCondition` to take advantage of it (simply reordering the pass regressed some tests). r? `@ghost`
☀️ 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 (22f542c): comparison URL. Overall result: ❌ regressions - no 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. @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.272s -> 663.514s (0.04%) |
Small net improvements if I run perf locally, so I think just noise |
7a6abd5
to
0b0011c
Compare
It looks like the previous slight improvements to MIR in tests were also done by #120594. That said, this seems to be basically perf-neutral and a bit more general so may be worth having. r? compiler |
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
3be2167
to
cf02fa9
Compare
let (Rvalue::Use(Operand::Copy(place) | Operand::Move(place)) | ||
| Rvalue::CopyForDeref(place)) = rvalue | ||
else { | ||
let (Rvalue::Use(Operand::Copy(place)) | Rvalue::CopyForDeref(place)) = rvalue else { |
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.
Given that the Operand::Move
case does nothing (due to the check below), we can remove that here and remove the duplicated check below
r? cjgillot |
From the results of the #120650 (comment), do we still need this PR? Or should we merge #120650 on its own? |
First lets see if this still has any perf impact: @bors try @rust-timer queue I suspect not - if this comes up neutral I'll probably close |
This comment has been minimized.
This comment has been minimized.
CopyProp: Propagate moves of constants Yet another try of rust-lang#120650 - this time, keep track of SSA locals with a constant value and propagate it. Then, re-run `SimplifyConstCondition` to take advantage of it (simply reordering the pass regressed some tests). r? `@ghost`
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (1515cb7): comparison URL. Overall result: no relevant changes - no 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. @bors rollup=never Instruction countThis benchmark run did not return any relevant results for this metric. 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: 678.471s -> 677.873s (-0.09%) |
Yet another try of #120650 - this time, keep track of SSA locals with a constant value and propagate it. Then, re-run
SimplifyConstCondition
to take advantage of it (simply reordering the pass regressed some tests).r? @ghost