-
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
Run InstSimplify before UnreachablePropagation #123256
Conversation
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Run InstSimplify before UnreachablePropagation This is the pass ordering change I was musing about: rust-lang#122975 (comment) r? `@ghost`
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 (49d1f0a): 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: 670.332s -> 671.609s (0.19%) |
The optimized MIR for
To this:
That is very surprising to me. |
0b77e30
to
0da8676
Compare
Oh I see the problem. ReferencePropagation does this: _6 = &(((*_1) as Err).0: E);
StorageLive(_7);
StorageLive(_8);
- _8 = &(*_6);
+ _8 = &(((*_1) as Err).0: E);
_7 = <E as Clone>::clone(move _8) -> [return: bb5, unwind continue];
} Then But if we move InstCombine before ReferencePropagation, InstCombine gets to see the reborrow and turns it into an assignment. Then SimplifyLocals considers optimizing out @cjgillot I only see this pattern crop up twice in |
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Run InstSimplify before UnreachablePropagation This is the pass ordering change I was musing about: rust-lang#122975 (comment) r? `@ghost`
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 (66e8eb9): 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.134s -> 670.326s (0.33%) |
0da8676
to
1d4fa84
Compare
Reference propagation could absolutely do that transform. We'd lose some information about reborrows, but none we actually use, so that's OK. |
☔ The latest upstream changes (presumably #122225) made this pull request unmergeable. Please resolve the merge conflicts. |
I'm going to close this because I think the right action here is to not do what I was envisioning, but to improve ReferencePropagation. |
This is the pass ordering change I was musing about: #122975 (comment)
r? @ghost