-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Only update Eq
operands in GVN if it can update both sides
#127105
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
Otherwise the types might not match Fixes 127089
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
// skip-filecheck | ||
//@ test-mir-pass: GVN | ||
//@ only-64bit | ||
//@ compile-flags: -Z mir-enable-passes=+Inline |
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 was enough to ICE it. If godbolt has updated to a new enough by the time you see this, hopefully that'll repro at https://rust.godbolt.org/z/84f4Ed3Kd.
- _6 = const Foo::<u8>::SENTINEL as *const u8 (PtrToPtr); | ||
- _1 = Eq(_4, _6); | ||
+ _6 = const {0x1 as *const u8}; | ||
+ _1 = const 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.
Could you add a test that does not reduce to a constant ?
R=me afterwards
@bors r=cjgillot |
Only update `Eq` operands in GVN if it can update both sides Otherwise the types might not match Fixes rust-lang#127089 r? mir-opt
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#126923 (test: dont optimize to invalid bitcasts) - rust-lang#127090 (Reduce merge conflicts from rustfmt's wrapping) - rust-lang#127105 (Only update `Eq` operands in GVN if it can update both sides) - rust-lang#127150 (Fix x86_64 code being produced for bare-metal LoongArch targets' `compiler_builtins`) - rust-lang#127181 (Introduce a `rustc_` attribute to dump all the `DefId` parents of a `DefId`) - rust-lang#127182 (Fix error in documentation for IpAddr::to_canonical and Ipv6Addr::to_canonical) - rust-lang#127191 (Ensure `out_of_scope_macro_calls` lint is registered) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#127105 - scottmcm:issue-127089, r=cjgillot Only update `Eq` operands in GVN if it can update both sides Otherwise the types might not match Fixes rust-lang#127089 r? mir-opt
Otherwise the types might not match
Fixes #127089
r? mir-opt