Only update Eq operands in GVN if it can update both sides#127105
Merged
bors merged 2 commits intorust-lang:masterfrom Jul 1, 2024
Merged
Only update Eq operands in GVN if it can update both sides#127105bors merged 2 commits intorust-lang:masterfrom
Eq operands in GVN if it can update both sides#127105bors merged 2 commits intorust-lang:masterfrom
Conversation
Otherwise the types might not match Fixes 127089
Collaborator
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
scottmcm
commented
Jun 29, 2024
| // skip-filecheck | ||
| //@ test-mir-pass: GVN | ||
| //@ only-64bit | ||
| //@ compile-flags: -Z mir-enable-passes=+Inline |
Member
Author
There was a problem hiding this comment.
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.
cjgillot
reviewed
Jun 29, 2024
| - _6 = const Foo::<u8>::SENTINEL as *const u8 (PtrToPtr); | ||
| - _1 = Eq(_4, _6); | ||
| + _6 = const {0x1 as *const u8}; | ||
| + _1 = const true; |
Contributor
There was a problem hiding this comment.
Could you add a test that does not reduce to a constant ?
R=me afterwards
Member
Author
|
@bors r=cjgillot |
Collaborator
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Jul 1, 2024
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
This was referenced Jul 1, 2024
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 1, 2024
…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
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 1, 2024
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Otherwise the types might not match
Fixes #127089
r? mir-opt