-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Disable almost certainly unsound early otherwise branch MIR opt #95161
Conversation
9937085
to
a2f3a17
Compare
// // code | ||
// } | ||
// _ => { | ||
// // don't use Q |
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.
This does use Q. The match does tmp = discriminant(Q)
and then switchInt(tmp)
to jump to the right arm.
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.
It's not actually important what happens in this branch because we don't take the arm of the outer match that includes match q
anyway (in the code path we miscompile). It's only important that this branch is trivially the same as the other "don't use q" branch - the optimization will see that they do the same thing, and replace the outer match with
if discrim(p) == discrim(q)
I suppose this should really read "do the same thing as in the other fall through branch"
📌 Commit a2f3a17 has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (cf85310): comparison url. Summary: This benchmark run shows 16 relevant regressions 😿 to instruction counts.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression |
@rustbot label +perf-regression-triaged This is a soundness fix, and impact on primary benchmarks is minimal. Marking as triaged. |
Originally thought this was just an MIR semantics issue, but it's not.
r? rust-lang/mir-opt