[llvm] 58ca707 - [llvm] Remove `br i1 undef` from some regression tests [NFC] (#115688)

via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 12 00:41:31 PST 2024


Author: Lee Wei
Date: 2024-11-12T08:41:27Z
New Revision: 58ca7078ce188af21ea5f924573cb00bdb63cbb6

URL: https://github.com/llvm/llvm-project/commit/58ca7078ce188af21ea5f924573cb00bdb63cbb6
DIFF: https://github.com/llvm/llvm-project/commit/58ca7078ce188af21ea5f924573cb00bdb63cbb6.diff

LOG: [llvm] Remove `br i1 undef` from some regression tests [NFC] (#115688)

This PR aims to remove undefined behavior from tests.

Added: 
    

Modified: 
    llvm/test/Transforms/ADCE/blocks-with-dead-term-nondeterministic.ll
    llvm/test/Transforms/ADCE/broken-loop-info.ll
    llvm/test/Transforms/AlignmentFromAssumptions/amdgpu-crash.ll
    llvm/test/Transforms/AlignmentFromAssumptions/start-unk.ll
    llvm/test/Transforms/Attributor/IPConstantProp/fp-bc-icmp-const-fold.ll
    llvm/test/Transforms/BDCE/order.ll
    llvm/test/Transforms/CallSiteSplitting/callsite-instructions-before-call.ll
    llvm/test/Transforms/CallSiteSplitting/callsite-no-or-structure.ll
    llvm/test/Transforms/CallSiteSplitting/callsite-no-splitting.ll
    llvm/test/Transforms/CallSiteSplitting/callsite-split-or-phi.ll
    llvm/test/Transforms/CallSiteSplitting/callsite-split-preserve-debug.ll
    llvm/test/Transforms/CodeExtractor/LoopExtractor_infinite.ll
    llvm/test/Transforms/CodeExtractor/extract-assume.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/ADCE/blocks-with-dead-term-nondeterministic.ll b/llvm/test/Transforms/ADCE/blocks-with-dead-term-nondeterministic.ll
index 0130233fd3ea35..9708be975fd6fc 100644
--- a/llvm/test/Transforms/ADCE/blocks-with-dead-term-nondeterministic.ll
+++ b/llvm/test/Transforms/ADCE/blocks-with-dead-term-nondeterministic.ll
@@ -5,27 +5,27 @@ target triple = "x86_64-apple-macosx10.10.0"
 
 ; CHECK: uselistorder label %bb16, { 1, 0 }
 ; Function Attrs: noinline nounwind ssp uwtable
-define void @ham() local_unnamed_addr #0 {
+define void @ham(i1 %arg) local_unnamed_addr #0 {
 bb:
   br i1 false, label %bb1, label %bb22
 
 bb1:                                              ; preds = %bb
-  br i1 undef, label %bb2, label %bb20
+  br i1 %arg, label %bb2, label %bb20
 
 bb2:                                              ; preds = %bb1
   br label %bb5
 
 bb5:                                              ; preds = %bb16, %bb2
-  br i1 undef, label %bb6, label %bb17
+  br i1 %arg, label %bb6, label %bb17
 
 bb6:                                              ; preds = %bb5
-  br i1 undef, label %bb7, label %bb16
+  br i1 %arg, label %bb7, label %bb16
 
 bb7:                                              ; preds = %bb6
-  br i1 undef, label %bb9, label %bb8
+  br i1 %arg, label %bb9, label %bb8
 
 bb8:                                              ; preds = %bb7
-  br i1 undef, label %bb9, label %bb10
+  br i1 %arg, label %bb9, label %bb10
 
 bb9:                                              ; preds = %bb8, %bb7
   br label %bb13

diff  --git a/llvm/test/Transforms/ADCE/broken-loop-info.ll b/llvm/test/Transforms/ADCE/broken-loop-info.ll
index 74679a1ab7f2e8..a0833eeea839d3 100644
--- a/llvm/test/Transforms/ADCE/broken-loop-info.ll
+++ b/llvm/test/Transforms/ADCE/broken-loop-info.ll
@@ -5,7 +5,7 @@
 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128-ni:1-p2:32:8:8:32-ni:2"
 target triple = "x86_64-unknown-linux-gnu"
 
-define void @test() {
+define void @test(i1 %arg) {
 ; CHECK-LABEL: @test(
 ; CHECK-NEXT:  bb:
 ; CHECK-NEXT:    br label [[BB2:%.*]]
@@ -16,7 +16,7 @@ define void @test() {
 ; CHECK:       bb3:
 ; CHECK-NEXT:    unreachable
 ; CHECK:       bb4:
-; CHECK-NEXT:    br i1 true, label [[BB1:%.*]], label [[BB2]]
+; CHECK-NEXT:    br i1 [[ARG:%.*]], label [[BB1:%.*]], label [[BB2]]
 ;
 
 bb:
@@ -26,11 +26,11 @@ bb1:                                              ; preds = %bb4
   ret void
 
 bb2:                                              ; preds = %bb4, %bb
-  br i1 undef, label %bb4, label %bb3
+  br i1 %arg, label %bb4, label %bb3
 
 bb3:                                              ; preds = %bb2
   br label %bb4
 
 bb4:                                              ; preds = %bb3, %bb2
-  br i1 undef, label %bb1, label %bb2
+  br i1 %arg, label %bb1, label %bb2
 }

diff  --git a/llvm/test/Transforms/AlignmentFromAssumptions/amdgpu-crash.ll b/llvm/test/Transforms/AlignmentFromAssumptions/amdgpu-crash.ll
index 4ef07d78a97744..2c5286edbfe00d 100644
--- a/llvm/test/Transforms/AlignmentFromAssumptions/amdgpu-crash.ll
+++ b/llvm/test/Transforms/AlignmentFromAssumptions/amdgpu-crash.ll
@@ -7,7 +7,7 @@ target datalayout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:3
 %"unwind::libunwind::_Unwind_Exception.9.51.75.99.123.147.163.171.179.195.203.211.227.385.396" = type { [0 x i64], i64, [0 x i64], ptr, [0 x i64], [6 x i64], [0 x i64] }
 %"unwind::libunwind::_Unwind_Context.10.52.76.100.124.148.164.172.180.196.204.212.228.386.397" = type { [0 x i8] }
 
-define void @"_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17h7b1d039c7ff5e1feE"() {
+define void @"_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17h7b1d039c7ff5e1feE"(i1 %arg) {
 start:
   %_15.i.i = alloca %"core::str::CharIndices.29.66.90.114.138.149.165.173.181.197.205.213.229.387.398", align 8, addrspace(5)
   br label %bb12.i.i
@@ -18,7 +18,7 @@ bb12.i.i:                                         ; preds = %start
   %maskedptr54.i.i = and i64 %ptrint53.i.i, 7
   %maskcond55.i.i = icmp eq i64 %maskedptr54.i.i, 0
   call void @llvm.assume(i1 %maskcond55.i.i)
-  br i1 undef, label %bb20.i.i, label %bb3.i.i.i.i.i.preheader.i.i
+  br i1 %arg, label %bb20.i.i, label %bb3.i.i.i.i.i.preheader.i.i
 
 bb3.i.i.i.i.i.preheader.i.i:                      ; preds = %bb12.i.i
   store i64 0, ptr %0, align 8

diff  --git a/llvm/test/Transforms/AlignmentFromAssumptions/start-unk.ll b/llvm/test/Transforms/AlignmentFromAssumptions/start-unk.ll
index bbf51a603c2cc9..349906e8c5db55 100644
--- a/llvm/test/Transforms/AlignmentFromAssumptions/start-unk.ll
+++ b/llvm/test/Transforms/AlignmentFromAssumptions/start-unk.ll
@@ -12,45 +12,45 @@ declare void @llvm.assume(i1) #0
 declare i32 @llvm.bswap.i32(i32) #1
 
 ; Function Attrs: nounwind uwtable
-define void @test1() unnamed_addr #2 align 2 {
+define void @test1(i1 %arg) unnamed_addr #2 align 2 {
 
 ; CHECK-LABEL: @test1
 
 entry:
-  br i1 undef, label %if.then, label %if.end
+  br i1 %arg, label %if.then, label %if.end
 
 if.then:                                          ; preds = %entry
   unreachable
 
 if.end:                                           ; preds = %entry
-  br i1 undef, label %return, label %if.end8
+  br i1 %arg, label %return, label %if.end8
 
 if.end8:                                          ; preds = %if.end
-  br i1 undef, label %if.then13, label %if.end14
+  br i1 %arg, label %if.then13, label %if.end14
 
 if.then13:                                        ; preds = %if.end8
   unreachable
 
 if.end14:                                         ; preds = %if.end8
-  br i1 undef, label %cond.false.i129, label %cond.end.i136
+  br i1 %arg, label %cond.false.i129, label %cond.end.i136
 
 cond.false.i129:                                  ; preds = %if.end14
   unreachable
 
 cond.end.i136:                                    ; preds = %if.end14
-  br i1 undef, label %land.lhs.true.i, label %if.end.i145
+  br i1 %arg, label %land.lhs.true.i, label %if.end.i145
 
 land.lhs.true.i:                                  ; preds = %cond.end.i136
-  br i1 undef, label %if.end.i145, label %if.then.i137
+  br i1 %arg, label %if.end.i145, label %if.then.i137
 
 if.then.i137:                                     ; preds = %land.lhs.true.i
-  br i1 undef, label %cond.false8.i, label %cond.end9.i
+  br i1 %arg, label %cond.false8.i, label %cond.end9.i
 
 cond.false8.i:                                    ; preds = %if.then.i137
   unreachable
 
 cond.end9.i:                                      ; preds = %if.then.i137
-  br i1 undef, label %if.then23, label %if.end24
+  br i1 %arg, label %if.then23, label %if.end24
 
 if.end.i145:                                      ; preds = %land.lhs.true.i, %cond.end.i136
   unreachable
@@ -59,19 +59,19 @@ if.then23:                                        ; preds = %cond.end9.i
   unreachable
 
 if.end24:                                         ; preds = %cond.end9.i
-  br i1 undef, label %for.end, label %for.body.lr.ph
+  br i1 %arg, label %for.end, label %for.body.lr.ph
 
 for.body.lr.ph:                                   ; preds = %if.end24
   unreachable
 
 for.end:                                          ; preds = %if.end24
-  br i1 undef, label %if.end123, label %if.then121
+  br i1 %arg, label %if.end123, label %if.then121
 
 if.then121:                                       ; preds = %for.end
   unreachable
 
 if.end123:                                        ; preds = %for.end
-  br i1 undef, label %if.end150, label %if.then126
+  br i1 %arg, label %if.end150, label %if.then126
 
 if.then126:                                       ; preds = %if.end123
   %ptrint.i.i185 = ptrtoint ptr undef to i64
@@ -85,33 +85,33 @@ if.then126:                                       ; preds = %if.end123
   %0 = tail call i32 @llvm.bswap.i32(i32 %ret.0.copyload.i.i189) #0
   %conv131 = zext i32 %0 to i64
   %add.ptr132 = getelementptr inbounds i8, ptr undef, i64 %conv131
-  br i1 undef, label %if.end150, label %if.end.i173
+  br i1 %arg, label %if.end150, label %if.end.i173
 
 if.end.i173:                                      ; preds = %if.then126
-  br i1 undef, label %test1.exit, label %cond.false.i.i.i.i174
+  br i1 %arg, label %test1.exit, label %cond.false.i.i.i.i174
 
 cond.false.i.i.i.i174:                            ; preds = %if.end.i173
   unreachable
 
 test1.exit: ; preds = %if.end.i173
-  br i1 undef, label %test1a.exit, label %if.end.i124
+  br i1 %arg, label %test1a.exit, label %if.end.i124
 
 if.end.i124:                                      ; preds = %test1.exit
   unreachable
 
 test1a.exit: ; preds = %test1.exit
-  br i1 undef, label %if.end150, label %for.body137.lr.ph
+  br i1 %arg, label %if.end150, label %for.body137.lr.ph
 
 for.body137.lr.ph:                                ; preds = %test1a.exit
   br label %for.body137
 
 for.body137:                                      ; preds = %test1b.exit, %for.body137.lr.ph
   %ShndxTable.0309 = phi ptr [ %add.ptr132, %for.body137.lr.ph ], [ %incdec.ptr, %test1b.exit ]
-  br i1 undef, label %for.body137.if.end146_crit_edge, label %if.then140
+  br i1 %arg, label %for.body137.if.end146_crit_edge, label %if.then140
 
 for.body137.if.end146_crit_edge:                  ; preds = %for.body137
   %incdec.ptr = getelementptr inbounds %type1, ptr %ShndxTable.0309, i64 1
-  br i1 undef, label %cond.false.i70, label %cond.end.i
+  br i1 %arg, label %cond.false.i70, label %cond.end.i
 
 if.then140:                                       ; preds = %for.body137
   %ret.0.copyload.i.i102 = load i32, ptr %ShndxTable.0309, align 2
@@ -124,16 +124,16 @@ cond.false.i70:                                   ; preds = %for.body137.if.end1
   unreachable
 
 cond.end.i:                                       ; preds = %for.body137.if.end146_crit_edge
-  br i1 undef, label %test1b.exit, label %cond.false.i.i
+  br i1 %arg, label %test1b.exit, label %cond.false.i.i
 
 cond.false.i.i:                                   ; preds = %cond.end.i
   unreachable
 
 test1b.exit: ; preds = %cond.end.i
-  br i1 undef, label %if.end150, label %for.body137
+  br i1 %arg, label %if.end150, label %for.body137
 
 if.end150:                                        ; preds = %test1b.exit, %test1a.exit, %if.then126, %if.end123
-  br i1 undef, label %for.end176, label %for.body155.lr.ph
+  br i1 %arg, label %for.end176, label %for.body155.lr.ph
 
 for.body155.lr.ph:                                ; preds = %if.end150
   unreachable

diff  --git a/llvm/test/Transforms/Attributor/IPConstantProp/fp-bc-icmp-const-fold.ll b/llvm/test/Transforms/Attributor/IPConstantProp/fp-bc-icmp-const-fold.ll
index 07e82e08dcbbab..c172eb2975c7df 100644
--- a/llvm/test/Transforms/Attributor/IPConstantProp/fp-bc-icmp-const-fold.ll
+++ b/llvm/test/Transforms/Attributor/IPConstantProp/fp-bc-icmp-const-fold.ll
@@ -4,51 +4,56 @@
 target datalayout = "E-m:e-i64:64-n32:64"
 target triple = "powerpc64le-unknown-linux"
 
-define void @test(i32 signext %n) {
-; CHECK: Function Attrs: nofree norecurse noreturn nosync nounwind memory(none)
+define void @test(i32 signext %n, i1 %arg) {
+; CHECK: Function Attrs: nofree norecurse nosync nounwind memory(none)
 ; CHECK-LABEL: define {{[^@]+}}@test
-; CHECK-SAME: (i32 signext [[N:%.*]]) #[[ATTR0:[0-9]+]] {
+; CHECK-SAME: (i32 signext [[N:%.*]], i1 noundef [[ARG:%.*]]) #[[ATTR0:[0-9]+]] {
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    unreachable
+; CHECK-NEXT:    br i1 [[ARG]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
 ; CHECK:       if.then:
-; CHECK-NEXT:    unreachable
+; CHECK-NEXT:    ret void
 ; CHECK:       if.end:
-; CHECK-NEXT:    unreachable
+; CHECK-NEXT:    br i1 [[ARG]], label [[IF_THEN2:%.*]], label [[IF_END4:%.*]]
 ; CHECK:       if.then2:
 ; CHECK-NEXT:    unreachable
 ; CHECK:       if.end4:
-; CHECK-NEXT:    unreachable
+; CHECK-NEXT:    switch i32 [[N]], label [[IF_ELSE14:%.*]] [
+; CHECK-NEXT:      i32 0, label [[IF_THEN9:%.*]]
+; CHECK-NEXT:      i32 1, label [[IF_THEN12:%.*]]
+; CHECK-NEXT:    ]
 ; CHECK:       if.then9:
 ; CHECK-NEXT:    unreachable
 ; CHECK:       if.then12:
 ; CHECK-NEXT:    unreachable
 ; CHECK:       if.else14:
-; CHECK-NEXT:    unreachable
+; CHECK-NEXT:    br label [[DO_BODY:%.*]]
 ; CHECK:       do.body:
-; CHECK-NEXT:    unreachable
+; CHECK-NEXT:    [[SCALE_0:%.*]] = phi ppc_fp128 [ 0xM3FF00000000000000000000000000000, [[IF_ELSE14]] ], [ [[SCALE_0]], [[DO_BODY]] ]
+; CHECK-NEXT:    br i1 [[ARG]], label [[DO_BODY]], label [[IF_THEN33:%.*]]
 ; CHECK:       if.then33:
-; CHECK-NEXT:    unreachable
+; CHECK-NEXT:    br i1 [[ARG]], label [[_ZN5BOOST4MATH4SIGNIGEEIRKT__EXIT30:%.*]], label [[COND_FALSE_I28:%.*]]
 ; CHECK:       cond.false.i28:
-; CHECK-NEXT:    unreachable
+; CHECK-NEXT:    [[TMP0:%.*]] = bitcast ppc_fp128 [[SCALE_0]] to i128
+; CHECK-NEXT:    [[TOBOOL_I26:%.*]] = icmp slt i128 [[TMP0]], 0
+; CHECK-NEXT:    br label [[_ZN5BOOST4MATH4SIGNIGEEIRKT__EXIT30]]
 ; CHECK:       _ZN5boost4math4signIgEEiRKT_.exit30:
 ; CHECK-NEXT:    unreachable
 ;
 
 entry:
-  br i1 undef, label %if.then, label %if.end
+  br i1 %arg, label %if.then, label %if.end
 
 if.then:                                          ; preds = %entry
   ret void
 
 if.end:                                           ; preds = %entry
-  br i1 undef, label %if.then2, label %if.end4
+  br i1 %arg, label %if.then2, label %if.end4
 
 if.then2:                                         ; preds = %if.end
   unreachable
 
 if.end4:                                          ; preds = %if.end
-  %sub.n = select i1 undef, i32 undef, i32 %n
-  switch i32 %sub.n, label %if.else14 [
+  switch i32 %n, label %if.else14 [
   i32 0, label %if.then9
   i32 1, label %if.then12
   ]
@@ -64,10 +69,10 @@ if.else14:                                        ; preds = %if.end4
 
 do.body:                                          ; preds = %do.body, %if.else14
   %scale.0 = phi ppc_fp128 [ 0xM3FF00000000000000000000000000000, %if.else14 ], [ %scale.0, %do.body ]
-  br i1 undef, label %do.body, label %if.then33
+  br i1 %arg, label %do.body, label %if.then33
 
 if.then33:                                        ; preds = %do.body
-  br i1 undef, label %_ZN5boost4math4signIgEEiRKT_.exit30, label %cond.false.i28
+  br i1 %arg, label %_ZN5boost4math4signIgEEiRKT_.exit30, label %cond.false.i28
 
 cond.false.i28:                                   ; preds = %if.then33
   %0 = bitcast ppc_fp128 %scale.0 to i128
@@ -79,7 +84,7 @@ _ZN5boost4math4signIgEEiRKT_.exit30:              ; preds = %cond.false.i28, %if
 }
 
 ;.
-; CHECK: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind memory(none) }
+; CHECK: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind memory(none) }
 ;.
 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
 ; CGSCC: {{.*}}

diff  --git a/llvm/test/Transforms/BDCE/order.ll b/llvm/test/Transforms/BDCE/order.ll
index 8b0f2e8600db9c..4e42b5b57bdd60 100644
--- a/llvm/test/Transforms/BDCE/order.ll
+++ b/llvm/test/Transforms/BDCE/order.ll
@@ -4,9 +4,9 @@ target triple = "x86_64-unknown-linux-gnu"
 
 declare i32 @__gxx_personality_v0(...)
 
-define fastcc void @_ZN11__sanitizerL12TestRegistryEPNS_14ThreadRegistryEb() #0 personality ptr @__gxx_personality_v0 {
+define fastcc void @_ZN11__sanitizerL12TestRegistryEPNS_14ThreadRegistryEb(i1 %arg) #0 personality ptr @__gxx_personality_v0 {
 entry:
-  br i1 undef, label %if.else, label %entry.if.end_crit_edge
+  br i1 %arg, label %if.else, label %entry.if.end_crit_edge
 
 if.else:
   ret void

diff  --git a/llvm/test/Transforms/CallSiteSplitting/callsite-instructions-before-call.ll b/llvm/test/Transforms/CallSiteSplitting/callsite-instructions-before-call.ll
index 49aa96f15e778f..162751a1ce3249 100644
--- a/llvm/test/Transforms/CallSiteSplitting/callsite-instructions-before-call.ll
+++ b/llvm/test/Transforms/CallSiteSplitting/callsite-instructions-before-call.ll
@@ -140,13 +140,13 @@ End:                                           ; preds = %CallSite, %TBB
 
 ; In this test case, we need to insert a new PHI node in TailBB to combine
 ; the loads we moved to the predecessors.
-define void @test_add_new_phi(ptr %ptrarg, i32 %i) {
+define void @test_add_new_phi(ptr %ptrarg, i32 %i, i1 %arg) {
 Header:
   %tobool = icmp ne ptr %ptrarg, null
   br i1 %tobool, label %TBB, label %CallSite
 
 TBB:
-  br i1 undef, label %CallSite, label %End
+  br i1 %arg, label %CallSite, label %End
 
 CallSite:
   %arrayidx112 = getelementptr inbounds i32, ptr undef, i64 1

diff  --git a/llvm/test/Transforms/CallSiteSplitting/callsite-no-or-structure.ll b/llvm/test/Transforms/CallSiteSplitting/callsite-no-or-structure.ll
index c2751e3e2d6a8a..76cb2189c8fd19 100644
--- a/llvm/test/Transforms/CallSiteSplitting/callsite-no-or-structure.ll
+++ b/llvm/test/Transforms/CallSiteSplitting/callsite-no-or-structure.ll
@@ -3,7 +3,7 @@
 
 ; CHECK-LABEL: @test_simple
 ; CHECK-LABEL: Header:
-; CHECK-NEXT: br i1 undef, label %Header.split
+; CHECK-NEXT: br i1 %arg, label %Header.split
 ; CHECK-LABEL: Header.split:
 ; CHECK: %[[CALL1:.*]] = call i32 @callee(ptr %a, i32 %v, i32 %p)
 ; CHECK-LABEL: TBB:
@@ -13,9 +13,9 @@
 ; CHECK-LABEL: Tail
 ; CHECK: %[[MERGED:.*]] = phi i32 [ %[[CALL1]], %Header.split ], [ %[[CALL2]], %TBB.split ]
 ; CHECK: ret i32 %[[MERGED]]
-define i32 @test_simple(ptr %a, i32 %v, i32 %p) {
+define i32 @test_simple(ptr %a, i32 %v, i32 %p, i1 %arg) {
 Header:
-  br i1 undef, label %Tail, label %End
+  br i1 %arg, label %Tail, label %End
 
 TBB:
   %cmp = icmp eq ptr %a, null

diff  --git a/llvm/test/Transforms/CallSiteSplitting/callsite-no-splitting.ll b/llvm/test/Transforms/CallSiteSplitting/callsite-no-splitting.ll
index 329826f80d6cdf..e7f7b8bbafb52a 100644
--- a/llvm/test/Transforms/CallSiteSplitting/callsite-no-splitting.ll
+++ b/llvm/test/Transforms/CallSiteSplitting/callsite-no-splitting.ll
@@ -22,16 +22,16 @@ entry:
   ret void
 }
 
-define void @fn2() {
+define void @fn2(i1 %arg) {
   ret void
 
 ; Unreachable code below
 
 for.inc:                                          ; preds = %for.inc
-  br i1 undef, label %for.end6, label %for.inc
+  br i1 %arg, label %for.end6, label %for.inc
 
 for.end6:                                         ; preds = %for.inc
-  br i1 undef, label %lor.rhs, label %lor.end
+  br i1 %arg, label %lor.rhs, label %lor.end
 
 lor.rhs:                                          ; preds = %for.end6
   br label %lor.end

diff  --git a/llvm/test/Transforms/CallSiteSplitting/callsite-split-or-phi.ll b/llvm/test/Transforms/CallSiteSplitting/callsite-split-or-phi.ll
index 6e57cc0693589d..0b32185441067d 100644
--- a/llvm/test/Transforms/CallSiteSplitting/callsite-split-or-phi.ll
+++ b/llvm/test/Transforms/CallSiteSplitting/callsite-split-or-phi.ll
@@ -401,13 +401,13 @@ End:
 ;CHECK-LABEL: Tail
 ;CHECK: %[[MERGED:.*]] = phi i32 [ %[[CALL2]], %TBB1.split ], [ %[[CALL1]], %TBB0.split ]
 ;CHECK: ret i32 %[[MERGED]]
-define i32 @test_cfg_no_or_phi(ptr %a,  i32 %v) {
+define i32 @test_cfg_no_or_phi(ptr %a,  i32 %v, i1 %arg) {
 entry:
-  br i1 undef, label %TBB0, label %TBB1
+  br i1 %arg, label %TBB0, label %TBB1
 TBB0:
-  br i1 undef, label %Tail, label %End
+  br i1 %arg, label %Tail, label %End
 TBB1:
-  br i1 undef, label %Tail, label %End
+  br i1 %arg, label %Tail, label %End
 Tail:
   %p = phi i32[1,%TBB0], [2, %TBB1]
   %r = call i32 @callee(ptr %a, i32 %v, i32 %p)
@@ -495,16 +495,16 @@ End:
 ;CHECK-LABEL: Tail:
 ;CHECK: %r = call i32 @callee(ptr %a, i32 %v, i32 0)
 ;CHECK: ret i32 %r
-define i32 @test_cond_no_effect(ptr %a, i32 %v) {
+define i32 @test_cond_no_effect(ptr %a, i32 %v, i1 %arg) {
 Entry:
   %tobool1 = icmp eq ptr %a, null
   br i1 %tobool1, label %Header, label %End
 
 Header:
-  br i1 undef, label %Tail, label %TBB
+  br i1 %arg, label %Tail, label %TBB
 
 TBB:
-  br i1 undef, label %Tail, label %End
+  br i1 %arg, label %Tail, label %End
 
 Tail:
   %r = call i32 @callee(ptr %a, i32 %v, i32 0)

diff  --git a/llvm/test/Transforms/CallSiteSplitting/callsite-split-preserve-debug.ll b/llvm/test/Transforms/CallSiteSplitting/callsite-split-preserve-debug.ll
index f54ca6cfe29097..74e3a513bc2f9f 100644
--- a/llvm/test/Transforms/CallSiteSplitting/callsite-split-preserve-debug.ll
+++ b/llvm/test/Transforms/CallSiteSplitting/callsite-split-preserve-debug.ll
@@ -15,9 +15,9 @@
 
 declare void @llvm.dbg.value(metadata, metadata, metadata)
 
-define i32 @test1(ptr dereferenceable(4) %cc, i32 %dd) !dbg !6 {
+define i32 @test1(ptr dereferenceable(4) %cc, i32 %dd, i1 %arg) !dbg !6 {
 entry:
-  br i1 undef, label %CallSite, label %land.rhs
+  br i1 %arg, label %CallSite, label %land.rhs
 
 land.rhs:                                         ; preds = %entry
   br label %CallSite
@@ -42,13 +42,13 @@ CallSite:                                         ; preds = %land.rhs, %entry
 ; CHECK-NEXT:    phi i32 [ [[R1]], %Header.split ], [ [[R2]], %TBB.split ], !dbg [[DBG_CALL]]
 ; CHECK-NEXT:    #dbg_value(i32 1,
 
-define void @test2(ptr %ptr, i32 %i) !dbg !19 {
+define void @test2(ptr %ptr, i32 %i, i1 %arg) !dbg !19 {
 Header:
   %tobool = icmp ne i32 %i, 10
   br i1 %tobool, label %TBB, label %CallSite
 
 TBB:                                              ; preds = %Header
-  br i1 undef, label %CallSite, label %End
+  br i1 %arg, label %CallSite, label %End
 
 CallSite:                                         ; preds = %TBB, %Header
   %lv = load i32, ptr %ptr, align 4, !dbg !25

diff  --git a/llvm/test/Transforms/CodeExtractor/LoopExtractor_infinite.ll b/llvm/test/Transforms/CodeExtractor/LoopExtractor_infinite.ll
index fbac98fa5966f0..b70785671bbb68 100644
--- a/llvm/test/Transforms/CodeExtractor/LoopExtractor_infinite.ll
+++ b/llvm/test/Transforms/CodeExtractor/LoopExtractor_infinite.ll
@@ -3,16 +3,16 @@
 
 ; This test used to enter an infinite loop, until out of memory (PR3082).
 
-define void @test() {
+define void @test(i1 %arg) {
 
 entry:
   br label %loopentry
 
 loopentry:
-  br i1 undef, label %exit.1, label %loopexit
+  br i1 %arg, label %exit.1, label %loopexit
 
 loopexit:
-  br i1 undef, label %loopentry, label %exit.0
+  br i1 %arg, label %loopentry, label %exit.0
 
 exit.0:
   br label %unified
@@ -23,11 +23,12 @@ exit.1:
 unified:
   ret void
 }
-; CHECK-LABEL: define {{[^@]+}}@test() {
+; CHECK-LABEL: define {{[^@]+}}@test
+; CHECK-SAME: (i1 [[ARG:%.*]]) {
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[CODEREPL:%.*]]
 ; CHECK:       codeRepl:
-; CHECK-NEXT:    [[TARGETBLOCK:%.*]] = call i1 @test.loopentry()
+; CHECK-NEXT:    [[TARGETBLOCK:%.*]] = call i1 @test.loopentry(i1 [[ARG]])
 ; CHECK-NEXT:    br i1 [[TARGETBLOCK]], label [[EXIT_1:%.*]], label [[EXIT_0:%.*]]
 ; CHECK:       exit.0:
 ; CHECK-NEXT:    br label [[UNIFIED:%.*]]
@@ -37,13 +38,14 @@ unified:
 ; CHECK-NEXT:    ret void
 ;
 ;
-; CHECK-LABEL: define {{[^@]+}}@test.loopentry() {
+; CHECK-LABEL: define {{[^@]+}}@test.loopentry
+; CHECK-SAME: (i1 [[ARG:%.*]]) {
 ; CHECK-NEXT:  newFuncRoot:
 ; CHECK-NEXT:    br label [[LOOPENTRY:%.*]]
 ; CHECK:       loopentry:
-; CHECK-NEXT:    br i1 undef, label [[EXIT_1_EXITSTUB:%.*]], label [[LOOPEXIT:%.*]]
+; CHECK-NEXT:    br i1 [[ARG]], label [[EXIT_1_EXITSTUB:%.*]], label [[LOOPEXIT:%.*]]
 ; CHECK:       loopexit:
-; CHECK-NEXT:    br i1 undef, label [[LOOPENTRY]], label [[EXIT_0_EXITSTUB:%.*]]
+; CHECK-NEXT:    br i1 [[ARG]], label [[LOOPENTRY]], label [[EXIT_0_EXITSTUB:%.*]]
 ; CHECK:       exit.1.exitStub:
 ; CHECK-NEXT:    ret i1 true
 ; CHECK:       exit.0.exitStub:

diff  --git a/llvm/test/Transforms/CodeExtractor/extract-assume.ll b/llvm/test/Transforms/CodeExtractor/extract-assume.ll
index ffba771856fb22..92961e8cf36243 100644
--- a/llvm/test/Transforms/CodeExtractor/extract-assume.ll
+++ b/llvm/test/Transforms/CodeExtractor/extract-assume.ll
@@ -9,9 +9,9 @@
 
 declare void @fun2(i32) #0
 
-define void @fun(i32 %x) {
+define void @fun(i32 %x, i1 %arg) {
 entry:
-  br i1 undef, label %if.then, label %if.else
+  br i1 %arg, label %if.then, label %if.else
 
 if.then:
   ret void


        


More information about the llvm-commits mailing list