-
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
Disable the SimplifyArmIdentity
pass
#73262
Disable the SimplifyArmIdentity
pass
#73262
Conversation
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
If we aren't in a rush about this, please open a PR against master with this change that we can backport to beta. |
This pass is buggy so I'm disabling it to fix a stable-to-beta regression. Related to rust-lang#73223
☔ The latest upstream changes made this pull request unmergeable. Please resolve the merge conflicts. |
5f63f6d
to
f160583
Compare
Rebased |
@bors r+ |
📌 Commit f160583 has been approved by |
Since the linked PR is @bors p=1 |
SimplifyArmIdentity
pass on betaSimplifyArmIdentity
pass
bumping this higher to run after the current rollup @bors p=3 |
⌛ Testing commit f160583 with merge 664f6df82aa3cc4f3ad1eec7dd277b061938f7da... |
💔 Test failed - checks-azure |
@bors retry |
@bors retry |
@bors retru p=1000 |
@bors retry p=1000 |
@bors treeclosed- |
@bors treeclosed-- |
☀️ Test successful - checks-azure |
This caused a small perf regression in a couple of @wesleywiser: will this pass be re-enabled in the future? |
@nnethercote Yes! I'm working on finishing up some changes that will re-enable this on nightly. |
The manner in which this was disabled seems relevant to a recent wg-mir-opt conversation on zulip. I guess if opt-level >= 2 is generally known to denote potentially buggy optimizations, then what's done here is okay. But I don't know if that's the consensus based on the above linked conversation... |
(I was tempted to unilaterally beta approve this, but I'm hesitating due to not knowing if it matches the semantics everyone else expects from the mir-opt levels. We'll just discuss as a group tomorrow instead.) |
@pnkfelix The current state is that |
@wesleywiser I presume you'll add some tests that demonstrate the bug, too? |
@nikomatsakis Yes, I'm adding some regression tests in the next PR. |
Discussed at T-compiler meeting; approved for beta backport |
@@ -306,7 +306,11 @@ fn optimization_applies<'tcx>( | |||
} | |||
|
|||
impl<'tcx> MirPass<'tcx> for SimplifyArmIdentity { | |||
fn run_pass(&self, _: TyCtxt<'tcx>, source: MirSource<'tcx>, body: &mut Body<'tcx>) { | |||
fn run_pass(&self, tcx: TyCtxt<'tcx>, source: MirSource<'tcx>, body: &mut Body<'tcx>) { | |||
if tcx.sess.opts.debugging_opts.mir_opt_level < 2 { |
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.
Uh, could we maybe not keep buggy passes running at all? I think a -Zmir-opt-level=3
miscompilation is a soundness bug just like it would be at a lower optimization level.
C/C++ programmers seem to associate "high optimization levels" with "creates buggy code", but really that's awful and we shouldn't do it.
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.
@RalfJung I opened a related MCP: rust-lang/compiler-team#319
If you have thoughts about it, please leave a comment there. Thanks!
…ulacrum [beta] backports This PR backports the following: * Make novel structural match violations not a `bug` rust-lang#73446 * linker: Never pass `-no-pie` to non-gnu linkers rust-lang#73384 * Disable the `SimplifyArmIdentity` pass rust-lang#73262 * Allow inference regions when relating consts rust-lang#73225 * Fix link error with #[thread_local] introduced by rust-lang#71192 rust-lang#73065 * Ensure stack when building MIR for matches rust-lang#72941 * Don't create impl candidates when obligation contains errors rust-lang#73005 r? @ghost
This pass is buggy so I'm disabling it to fix a stable-to-beta
regression.
Related to #73223