From 26c5d2155ec0de8e871e22550a96ac4ccab6b660 Mon Sep 17 00:00:00 2001 From: Augie Fackler Date: Tue, 1 Mar 2022 15:28:50 -0500 Subject: [PATCH 1/2] tests: accept llvm intrinsic in align-checking test This changed in upstream change https://reviews.llvm.org/D98152 (aka https://github.com/llvm/llvm-project/commit/a266af721153fab6452094207b09ed265ab0be7b) wherein LLVM got smarter about using intrinsics. As best I can tell the change I've made here preserves the intent of the test on LLVM 14 and before while also passing on LLVM 15 and later. --- src/test/codegen/dst-vtable-align-nonzero.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/codegen/dst-vtable-align-nonzero.rs b/src/test/codegen/dst-vtable-align-nonzero.rs index 021c7b19f89f5..bcc24e3fc4936 100644 --- a/src/test/codegen/dst-vtable-align-nonzero.rs +++ b/src/test/codegen/dst-vtable-align-nonzero.rs @@ -24,6 +24,7 @@ pub fn eliminates_runtime_check_when_align_1( x: &Struct> ) -> &WrapperWithAlign1 { // CHECK: load [[USIZE:i[0-9]+]], {{.+}} !range [[RANGE_META:![0-9]+]] + // CHECK-NOT: tail call i64 @llvm.umax.i64 // CHECK-NOT: icmp // CHECK-NOT: select // CHECK: ret @@ -36,8 +37,7 @@ pub fn does_not_eliminate_runtime_check_when_align_2( x: &Struct> ) -> &WrapperWithAlign2 { // CHECK: [[X0:%[0-9]+]] = load [[USIZE]], {{.+}} !range [[RANGE_META]] - // CHECK: [[X1:%[0-9]+]] = icmp {{.+}} [[X0]] - // CHECK: [[X2:%[0-9]+]] = select {{.+}} [[X1]] + // CHECK: {{icmp|llvm.umax.i64}} // CHECK: ret &x.dst } From 6fbef7f12cd0a6caeb65ae002334ddd7565e11a0 Mon Sep 17 00:00:00 2001 From: Augie Fackler Date: Tue, 1 Mar 2022 16:07:46 -0500 Subject: [PATCH 2/2] tests: avoid problems on 32 bit machines --- src/test/codegen/dst-vtable-align-nonzero.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/codegen/dst-vtable-align-nonzero.rs b/src/test/codegen/dst-vtable-align-nonzero.rs index bcc24e3fc4936..14c4c3f30f94a 100644 --- a/src/test/codegen/dst-vtable-align-nonzero.rs +++ b/src/test/codegen/dst-vtable-align-nonzero.rs @@ -24,7 +24,7 @@ pub fn eliminates_runtime_check_when_align_1( x: &Struct> ) -> &WrapperWithAlign1 { // CHECK: load [[USIZE:i[0-9]+]], {{.+}} !range [[RANGE_META:![0-9]+]] - // CHECK-NOT: tail call i64 @llvm.umax.i64 + // CHECK-NOT: llvm.umax // CHECK-NOT: icmp // CHECK-NOT: select // CHECK: ret @@ -37,7 +37,7 @@ pub fn does_not_eliminate_runtime_check_when_align_2( x: &Struct> ) -> &WrapperWithAlign2 { // CHECK: [[X0:%[0-9]+]] = load [[USIZE]], {{.+}} !range [[RANGE_META]] - // CHECK: {{icmp|llvm.umax.i64}} + // CHECK: {{icmp|llvm.umax}} // CHECK: ret &x.dst }