LLVM 23: Adapt codegen test to moved assume#158067
Merged
Merged
Conversation
Collaborator
|
r? @mu001999 rustbot has assigned @mu001999. Use Why was this reviewer chosen?The reviewer was selected based on:
|
Member
|
r? dianqk (creator of this test) |
Collaborator
|
|
dianqk
reviewed
Jun 19, 2026
| //@ [new] min-llvm-version: 23 | ||
|
|
||
| // Test for #107681. | ||
| // Make sure we don't create `br` or `select` instructions. |
This comment was marked as duplicate.
This comment was marked as duplicate.
Sorry, something went wrong.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Member
IIRC, they have different layouts, through I don't know why. Anyway, you can just ignore LLVM 21. |
Member
|
@bors r+ rollup |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 25, 2026
LLVM 23: Adapt codegen test to moved assume I wasn't completely sure what the important part of this test is - based on the "Make sure we don't create `br` or `select` instructions" comment I assume it's that the `load` is followed ~immediately by the `ret`, and that the presence or absence of the `assume` doesn't really matter (it's been moved up a few lines to before the `load`): ```ll ; Function Attrs define noundef i32 @foo(ptr noalias nofree noundef align 8 captures(none) dereferenceable(16) %x) unnamed_addr #0 { start %_6 = load ptr, ptr %x, align 8, !nonnull !4, !noundef !4 %0 = getelementptr inbounds nuw i8, ptr %x, i64 8 %_7 = load ptr, ptr %0, align 8, !nonnull !4, !noundef !4 %_8 = icmp ne ptr %_6, %_7 tail call void @llvm.assume(i1 %_8) %_14 = getelementptr inbounds nuw i8, ptr %_6, i64 4 store ptr %_14, ptr %x, align 8 %_4 = load i32, ptr %_6, align 4, !noundef !4 ret i32 %_4 } ``` @rustbot label llvm-main [original CI failure](https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/46608/list?sid=019ed950-c81f-466d-a3bc-2064e6a26719&tab=output)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 25, 2026
Rollup of 10 pull requests Successful merges: - #158410 (Update LLVM for Mach-O __LINKEDIT alignment fix.) - #157397 (cmse: clear padding when crossing the secure boundary) - #158036 (Add -Zinstrument-mcount=fentry to -Zinstrument-mcount) - #158330 (llvm: use intrinsics for f16, f32 minimum/maximum) - #158359 (fix(tests): allow either branch direction in ilog_known_base) - #158067 (LLVM 23: Adapt codegen test to moved assume) - #158261 (Move part of the target checking for `#[may_dangle]` to the parser) - #158358 (Fix invalid E0609 raw pointer deref suggestion inside macros) - #158392 (delegation: add tests for defaults and infers in generics) - #158394 (Generate synthetic generic args only for delegation's child segment)
rust-timer
added a commit
that referenced
this pull request
Jun 26, 2026
Rollup merge of #158067 - TimNN:moved-assume, r=dianqk LLVM 23: Adapt codegen test to moved assume I wasn't completely sure what the important part of this test is - based on the "Make sure we don't create `br` or `select` instructions" comment I assume it's that the `load` is followed ~immediately by the `ret`, and that the presence or absence of the `assume` doesn't really matter (it's been moved up a few lines to before the `load`): ```ll ; Function Attrs define noundef i32 @foo(ptr noalias nofree noundef align 8 captures(none) dereferenceable(16) %x) unnamed_addr #0 { start %_6 = load ptr, ptr %x, align 8, !nonnull !4, !noundef !4 %0 = getelementptr inbounds nuw i8, ptr %x, i64 8 %_7 = load ptr, ptr %0, align 8, !nonnull !4, !noundef !4 %_8 = icmp ne ptr %_6, %_7 tail call void @llvm.assume(i1 %_8) %_14 = getelementptr inbounds nuw i8, ptr %_6, i64 4 store ptr %_14, ptr %x, align 8 %_4 = load i32, ptr %_6, align 4, !noundef !4 ret i32 %_4 } ``` @rustbot label llvm-main [original CI failure](https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/46608/list?sid=019ed950-c81f-466d-a3bc-2064e6a26719&tab=output)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 27, 2026
…athanBrouwer Revert "LLVM 23: Adapt codegen test to moved assume" This reverts #158067. Fixes #158500 The fix that was applied here is not robust against layout randomization, specifically the IR to load through the slice head pointer needs to come after a gepi, and not just a `load ptr, ptr %x`. Based on the PR discussion, I think it's possible that the `min-llvm-version: 22` was mistakenly added when CI happened to choose the bad layout during the initial merge. I'm not yet sure what the right fix is, but this is causing about half of all merges to fail right now so a revert seems prudent. I don't think we have a way to skip tests when randomize-layout is set. The problem here is that we run codegen tests against the globally-configured sysroot, so setting `-Zrandomize-layout` in the test doesn't do anything.
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 27, 2026
…-fix, r=JonathanBrouwer Revert "LLVM 23: Adapt codegen test to moved assume" This reverts rust-lang#158067. Fixes rust-lang#158500 The fix that was applied here is not robust against layout randomization, specifically the IR to load through the slice head pointer needs to come after a gepi, and not just a `load ptr, ptr %x`. Based on the PR discussion, I think it's possible that the `min-llvm-version: 22` was mistakenly added when CI happened to choose the bad layout during the initial merge. I'm not yet sure what the right fix is, but this is causing about half of all merges to fail right now so a revert seems prudent. I don't think we have a way to skip tests when randomize-layout is set. The problem here is that we run codegen tests against the globally-configured sysroot, so setting `-Zrandomize-layout` in the test doesn't do anything.
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 27, 2026
…athanBrouwer Revert "LLVM 23: Adapt codegen test to moved assume" This reverts #158067. Fixes #158500 The fix that was applied here is not robust against layout randomization, specifically the IR to load through the slice head pointer needs to come after a gepi, and not just a `load ptr, ptr %x`. Based on the PR discussion, I think it's possible that the `min-llvm-version: 22` was mistakenly added when CI happened to choose the bad layout during the initial merge. I'm not yet sure what the right fix is, but this is causing about half of all merges to fail right now so a revert seems prudent. I don't think we have a way to skip tests when randomize-layout is set. The problem here is that we run codegen tests against the globally-configured sysroot, so setting `-Zrandomize-layout` in the test doesn't do anything.
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.
I wasn't completely sure what the important part of this test is - based on the "Make sure we don't create
brorselectinstructions" comment I assume it's that theloadis followed ~immediately by theret, and that the presence or absence of theassumedoesn't really matter (it's been moved up a few lines to before theload):@rustbot label llvm-main
original CI failure