-
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
Do not unify dereferences of shared borrows in GVN #132461
Conversation
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
This comment has been minimized.
This comment has been minimized.
Some changes occurred in coverage tests. cc @Zalathar |
Do you think it makes sense to invalidate all known |
Thanks! |
// CHECK: _0 = Eq({{.*}}, {{.*}}); | ||
// CHECK-NOT: _0 = const true; | ||
let y = **x; | ||
unsafe { unknown() }; |
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.
Here~ @RalfJung
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.
Ah, that's drowning in all the other diff noise for tests changing their output.^^
I find mir-opt diffs completely unreadable so I largely skip them...
@@ -0,0 +1,24 @@ | |||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY |
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.
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY | |
//! Regression test for <https://github.com/rust-lang/rust/issues/130853> | |
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY |
Okay, the code diff as well as the new test seem right to me. I have absolutely no idea what to do with the remaining diff.^^ |
// CHECK: assert(const true, | ||
// CHECK: [[a]] = const 2_u32; | ||
// CHECK-NOT: assert(const true, | ||
// CHECK-NOT: [[a]] = const 2_u32; |
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.
Seems odd to have tests asserting that an optimization does not happen. Shouldn't we instead keep the old assertions but comment them out?
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.
There is COM:
prefix for that, i.e. COM: CHECK: assert(const true,
but it nice to add fixme for that, to not to forget what it was about.
@rustbot author |
☔ The latest upstream changes (presumably #132863) made this pull request unmergeable. Please resolve the merge conflicts. |
Do not unify dereferences of shared borrows in GVN Repost of rust-lang#132461, the last commit applies my suggestions. Fixes rust-lang#130853
Closing in favor of #133474 |
…errors Do not unify dereferences of shared borrows in GVN Repost of rust-lang#132461, the last commit applies my suggestions. Fixes rust-lang#130853
Do not unify dereferences of shared borrows in GVN Repost of rust-lang/rust#132461, the last commit applies my suggestions. Fixes rust-lang/rust#130853
The pass as written does not differentiate single deref or nested derefs, so I'm gating the entire unification on
-Zunsound-mir-opts
. This has the unfortunate effect of preventing reading from statics.Fixes #130853
r? @RalfJung