Skip to content

Commit 47ab177

Browse files
committed
Auto merge of #158502 - saethlin:revert-flaky-codegen-test-fix, r=JonathanBrouwer
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.
2 parents 13f1859 + 96bf9d6 commit 47ab177

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
//@ compile-flags: -Copt-level=3
2-
//@ filecheck-flags: --implicit-check-not 'br {{.*}}' --implicit-check-not 'select'
3-
//@ min-llvm-version: 22
42

53
// Test for #107681.
64
// Make sure we don't create `br` or `select` instructions.
@@ -13,8 +11,10 @@ use std::slice::Iter;
1311
#[no_mangle]
1412
pub unsafe fn foo(x: &mut Copied<Iter<'_, u32>>) -> u32 {
1513
// CHECK-LABEL: @foo(
16-
// CHECK: [[INNER:%.*]] = load ptr, ptr %x
17-
// CHECK: [[RET:%.*]] = load i32, ptr [[INNER]]
18-
// CHECK: ret i32 [[RET]]
14+
// CHECK-NOT: br {{.*}}
15+
// CHECK-NOT: select
16+
// CHECK: [[RET:%.*]] = load i32, ptr
17+
// CHECK-NEXT: assume
18+
// CHECK-NEXT: ret i32 [[RET]]
1919
x.next().unwrap_unchecked()
2020
}

0 commit comments

Comments
 (0)