Skip to content

Commit c772af7

Browse files
authored
Rollup merge of #146732 - durin42:llvm-22-less-assumes, r=nikic
tests: relax expectations after llvm change 902ddda120a5 LLVM 22 is able to drop assumes that seem to not help further optimizations, which actually seems to dramatically _help_ further optimizations in some of our small test cases. I'm a little unclear how to fix the last failure, in `tests/codegen-llvm/issues/issue-122600-ptr-discriminant-update.rs`: ``` -; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: write) uwtable +; Function Attrs: mustprogress nofree norecurse nosync nounwind nonlazybind willreturn memory(argmem: readwrite, inaccessiblemem: write) uwtable define void ``@update(ptr`` noundef captures(none) %s) unnamed_addr #0 { start: - %_3.sroa.0.0.copyload = load i8, ptr %s, align 1 - %0 = trunc nuw i8 %_3.sroa.0.0.copyload to i1 - %1 = xor i1 %0, true - tail call void ``@llvm.assume(i1`` %1) store i8 1, ptr %s, align 1 ret void } ``` I'm just not conversant enough in LLVM IR to follow the changes here. ``@rustbot`` label llvm-main r? nikic
2 parents 01c17f8 + 99456cc commit c772af7

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

tests/codegen-llvm/issues/issue-122600-ptr-discriminant-update.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
//@ compile-flags: -Copt-level=3
2+
//@ revisions: new old
3+
//@ [old] max-llvm-major-version: 21
4+
//@ [new] min-llvm-version: 22
25

36
#![crate_type = "lib"]
47

@@ -22,8 +25,8 @@ pub unsafe fn update(s: *mut State) {
2225
// CHECK-NOT: memcpy
2326
// CHECK-NOT: 75{{3|4}}
2427

25-
// CHECK: %[[TAG:.+]] = load i8, ptr %s, align 1
26-
// CHECK-NEXT: trunc nuw i8 %[[TAG]] to i1
28+
// old: %[[TAG:.+]] = load i8, ptr %s, align 1
29+
// old-NEXT: trunc nuw i8 %[[TAG]] to i1
2730

2831
// CHECK-NOT: load
2932
// CHECK-NOT: store

tests/codegen-llvm/vec_pop_push_noop.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
//@ compile-flags: -Copt-level=3
2+
//@ revisions: new old
3+
//@ [old] max-llvm-major-version: 21
4+
//@ [new] min-llvm-version: 22
25

36
#![crate_type = "lib"]
47

@@ -7,7 +10,7 @@
710
pub fn noop(v: &mut Vec<u8>) {
811
// CHECK-NOT: grow_one
912
// CHECK-NOT: call
10-
// CHECK: tail call void @llvm.assume
13+
// old: tail call void @llvm.assume
1114
// CHECK-NOT: grow_one
1215
// CHECK-NOT: call
1316
// CHECK: {{ret|[}]}}

tests/codegen-llvm/vecdeque_pop_push.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
//@ compile-flags: -Copt-level=3
2+
//@ revisions: new old
3+
//@ [old] max-llvm-major-version: 21
4+
//@ [new] min-llvm-version: 22
25

36
#![crate_type = "lib"]
47

@@ -8,7 +11,7 @@ use std::collections::VecDeque;
811
// CHECK-LABEL: @noop_back(
912
pub fn noop_back(v: &mut VecDeque<u8>) {
1013
// CHECK-NOT: grow
11-
// CHECK: tail call void @llvm.assume
14+
// old: tail call void @llvm.assume
1215
// CHECK-NOT: grow
1316
// CHECK: ret
1417
if let Some(x) = v.pop_back() {

0 commit comments

Comments
 (0)