-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Simplify trivial constants in SimplifyConstCondition #147654
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
base: master
Are you sure you want to change the base?
Conversation
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Simplify trivial constants in SimplifyConstCondition
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (2d02757): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 0.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 3.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.0%, secondary 0.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 475.312s -> 475.552s (0.05%) |
3877315
to
dcd9af0
Compare
@bors2 try parent=last @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Simplify trivial constants in SimplifyConstCondition
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
r? @davidtwco rustbot has assigned @davidtwco. Use |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (2b77d79): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 0.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 3.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.0%, secondary 0.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 475.312s -> 474.926s (-0.08%) |
// optimizations. This invalidates CFG caches, so avoid putting between | ||
// `ReferencePropagation` and `GVN` which both use the dominator tree. | ||
&instsimplify::InstSimplify::AfterSimplifyCfg, | ||
&o1(simplify_branches::SimplifyConstCondition::AfterInstSimplify), |
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.
Could you add a comment to explain why you put this pass here?
64c5566
to
8f854f8
Compare
This comment has been minimized.
This comment has been minimized.
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.
One nit. r=me once CI is fixed.
TerminatorKind::UnwindResume | ||
| TerminatorKind::UnwindTerminate(_) | ||
| TerminatorKind::Drop { .. } | ||
| TerminatorKind::Call { .. } | ||
| TerminatorKind::TailCall { .. } | ||
| TerminatorKind::Assert { .. } | ||
| TerminatorKind::Yield { .. } | ||
| TerminatorKind::CoroutineDrop | ||
| TerminatorKind::FalseEdge { .. } | ||
| TerminatorKind::FalseUnwind { .. } | ||
| TerminatorKind::InlineAsm { .. } => false, |
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.
Should we move all terminators that don't write to memory to true
?
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.
I haven't seen that method, so I intend to check all terminators and add maybe_write_memory
in #147681.
8f854f8
to
bdc9444
Compare
bdc9444
to
0db7401
Compare
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
After
InstSimplify-after-simplifycfg
with-Zub_checks=false
, there are many of the following patterns.Simplifying them to unreachable early should make CFG simpler.