[llvm] [llvm] Remove `br i1 undef` from regression tests (PR #118419)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 2 19:49:43 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-transforms
Author: Lee Wei (leewei05)
<details>
<summary>Changes</summary>
This PR removes tests with `br i1 undef` under `llvm/tests/Transforms/ObjCARC, Reassociate, SCCP, SLPVectorizer...`. After this PR, I'll continue to fix tests under `llvm/tests/CodeGen`, which has more UB tests than `llvm/tests/Transforms`.
@<!-- -->nunoplopes @<!-- -->regehr
---
Patch is 241.65 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/118419.diff
75 Files Affected:
- (modified) llvm/test/Transforms/ObjCARC/allocas.ll (+6-6)
- (modified) llvm/test/Transforms/ObjCARC/basic.ll (+8-8)
- (modified) llvm/test/Transforms/ObjCARC/cfg-hazards.ll (+49-49)
- (modified) llvm/test/Transforms/ObjCARC/contract-testcases.ll (+5-5)
- (modified) llvm/test/Transforms/ObjCARC/empty-block.ll (+4-4)
- (modified) llvm/test/Transforms/ObjCARC/path-overflow.ll (+223-223)
- (modified) llvm/test/Transforms/Reassociate/2011-01-26-UseAfterFree.ll (+3-3)
- (modified) llvm/test/Transforms/Reassociate/2012-06-08-InfiniteLoop.ll (+2-2)
- (modified) llvm/test/Transforms/Reassociate/add_across_block_crash.ll (+3-3)
- (modified) llvm/test/Transforms/Reassociate/infloop-deadphi.ll (+3-3)
- (modified) llvm/test/Transforms/Reassociate/reassociate-landingpad.ll (+2-2)
- (modified) llvm/test/Transforms/SCCP/2004-12-10-UndefBranchBug.ll (+5-6)
- (modified) llvm/test/Transforms/SCCP/2006-10-23-IPSCCP-Crash.ll (+2-2)
- (modified) llvm/test/Transforms/SCCP/2008-01-27-UndefCorrelate.ll (+20-2)
- (modified) llvm/test/Transforms/SCCP/PR26044.ll (+12-11)
- (modified) llvm/test/Transforms/SCCP/crash.ll (+2-2)
- (modified) llvm/test/Transforms/SCCP/domtree-update.ll (+3-3)
- (modified) llvm/test/Transforms/SCCP/fp-bc-icmp-const-fold.ll (+5-5)
- (modified) llvm/test/Transforms/SCCP/ipsccp-preserve-pdt.ll (+6-5)
- (modified) llvm/test/Transforms/SCCP/pr49582-iterator-invalidation.ll (+4-4)
- (modified) llvm/test/Transforms/SCCP/return-zapped.ll (+18-14)
- (modified) llvm/test/Transforms/SCCP/solve-after-each-resolving-undefs-for-function.ll (+19-15)
- (modified) llvm/test/Transforms/SCCP/switch-constantfold-crash.ll (+36-26)
- (modified) llvm/test/Transforms/SLPVectorizer/AArch64/minimum-sizes.ll (+6-6)
- (modified) llvm/test/Transforms/SLPVectorizer/AArch64/reorder-fmuladd-crash.ll (+5-5)
- (modified) llvm/test/Transforms/SLPVectorizer/AArch64/trunc-insertion.ll (+5-5)
- (modified) llvm/test/Transforms/SLPVectorizer/X86/crash_7zip.ll (+5-5)
- (modified) llvm/test/Transforms/SLPVectorizer/X86/crash_bullet.ll (+37-37)
- (modified) llvm/test/Transforms/SLPVectorizer/X86/crash_bullet3.ll (+23-23)
- (modified) llvm/test/Transforms/SLPVectorizer/X86/crash_dequeue.ll (+9-9)
- (modified) llvm/test/Transforms/SLPVectorizer/X86/crash_flop7.ll (+9-9)
- (modified) llvm/test/Transforms/SLPVectorizer/X86/crash_lencod-inseltpoison.ll (+19-19)
- (modified) llvm/test/Transforms/SLPVectorizer/X86/crash_lencod.ll (+19-19)
- (modified) llvm/test/Transforms/SLPVectorizer/X86/crash_mandeltext.ll (+19-19)
- (modified) llvm/test/Transforms/SLPVectorizer/X86/crash_sim4b1.ll (+31-31)
- (modified) llvm/test/Transforms/SLPVectorizer/X86/crash_smallpt.ll (+14-14)
- (modified) llvm/test/Transforms/SLPVectorizer/X86/crash_vectorizeTree.ll (+9-9)
- (modified) llvm/test/Transforms/SLPVectorizer/X86/cse.ll (+5-5)
- (modified) llvm/test/Transforms/SLPVectorizer/X86/memory-runtime-checks.ll (+9-9)
- (modified) llvm/test/Transforms/SLPVectorizer/X86/no-scheduled-instructions.ll (+4-4)
- (modified) llvm/test/Transforms/SLPVectorizer/X86/ordering.ll (+5-5)
- (modified) llvm/test/Transforms/SLPVectorizer/X86/partail.ll (+3-3)
- (modified) llvm/test/Transforms/SLPVectorizer/X86/phi.ll (+3-3)
- (modified) llvm/test/Transforms/SLPVectorizer/X86/phi_overalignedtype.ll (+3-3)
- (modified) llvm/test/Transforms/SLPVectorizer/X86/pr16571.ll (+4-4)
- (modified) llvm/test/Transforms/SLPVectorizer/X86/remark_unsupported.ll (+3-3)
- (modified) llvm/test/Transforms/SLPVectorizer/X86/reorder_repeated_ops.ll (+3-3)
- (modified) llvm/test/Transforms/SLPVectorizer/X86/reorder_with_reordered_users.ll (+5-5)
- (modified) llvm/test/Transforms/SLPVectorizer/X86/resched.ll (+3-3)
- (modified) llvm/test/Transforms/SLPVectorizer/X86/reuse-extracts-in-wider-vect.ll (+3-3)
- (modified) llvm/test/Transforms/SLPVectorizer/X86/revectorized_rdx_crash.ll (+3-3)
- (modified) llvm/test/Transforms/SLPVectorizer/X86/value-bug-inseltpoison.ll (+5-5)
- (modified) llvm/test/Transforms/SLPVectorizer/X86/value-bug.ll (+5-5)
- (modified) llvm/test/Transforms/SLPVectorizer/X86/vectorize-widest-phis.ll (+3-3)
- (modified) llvm/test/Transforms/SLPVectorizer/slp-umax-rdx-matcher-crash.ll (+3-3)
- (modified) llvm/test/Transforms/Scalarizer/crash-bug.ll (+4-4)
- (modified) llvm/test/Transforms/Scalarizer/dbgloc-bug-inseltpoison.ll (+2-2)
- (modified) llvm/test/Transforms/Scalarizer/dbgloc-bug.ll (+2-2)
- (modified) llvm/test/Transforms/Scalarizer/phi-unreachable-pred.ll (+10-10)
- (modified) llvm/test/Transforms/SimpleLoopUnswitch/2011-06-02-CritSwitch.ll (+3-3)
- (modified) llvm/test/Transforms/SimpleLoopUnswitch/2012-04-30-LoopUnswitch-LPad-Crash.ll (+2-2)
- (modified) llvm/test/Transforms/SimpleLoopUnswitch/2015-09-18-Addrspace.ll (+2-2)
- (modified) llvm/test/Transforms/SimpleLoopUnswitch/delete-dead-blocks.ll (+5-5)
- (modified) llvm/test/Transforms/SimpleLoopUnswitch/formDedicatedAfterTrivial1.ll (+2-2)
- (modified) llvm/test/Transforms/SimpleLoopUnswitch/guards.ll (+40-14)
- (modified) llvm/test/Transforms/SimpleLoopUnswitch/pr37888.ll (+1-1)
- (modified) llvm/test/Transforms/SimpleLoopUnswitch/preserve-analyses.ll (+6-6)
- (modified) llvm/test/Transforms/SimplifyCFG/2004-12-10-SimplifyCFGCrash.ll (+10-10)
- (modified) llvm/test/Transforms/SimplifyCFG/2006-06-12-InfLoop.ll (+16-16)
- (modified) llvm/test/Transforms/SimplifyCFG/branch-on-undef.ll (+3-3)
- (modified) llvm/test/Transforms/SimplifyCFG/fold-branch-to-common-dest.ll (+2-2)
- (modified) llvm/test/Transforms/SimplifyCFG/pr34131.ll (+11-11)
- (modified) llvm/test/Transforms/Sink/dead-user.ll (+12-13)
- (modified) llvm/test/Transforms/SpeculativeExecution/PR46267.ll (+2-2)
- (modified) llvm/test/Transforms/StructurizeCFG/loop-continue-phi.ll (+14-13)
``````````diff
diff --git a/llvm/test/Transforms/ObjCARC/allocas.ll b/llvm/test/Transforms/ObjCARC/allocas.ll
index be829882ae3749..6fe2edf3e2dd48 100644
--- a/llvm/test/Transforms/ObjCARC/allocas.ll
+++ b/llvm/test/Transforms/ObjCARC/allocas.ll
@@ -109,16 +109,16 @@ entry:
}
-; CHECK: define void @test1d(ptr %x)
+; CHECK: define void @test1d(ptr %x, i1 %arg)
; CHECK: @llvm.objc.retain(ptr %x)
; CHECK: @llvm.objc.retain(ptr %x)
; CHECK: @llvm.objc.release(ptr %y)
; CHECK: @llvm.objc.release(ptr %x)
; CHECK: ret void
; CHECK: }
-define void @test1d(ptr %x) {
+define void @test1d(ptr %x, i1 %arg) {
entry:
- br i1 undef, label %use_allocaA, label %use_allocaB
+ br i1 %arg, label %use_allocaA, label %use_allocaB
use_allocaA:
%allocaA = alloca ptr
@@ -141,16 +141,16 @@ exit:
ret void
}
-; CHECK: define void @test1e(ptr %x)
+; CHECK: define void @test1e(ptr %x, i1 %arg)
; CHECK: @llvm.objc.retain(ptr %x)
; CHECK: @llvm.objc.retain(ptr %x)
; CHECK: @llvm.objc.release(ptr %y)
; CHECK: @llvm.objc.release(ptr %x)
; CHECK: ret void
; CHECK: }
-define void @test1e(ptr %x) {
+define void @test1e(ptr %x, i1 %arg) {
entry:
- br i1 undef, label %use_allocaA, label %use_allocaB
+ br i1 %arg, label %use_allocaA, label %use_allocaB
use_allocaA:
%allocaA = alloca ptr, i32 4
diff --git a/llvm/test/Transforms/ObjCARC/basic.ll b/llvm/test/Transforms/ObjCARC/basic.ll
index 0ee59dc8ba6ab7..d461bc0af680d4 100644
--- a/llvm/test/Transforms/ObjCARC/basic.ll
+++ b/llvm/test/Transforms/ObjCARC/basic.ll
@@ -1761,13 +1761,13 @@ g:
; CHECK-LABEL: define void @test39(
; CHECK-NOT: @llvm.objc.
; CHECK: {{^}}}
-define void @test39(ptr %p) {
+define void @test39(ptr %p, i1 %arg) {
entry:
%0 = call ptr @llvm.objc.retain(ptr %p)
br label %loop
loop: ; preds = %loop, %entry
- br i1 undef, label %loop, label %exit
+ br i1 %arg, label %loop, label %exit
exit: ; preds = %loop
call void @llvm.objc.release(ptr %0), !clang.imprecise_release !0
@@ -1779,14 +1779,14 @@ exit: ; preds = %loop
; CHECK-LABEL: define void @test39b(
; CHECK-NOT: @llvm.objc.
; CHECK: {{^}}}
-define void @test39b(ptr %p) {
+define void @test39b(ptr %p, i1 %arg) {
entry:
%0 = call ptr @llvm.objc.retain(ptr %p)
br label %loop
loop: ; preds = %loop, %entry
store i8 0, ptr %0
- br i1 undef, label %loop, label %exit
+ br i1 %arg, label %loop, label %exit
exit: ; preds = %loop
call void @llvm.objc.release(ptr %0), !clang.imprecise_release !0
@@ -1798,14 +1798,14 @@ exit: ; preds = %loop
; CHECK-LABEL: define void @test39c(
; CHECK-NOT: @llvm.objc.
; CHECK: {{^}}}
-define void @test39c(ptr %p) {
+define void @test39c(ptr %p, i1 %arg) {
entry:
%0 = call ptr @llvm.objc.retain(ptr %p)
br label %loop
loop: ; preds = %loop, %entry
call void @use_pointer(ptr %0)
- br i1 undef, label %loop, label %exit
+ br i1 %arg, label %loop, label %exit
exit: ; preds = %loop
call void @llvm.objc.release(ptr %0), !clang.imprecise_release !0
@@ -1818,14 +1818,14 @@ exit: ; preds = %loop
; CHECK-LABEL: define void @test40(
; CHECK-NOT: @llvm.objc.
; CHECK: {{^}}}
-define void @test40(ptr %p) {
+define void @test40(ptr %p, i1 %arg) {
entry:
%0 = call ptr @llvm.objc.retain(ptr %p)
br label %loop
loop: ; preds = %loop, %entry
call void @use_pointer(ptr %0)
- br i1 undef, label %exit, label %loop
+ br i1 %arg, label %exit, label %loop
exit: ; preds = %loop
call void @llvm.objc.release(ptr %0), !clang.imprecise_release !0
diff --git a/llvm/test/Transforms/ObjCARC/cfg-hazards.ll b/llvm/test/Transforms/ObjCARC/cfg-hazards.ll
index 3e762de689d1f4..d43f713d925e09 100644
--- a/llvm/test/Transforms/ObjCARC/cfg-hazards.ll
+++ b/llvm/test/Transforms/ObjCARC/cfg-hazards.ll
@@ -111,7 +111,7 @@ for.end: ; preds = %for.body
}
; Delete nested retain+release pairs around loops.
-define void @test3(ptr %a) nounwind {
+define void @test3(ptr %a, i1 %arg) nounwind {
; CHECK-LABEL: @test3(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[OUTER:%.*]] = tail call ptr @llvm.objc.retain(ptr [[A:%.*]]) #[[ATTR0]]
@@ -119,7 +119,7 @@ define void @test3(ptr %a) nounwind {
; CHECK: loop:
; CHECK-NEXT: call void @callee()
; CHECK-NEXT: store i8 0, ptr [[A]], align 1
-; CHECK-NEXT: br i1 undef, label [[LOOP]], label [[EXIT:%.*]]
+; CHECK-NEXT: br i1 %arg, label [[LOOP]], label [[EXIT:%.*]]
; CHECK: exit:
; CHECK-NEXT: call void @llvm.objc.release(ptr [[A]]) #[[ATTR0]], !clang.imprecise_release !0
; CHECK-NEXT: ret void
@@ -132,7 +132,7 @@ entry:
loop:
call void @callee()
store i8 0, ptr %a
- br i1 undef, label %loop, label %exit
+ br i1 %arg, label %loop, label %exit
exit:
call void @llvm.objc.release(ptr %a) nounwind
@@ -140,7 +140,7 @@ exit:
ret void
}
-define void @test4(ptr %a) nounwind {
+define void @test4(ptr %a, i1 %arg) nounwind {
; CHECK-LABEL: @test4(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[OUTER:%.*]] = tail call ptr @llvm.objc.retain(ptr [[A:%.*]]) #[[ATTR0]]
@@ -151,7 +151,7 @@ define void @test4(ptr %a) nounwind {
; CHECK-NEXT: call void @callee()
; CHECK-NEXT: call void @callee()
; CHECK-NEXT: store i8 0, ptr [[A]], align 1
-; CHECK-NEXT: br i1 undef, label [[LOOP]], label [[EXIT:%.*]]
+; CHECK-NEXT: br i1 %arg, label [[LOOP]], label [[EXIT:%.*]]
; CHECK: exit:
; CHECK-NEXT: call void @llvm.objc.release(ptr [[A]]) #[[ATTR0]], !clang.imprecise_release !0
; CHECK-NEXT: ret void
@@ -168,7 +168,7 @@ more:
call void @callee()
call void @callee()
store i8 0, ptr %a
- br i1 undef, label %loop, label %exit
+ br i1 %arg, label %loop, label %exit
exit:
call void @llvm.objc.release(ptr %a) nounwind
@@ -176,18 +176,18 @@ exit:
ret void
}
-define void @test5(ptr %a) nounwind {
+define void @test5(ptr %a, i1 %arg) nounwind {
; CHECK-LABEL: @test5(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[OUTER:%.*]] = tail call ptr @llvm.objc.retain(ptr [[A:%.*]]) #[[ATTR0]]
; CHECK-NEXT: call void @callee()
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
-; CHECK-NEXT: br i1 undef, label [[TRUE:%.*]], label [[MORE:%.*]]
+; CHECK-NEXT: br i1 %arg, label [[TRUE:%.*]], label [[MORE:%.*]]
; CHECK: true:
; CHECK-NEXT: br label [[MORE]]
; CHECK: more:
-; CHECK-NEXT: br i1 undef, label [[EXIT:%.*]], label [[LOOP]]
+; CHECK-NEXT: br i1 %arg, label [[EXIT:%.*]], label [[LOOP]]
; CHECK: exit:
; CHECK-NEXT: call void @use_pointer(ptr [[A]])
; CHECK-NEXT: call void @llvm.objc.release(ptr [[A]]) #[[ATTR0]], !clang.imprecise_release !0
@@ -200,13 +200,13 @@ entry:
br label %loop
loop:
- br i1 undef, label %true, label %more
+ br i1 %arg, label %true, label %more
true:
br label %more
more:
- br i1 undef, label %exit, label %loop
+ br i1 %arg, label %exit, label %loop
exit:
call void @use_pointer(ptr %a)
@@ -215,18 +215,18 @@ exit:
ret void
}
-define void @test6(ptr %a) nounwind {
+define void @test6(ptr %a, i1 %arg) nounwind {
; CHECK-LABEL: @test6(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[OUTER:%.*]] = tail call ptr @llvm.objc.retain(ptr [[A:%.*]]) #[[ATTR0]]
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
-; CHECK-NEXT: br i1 undef, label [[TRUE:%.*]], label [[MORE:%.*]]
+; CHECK-NEXT: br i1 %arg, label [[TRUE:%.*]], label [[MORE:%.*]]
; CHECK: true:
; CHECK-NEXT: call void @callee()
; CHECK-NEXT: br label [[MORE]]
; CHECK: more:
-; CHECK-NEXT: br i1 undef, label [[EXIT:%.*]], label [[LOOP]]
+; CHECK-NEXT: br i1 %arg, label [[EXIT:%.*]], label [[LOOP]]
; CHECK: exit:
; CHECK-NEXT: call void @use_pointer(ptr [[A]])
; CHECK-NEXT: call void @llvm.objc.release(ptr [[A]]) #[[ATTR0]], !clang.imprecise_release !0
@@ -238,14 +238,14 @@ entry:
br label %loop
loop:
- br i1 undef, label %true, label %more
+ br i1 %arg, label %true, label %more
true:
call void @callee()
br label %more
more:
- br i1 undef, label %exit, label %loop
+ br i1 %arg, label %exit, label %loop
exit:
call void @use_pointer(ptr %a)
@@ -254,19 +254,19 @@ exit:
ret void
}
-define void @test7(ptr %a) nounwind {
+define void @test7(ptr %a, i1 %arg) nounwind {
; CHECK-LABEL: @test7(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[OUTER:%.*]] = tail call ptr @llvm.objc.retain(ptr [[A:%.*]]) #[[ATTR0]]
; CHECK-NEXT: call void @callee()
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
-; CHECK-NEXT: br i1 undef, label [[TRUE:%.*]], label [[MORE:%.*]]
+; CHECK-NEXT: br i1 %arg, label [[TRUE:%.*]], label [[MORE:%.*]]
; CHECK: true:
; CHECK-NEXT: call void @use_pointer(ptr [[A]])
; CHECK-NEXT: br label [[MORE]]
; CHECK: more:
-; CHECK-NEXT: br i1 undef, label [[EXIT:%.*]], label [[LOOP]]
+; CHECK-NEXT: br i1 %arg, label [[EXIT:%.*]], label [[LOOP]]
; CHECK: exit:
; CHECK-NEXT: call void @llvm.objc.release(ptr [[A]]) #[[ATTR0]], !clang.imprecise_release !0
; CHECK-NEXT: ret void
@@ -278,14 +278,14 @@ entry:
br label %loop
loop:
- br i1 undef, label %true, label %more
+ br i1 %arg, label %true, label %more
true:
call void @use_pointer(ptr %a)
br label %more
more:
- br i1 undef, label %exit, label %loop
+ br i1 %arg, label %exit, label %loop
exit:
call void @llvm.objc.release(ptr %a) nounwind
@@ -293,19 +293,19 @@ exit:
ret void
}
-define void @test8(ptr %a) nounwind {
+define void @test8(ptr %a, i1 %arg) nounwind {
; CHECK-LABEL: @test8(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[OUTER:%.*]] = tail call ptr @llvm.objc.retain(ptr [[A:%.*]]) #[[ATTR0]]
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
-; CHECK-NEXT: br i1 undef, label [[TRUE:%.*]], label [[MORE:%.*]]
+; CHECK-NEXT: br i1 %arg, label [[TRUE:%.*]], label [[MORE:%.*]]
; CHECK: true:
; CHECK-NEXT: call void @callee()
; CHECK-NEXT: call void @use_pointer(ptr [[A]])
; CHECK-NEXT: br label [[MORE]]
; CHECK: more:
-; CHECK-NEXT: br i1 undef, label [[EXIT:%.*]], label [[LOOP]]
+; CHECK-NEXT: br i1 %arg, label [[EXIT:%.*]], label [[LOOP]]
; CHECK: exit:
; CHECK-NEXT: call void @llvm.objc.release(ptr [[A]]) #[[ATTR0]], !clang.imprecise_release !0
; CHECK-NEXT: ret void
@@ -316,7 +316,7 @@ entry:
br label %loop
loop:
- br i1 undef, label %true, label %more
+ br i1 %arg, label %true, label %more
true:
call void @callee()
@@ -324,7 +324,7 @@ true:
br label %more
more:
- br i1 undef, label %exit, label %loop
+ br i1 %arg, label %exit, label %loop
exit:
call void @llvm.objc.release(ptr %a) nounwind
@@ -332,17 +332,17 @@ exit:
ret void
}
-define void @test9(ptr %a) nounwind {
+define void @test9(ptr %a, i1 %arg) nounwind {
; CHECK-LABEL: @test9(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
-; CHECK-NEXT: br i1 undef, label [[TRUE:%.*]], label [[MORE:%.*]]
+; CHECK-NEXT: br i1 %arg, label [[TRUE:%.*]], label [[MORE:%.*]]
; CHECK: true:
; CHECK-NEXT: call void @use_pointer(ptr [[A:%.*]])
; CHECK-NEXT: br label [[MORE]]
; CHECK: more:
-; CHECK-NEXT: br i1 undef, label [[EXIT:%.*]], label [[LOOP]]
+; CHECK-NEXT: br i1 %arg, label [[EXIT:%.*]], label [[LOOP]]
; CHECK: exit:
; CHECK-NEXT: ret void
;
@@ -352,14 +352,14 @@ entry:
br label %loop
loop:
- br i1 undef, label %true, label %more
+ br i1 %arg, label %true, label %more
true:
call void @use_pointer(ptr %a)
br label %more
more:
- br i1 undef, label %exit, label %loop
+ br i1 %arg, label %exit, label %loop
exit:
call void @llvm.objc.release(ptr %a) nounwind
@@ -367,17 +367,17 @@ exit:
ret void
}
-define void @test10(ptr %a) nounwind {
+define void @test10(ptr %a, i1 %arg) nounwind {
; CHECK-LABEL: @test10(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
-; CHECK-NEXT: br i1 undef, label [[TRUE:%.*]], label [[MORE:%.*]]
+; CHECK-NEXT: br i1 %arg, label [[TRUE:%.*]], label [[MORE:%.*]]
; CHECK: true:
; CHECK-NEXT: call void @callee()
; CHECK-NEXT: br label [[MORE]]
; CHECK: more:
-; CHECK-NEXT: br i1 undef, label [[EXIT:%.*]], label [[LOOP]]
+; CHECK-NEXT: br i1 %arg, label [[EXIT:%.*]], label [[LOOP]]
; CHECK: exit:
; CHECK-NEXT: ret void
;
@@ -387,14 +387,14 @@ entry:
br label %loop
loop:
- br i1 undef, label %true, label %more
+ br i1 %arg, label %true, label %more
true:
call void @callee()
br label %more
more:
- br i1 undef, label %exit, label %loop
+ br i1 %arg, label %exit, label %loop
exit:
call void @llvm.objc.release(ptr %a) nounwind
@@ -402,16 +402,16 @@ exit:
ret void
}
-define void @test11(ptr %a) nounwind {
+define void @test11(ptr %a, i1 %arg) nounwind {
; CHECK-LABEL: @test11(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
-; CHECK-NEXT: br i1 undef, label [[TRUE:%.*]], label [[MORE:%.*]]
+; CHECK-NEXT: br i1 %arg, label [[TRUE:%.*]], label [[MORE:%.*]]
; CHECK: true:
; CHECK-NEXT: br label [[MORE]]
; CHECK: more:
-; CHECK-NEXT: br i1 undef, label [[EXIT:%.*]], label [[LOOP]]
+; CHECK-NEXT: br i1 %arg, label [[EXIT:%.*]], label [[LOOP]]
; CHECK: exit:
; CHECK-NEXT: ret void
;
@@ -421,13 +421,13 @@ entry:
br label %loop
loop:
- br i1 undef, label %true, label %more
+ br i1 %arg, label %true, label %more
true:
br label %more
more:
- br i1 undef, label %exit, label %loop
+ br i1 %arg, label %exit, label %loop
exit:
call void @llvm.objc.release(ptr %a) nounwind
@@ -437,18 +437,18 @@ exit:
; Don't delete anything if they're not balanced.
-define void @test12(ptr %a) nounwind {
+define void @test12(ptr %a, i1 %arg) nounwind {
; CHECK-LABEL: @test12(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[OUTER:%.*]] = tail call ptr @llvm.objc.retain(ptr [[A:%.*]]) #[[ATTR0]]
; CHECK-NEXT: [[INNER:%.*]] = tail call ptr @llvm.objc.retain(ptr [[A]]) #[[ATTR0]]
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
-; CHECK-NEXT: br i1 undef, label [[TRUE:%.*]], label [[MORE:%.*]]
+; CHECK-NEXT: br i1 %arg, label [[TRUE:%.*]], label [[MORE:%.*]]
; CHECK: true:
; CHECK-NEXT: ret void
; CHECK: more:
-; CHECK-NEXT: br i1 undef, label [[EXIT:%.*]], label [[LOOP]]
+; CHECK-NEXT: br i1 %arg, label [[EXIT:%.*]], label [[LOOP]]
; CHECK: exit:
; CHECK-NEXT: call void @llvm.objc.release(ptr [[A]]) #[[ATTR0]]
; CHECK-NEXT: call void @llvm.objc.release(ptr [[A]]) #[[ATTR0]], !clang.imprecise_release !0
@@ -460,13 +460,13 @@ entry:
br label %loop
loop:
- br i1 undef, label %true, label %more
+ br i1 %arg, label %true, label %more
true:
ret void
more:
- br i1 undef, label %exit, label %loop
+ br i1 %arg, label %exit, label %loop
exit:
call void @llvm.objc.release(ptr %a) nounwind
@@ -479,7 +479,7 @@ exit:
; by an alloca.
; rdar://12969722
-define void @test13(ptr %a) nounwind {
+define void @test13(ptr %a, i1 %arg) nounwind {
; CHECK-LABEL: @test13(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[BLOCK:%.*]] = alloca ptr, align 8
@@ -491,7 +491,7 @@ define void @test13(ptr %a) nounwind {
; CHECK-NEXT: call void @block_callee(ptr [[BLOCK]])
; CHECK-NEXT: [[RELOADED_A:%.*]] = load ptr, ptr [[BLOCK]], align 8
; CHECK-NEXT: call void @llvm.objc.release(ptr [[RELOADED_A]]) #[[ATTR0]], !clang.imprecise_release !0
-; CHECK-NEXT: br i1 undef, label [[LOOP]], label [[EXIT:%.*]]
+; CHECK-NEXT: br i1 %arg, label [[LOOP]], label [[EXIT:%.*]]
; CHECK: exit:
; CHECK-NEXT: call void @llvm.objc.release(ptr [[A]]) #[[ATTR0]], !clang.imprecise_release !0
; CHECK-NEXT: ret void
@@ -507,7 +507,7 @@ loop:
call void @block_callee(ptr %block)
%reloaded_a = load ptr, ptr %block, align 8
call void @llvm.objc.release(ptr %reloaded_a) nounwind, !clang.imprecise_release !0
- br i1 undef, label %loop, label %exit
+ br i1 %arg, label %loop, label %exit
exit:
call void @llvm.objc.release(ptr %a) nounwind, !clang.imprecise_release !0
diff --git a/llvm/test/Transforms/ObjCARC/contract-testcases.ll b/llvm/test/Transforms/ObjCARC/contract-testcases.ll
index 36fe49382e4136..4c842823b54e07 100644
--- a/llvm/test/Transforms/ObjCARC/contract-testcases.ll
+++ b/llvm/test/Transforms/ObjCARC/contract-testcases.ll
@@ -19,13 +19,13 @@ declare i32 @__gxx_personality_sj0(...)
; Don't get in trouble on bugpointed code.
; CHECK-LABEL: define void @test0(
-define void @test0() {
+define void @test0(i1 %arg) {
bb:
%tmp1 = tail call ptr @llvm.objc.retainAutoreleasedReturnValue(ptr undef) nounwind
br label %bb3
bb3: ; preds = %bb2
- br i1 undef, label %bb6, label %bb4
+ br i1 %arg, label %bb6, label %bb4
bb4: ; preds = %bb3
switch i64 undef, label %bb5 [
@@ -45,15 +45,15 @@ bb6: ; preds = %bb5, %bb4, %bb4, %b
; for the same block, use the exactly same value in each block.
; CHECK-LABEL: define void @test1(
-; CHECK: br i1 undef, label %bb7, label %bb7
+; CHECK: br i1 %arg, label %bb7, label %bb7
; CHECK: bb7:
; CHECK: %tmp8 = phi ptr [ %tmp3, %bb ], [ %tmp3, %bb ]
; CHECK: }
-define void @test1() {
+define void @test1(i1 %arg) {
bb:
%tmp = tail call ptr @objc_msgSend()
%tmp3 = tail call ptr @llvm.objc.retainAutoreleasedReturnValue(ptr %tmp) nounwind
- br i1 undef, label %bb7, label %bb7
+ br i1 %arg, label %bb7, label %bb7
bb7: ; preds = %bb6, %bb6, %bb5
%tmp8 = phi ptr [ %tmp, %bb ], [ %tmp, %bb ]
diff --git a/llvm/test/Transforms/ObjCARC/empty-block.ll b/llvm/test/Transforms/ObjCARC/empty-block.ll
index 80930812fc7e97..be70beeeb731da 100644
--- a/llvm/test/Transforms/ObjCARC/empty-block.ll
+++ b/llvm/test/Transforms/ObjCARC/empty-block.ll
@@ -18,9 +18,9 @@ declare ptr @llvm.objc.autoreleaseReturnValue(ptr)
; CHECK: @llvm.objc.autoreleaseReturnValue
; CHECK-NOT: @llvm.objc.
; CHECK: }
-define ptr @test0(ptr %buffer) nounwind {
+define ptr @test0(ptr %buffer, i1 %arg) nounwind {
%1 = tail call ptr @llvm.objc.retain(ptr %buffer) nounwind
- br i1 undef, label %.lr.ph, label %._crit_edge
+ br i1 %arg, label %.lr.ph, label %._crit_edge
.lr.ph: ; preds = %.lr.ph, %0
br i1 false, label %.lr.ph, label %._crit_edge
@@ -37,10 +37,10 @@ define ptr @test0(ptr %buffer) nounwind {
; CHECK-LABEL: define ptr @test1(
; CHECK-NOT: @objc
; CHECK: }
-define ptr @test1() nounwind {
+define ptr @test1(i1 %arg) nounwind {
%buffer = call ptr @foo()
%1 = tail call ptr @llvm.objc.retain(ptr %buffer) nounwind
- br i1 undef, label %.lr.ph, label %._crit_edge
+ br i1 %arg, label %.lr.ph, label %._crit_edge
.lr.ph: ; preds = %.lr.ph, %0
br i1 false, label %.lr.ph, label %._crit_edge
diff --git a/llvm/test/Transforms/ObjCARC/path-overflow.ll b/llvm/test/Transforms/ObjCARC/path-overflow.ll
index eeef70554d1148..431b3774812629 100644
--- a/llvm/test/Transforms/ObjCARC/path-overflow.ll
+++ b/llvm/test/Transforms/ObjCARC/path-overflow.ll
@@ -29,9 +29,9 @@ declare i32 @__gxx_personality_sj0(...)
declare i32 @__objc_personality_v0(...)
-define hidden void @test1() personality ptr @__gxx_personality_sj0 {
+define hidden void @test1(i1 %arg) personality ptr @__gxx_personality_sj0 {
entry:
- br i1 undef, label %msgSend.nullinit, label %msgSend.call
+ br i1 %arg, label %msgSend.nullinit, label %msgSend.call
msgSend.call: ; preds = %entry
br label %msgSend.cont
@@ -41,7 +41,7 @@ msgSend.nullinit: ; preds = %entry
msgSend.cont: ; preds = %msgSend.nullinit, %msg...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/118419
More information about the llvm-commits
mailing list