[llvm] 555f384 - [Inline] Avoid branch on undef UB in tests (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 3 03:44:27 PST 2023
Author: Nikita Popov
Date: 2023-01-03T12:44:20+01:00
New Revision: 555f384c2953a59df063adde359a04ccc5815d41
URL: https://github.com/llvm/llvm-project/commit/555f384c2953a59df063adde359a04ccc5815d41
DIFF: https://github.com/llvm/llvm-project/commit/555f384c2953a59df063adde359a04ccc5815d41.diff
LOG: [Inline] Avoid branch on undef UB in tests (NFC)
Added:
Modified:
llvm/test/Transforms/Inline/inline-assume.ll
llvm/test/Transforms/Inline/inline-constexpr-addrspacecast-argument.ll
llvm/test/Transforms/Inline/partial-inline-incompat-attrs.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/Inline/inline-assume.ll b/llvm/test/Transforms/Inline/inline-assume.ll
index 287a5625ea77d..b1e3e72a37034 100644
--- a/llvm/test/Transforms/Inline/inline-assume.ll
+++ b/llvm/test/Transforms/Inline/inline-assume.ll
@@ -6,9 +6,9 @@
%struct.Foo = type { i32, ptr }
; Test that we don't crash when inlining @bar (rdar://22521387).
-define void @foo(ptr align 4 %a) {
+define void @foo(i1 %c, ptr align 4 %a) {
entry:
- call fastcc void @bar(ptr nonnull align 4 undef)
+ call fastcc void @bar(i1 %c, ptr nonnull align 4 undef)
; CHECK: call void @llvm.assume(i1 undef)
; CHECK: unreachable
@@ -16,11 +16,11 @@ entry:
ret void
}
-define fastcc void @bar(ptr align 4 %a) {
+define fastcc void @bar(i1 %c, ptr align 4 %a) {
; CHECK-LABEL: @bar
entry:
%b = getelementptr inbounds %struct.Foo, ptr %a, i32 0, i32 1
- br i1 undef, label %if.end, label %if.then.i.i
+ br i1 %c, label %if.end, label %if.then.i.i
if.then.i.i:
call void @llvm.assume(i1 undef)
diff --git a/llvm/test/Transforms/Inline/inline-constexpr-addrspacecast-argument.ll b/llvm/test/Transforms/Inline/inline-constexpr-addrspacecast-argument.ll
index 767a584143026..82fb54130f625 100644
--- a/llvm/test/Transforms/Inline/inline-constexpr-addrspacecast-argument.ll
+++ b/llvm/test/Transforms/Inline/inline-constexpr-addrspacecast-argument.ll
@@ -9,16 +9,16 @@ target datalayout = "e-p3:32:32-p4:64:64-n32"
; CHECK-LABEL: @constexpr_addrspacecast_ptr_size_change(
; CHECK: load i64, ptr addrspace(4) addrspacecast (ptr addrspace(3) @lds to ptr addrspace(4))
; CHECK-NEXT: br
-define void @constexpr_addrspacecast_ptr_size_change() #0 {
- %tmp0 = call i32 @foo(ptr addrspace(4) addrspacecast (ptr addrspace(3) @lds to ptr addrspace(4))) #1
+define void @constexpr_addrspacecast_ptr_size_change(i1 %c) #0 {
+ %tmp0 = call i32 @foo(i1 %c, ptr addrspace(4) addrspacecast (ptr addrspace(3) @lds to ptr addrspace(4))) #1
ret void
}
-define i32 @foo(ptr addrspace(4) %arg) #1 {
+define i32 @foo(i1 %c, ptr addrspace(4) %arg) #1 {
bb:
%tmp = getelementptr i64, ptr addrspace(4) %arg, i64 undef
%tmp1 = load i64, ptr addrspace(4) %tmp
- br i1 undef, label %bb2, label %bb3
+ br i1 %c, label %bb2, label %bb3
bb2:
store i64 0, ptr addrspace(4) %tmp
diff --git a/llvm/test/Transforms/Inline/partial-inline-incompat-attrs.ll b/llvm/test/Transforms/Inline/partial-inline-incompat-attrs.ll
index 25e4c588d0883..d9cc3ebc3e9ff 100644
--- a/llvm/test/Transforms/Inline/partial-inline-incompat-attrs.ll
+++ b/llvm/test/Transforms/Inline/partial-inline-incompat-attrs.ll
@@ -6,10 +6,10 @@ bb:
br i1 %tmp, label %bb1, label %bb2
bb1:
- br i1 undef, label %bb4, label %bb2
+ br i1 %tmp, label %bb4, label %bb2
bb2:
- br i1 undef, label %bb4, label %bb5
+ br i1 %tmp, label %bb4, label %bb5
bb4:
%xx1 = phi i32 [ 1, %bb1 ], [ 9, %bb2 ]
More information about the llvm-commits
mailing list