Uh oh!
There was an error while loading. Please reload this page.
Fix unsound optimization with explicit variant discriminants - #89489
Conversation
rust-highfive
commented
Oct 3, 2021
r? @oli-obk (rust-highfive has picked a reviewer for you, use r? to override) |
oli-obk
commented
Oct 3, 2021
lgtm, tho we should do some cleanups of the opt after this is merged r? @tmiasko for another pair of eyes |
tmiasko
commented
Oct 3, 2021
The change seems reasonable. At the same time I can't really follow the preexisting implementation. Why the left hand side of the assignment is ignored for the purposes of the comparison? How do we know that place that we read the discriminant from still holds the same value? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
@tmiasko so I guess let's disable the opt in addition to this fix until we have a clearer picture of how it works? |
tmiasko
commented
Oct 3, 2021
Sounds good to me. |
oli-obk
commented
Oct 3, 2021
@FabianWolff please also add an early abort in the mir opt with so that we don't run the opt at all in normal mode |
FabianWolff
commented
Oct 3, 2021
@oli-obk Done. |
wesleywiser
commented
Oct 3, 2021
@bors r=oli-obk p=1 Fixes P-critical issue. |
bors
commented
Oct 3, 2021
📌 Commit dd9b476 has been approved by |
Beta nominating so we can get this fix out sooner. The most important change is that we've disabled the pass by default which is safe and should be very easy to backport. |
bors
commented
Oct 4, 2021
⌛ Testing commit dd9b476 with merge a6bea3af357e9103d5a9470030a30980f63deed3... |
nbdd0121
commented
Oct 4, 2021
Should this be backported to stable? |
| @@ -0,0 +1,18 @@ | |||
| // Regression test for issue #89485. | |||
There was a problem hiding this comment.
I think it would be a good idea to add a copy of this test with -Zunsound-mir-opts enabled
bors
commented
Oct 4, 2021
💥 Test timed out |
rust-log-analyzer
commented
Oct 4, 2021
wesleywiser
commented
Oct 4, 2021
@bors retry |
bors
commented
Oct 4, 2021
bors
commented
Oct 4, 2021
☀️ Test successful - checks-actions |
wesleywiser
commented
Oct 4, 2021
It's a good question @nbdd0121 . IMO, since we're about 1.5 weeks from the next release, beta backport seems sufficient to me. |
rust-timer
commented
Oct 4, 2021
Finished benchmarking commit (a479766): comparison url. Summary: This change led to small relevant regressions 😿 in compiler performance.
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 |
oli-obk
commented
Oct 4, 2021
@rustbot label: +perf-regression-triaged we disabled an unsound MIR opt. LLVM can't figure this out on its own sadly. |
apiraino
commented
Oct 7, 2021
[beta] backports - 2229: Consume IfLet expr rust-lang#89282 - Wrapper for -Z gcc-ld=lld to invoke rust-lld with the correct flavor rust-lang#89288 - Fix unsound optimization with explicit variant discriminants rust-lang#89489 - Fix stabilization version for bindings_after_at rust-lang#89605 - Turn vtable_allocation() into a query rust-lang#89619 - Revert "Stabilize Iterator::intersperse()" rust-lang#89638 - Ignore type of projections for upvar capturing rust-lang#89648 - ~~Add Poll::ready and~~ revert stabilization of task::ready! rust-lang#89651 - CI: Use mirror for libisl downloads for more docker dist builds rust-lang#89661 - Use correct edition for panic in [debug_]assert!(). rust-lang#89622 - Switch to our own mirror of libisl plus ct-ng oldconfig fixesrust-lang#89599 - Emit item no type error even if type inference fails rust-lang#89585 - Revert enum discriminants rust-lang#89884
Fixes#89485.