[llvm] Remove `br i1 undef` from regression tests (PR #115130)
Lee Wei via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 6 16:03:59 PST 2024
https://github.com/leewei05 updated https://github.com/llvm/llvm-project/pull/115130
>From fd0065be210cc1d6965487a6c4de56ce3744b611 Mon Sep 17 00:00:00 2001
From: Lee <lee10202013 at gmail.com>
Date: Mon, 4 Nov 2024 19:44:38 -0700
Subject: [PATCH 01/10] Remove br undef in Assembler directory
---
llvm/test/Assembler/atomicrmw.ll | 4 ++--
llvm/test/Assembler/convergence-control.ll | 14 +++++++-------
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/llvm/test/Assembler/atomicrmw.ll b/llvm/test/Assembler/atomicrmw.ll
index 8c043c76ff0380..fb1347addb558d 100644
--- a/llvm/test/Assembler/atomicrmw.ll
+++ b/llvm/test/Assembler/atomicrmw.ll
@@ -4,7 +4,7 @@
; CHECK: @f
; CHECK: atomicrmw
-define void @f() {
+define void @f(i1 %arg) {
entry:
br label %def
@@ -14,5 +14,5 @@ define void @f() {
def:
%y = add i32 undef, undef
- br i1 undef, label %use, label %use
+ br i1 %arg, label %use, label %use
}
diff --git a/llvm/test/Assembler/convergence-control.ll b/llvm/test/Assembler/convergence-control.ll
index 28fba5692bce77..f32f4a9f537075 100644
--- a/llvm/test/Assembler/convergence-control.ll
+++ b/llvm/test/Assembler/convergence-control.ll
@@ -25,14 +25,14 @@ define void @mixed2() {
}
-define void @region_nesting1() convergent {
+define void @region_nesting1(i1 %arg) convergent {
A:
%tok1 = call token @llvm.experimental.convergence.entry()
%tok2 = call token @llvm.experimental.convergence.anchor()
br label %B
B:
- br i1 undef, label %C, label %D
+ br i1 %arg, label %C, label %D
C:
call void @f() [ "convergencectrl"(token %tok1) ]
@@ -44,14 +44,14 @@ D:
}
; Mirror image of @region_nesting1
-define void @region_nesting2() {
+define void @region_nesting2(i1 %arg) {
A:
%tok1 = call token @llvm.experimental.convergence.anchor()
%tok2 = call token @llvm.experimental.convergence.anchor()
br label %B
B:
- br i1 undef, label %C, label %D
+ br i1 %arg, label %C, label %D
C:
call void @f() [ "convergencectrl"(token %tok2) ]
@@ -62,14 +62,14 @@ D:
ret void
}
-define void @loop_nesting() convergent {
+define void @loop_nesting(i1 %arg) convergent {
A:
%a = call token @llvm.experimental.convergence.entry()
br label %B
B:
%b = call token @llvm.experimental.convergence.anchor()
- br i1 undef, label %C, label %D
+ br i1 %arg, label %C, label %D
C:
%c = call token @llvm.experimental.convergence.loop() [ "convergencectrl"(token %b) ]
@@ -78,7 +78,7 @@ C:
D:
call void @f() [ "convergencectrl"(token %b) ]
- br i1 undef, label %B, label %E
+ br i1 %arg, label %B, label %E
E:
ret void
>From d397608383d6363f5294d2c60502df3552871915 Mon Sep 17 00:00:00 2001
From: Lee <lee10202013 at gmail.com>
Date: Mon, 4 Nov 2024 19:56:43 -0700
Subject: [PATCH 02/10] Remove br undef in Bitcode directory
---
llvm/test/Bitcode/convergence-control.ll | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/llvm/test/Bitcode/convergence-control.ll b/llvm/test/Bitcode/convergence-control.ll
index 7ba5609b6a7ccf..a973722b60056c 100644
--- a/llvm/test/Bitcode/convergence-control.ll
+++ b/llvm/test/Bitcode/convergence-control.ll
@@ -1,6 +1,6 @@
; RUN: llvm-dis < %s.bc | FileCheck %s
-define void @loop_nesting() convergent {
+define void @loop_nesting(i1 %arg) convergent {
A:
; CHECK-LABEL: A:
; CHECK: [[A:%.*]] = call token @llvm.experimental.convergence.entry()
@@ -13,7 +13,7 @@ B:
; CHECK: [[B:%.*]] = call token @llvm.experimental.convergence.anchor()
;
%b = call token @llvm.experimental.convergence.anchor()
- br i1 undef, label %C, label %D
+ br i1 %arg, label %C, label %D
C:
; CHECK-LABEL: C:
@@ -29,7 +29,7 @@ D:
; CHECK: call void @f() [ "convergencectrl"(token [[B]]) ]
;
call void @f() [ "convergencectrl"(token %b) ]
- br i1 undef, label %B, label %E
+ br i1 %arg, label %B, label %E
E:
ret void
>From 6beb7de5a7946d070fc5232e8f72f631e2ac545a Mon Sep 17 00:00:00 2001
From: Lee <lee10202013 at gmail.com>
Date: Mon, 4 Nov 2024 20:00:12 -0700
Subject: [PATCH 03/10] Remove br undef in Examples directory
---
.../SimplifyCFG/tut-simplify-cfg2-dead-block-order.ll | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/llvm/test/Examples/IRTransforms/SimplifyCFG/tut-simplify-cfg2-dead-block-order.ll b/llvm/test/Examples/IRTransforms/SimplifyCFG/tut-simplify-cfg2-dead-block-order.ll
index d53f5133b2bf36..aa078179d2e3bf 100644
--- a/llvm/test/Examples/IRTransforms/SimplifyCFG/tut-simplify-cfg2-dead-block-order.ll
+++ b/llvm/test/Examples/IRTransforms/SimplifyCFG/tut-simplify-cfg2-dead-block-order.ll
@@ -18,7 +18,7 @@ bb.2:
ret i32 3
}
-define i32 @simp1() {
+define i32 @simp1(i1 %arg) {
; CHECK-LABEL: @simp1(
; CHECK-NEXT: entry:
; CHECK-NEXT: ret i32 1
@@ -32,7 +32,7 @@ bb.1:
ret i32 2
bb.2:
- br i1 undef, label %bb.1, label %bb.3
+ br i1 %arg, label %bb.1, label %bb.3
bb.3:
ret i32 3
>From 68335e8f9fd970f3a7040b044f5c4a91904516dd Mon Sep 17 00:00:00 2001
From: Lee <lee10202013 at gmail.com>
Date: Mon, 4 Nov 2024 20:03:27 -0700
Subject: [PATCH 04/10] Remove br undef in Other directory
---
llvm/test/Other/loop-pass-ordering.ll | 16 +++++++--------
llvm/test/Other/loopnest-pass-ordering.ll | 16 +++++++--------
.../test/Other/opt-bisect-new-pass-manager.ll | 20 +++++++++----------
3 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/llvm/test/Other/loop-pass-ordering.ll b/llvm/test/Other/loop-pass-ordering.ll
index c7e24fe9a3c08d..ad831135426ea4 100644
--- a/llvm/test/Other/loop-pass-ordering.ll
+++ b/llvm/test/Other/loop-pass-ordering.ll
@@ -14,23 +14,23 @@
; CHECK: Running pass: NoOpLoopPass on loop %loop.1.0 in function f
; CHECK: Running pass: NoOpLoopPass on loop %loop.1 in function f
-define void @f() {
+define void @f(i1 %arg) {
entry:
br label %loop.0
loop.0:
- br i1 undef, label %loop.0.0, label %loop.1
+ br i1 %arg, label %loop.0.0, label %loop.1
loop.0.0:
- br i1 undef, label %loop.0.0, label %loop.0.1
+ br i1 %arg, label %loop.0.0, label %loop.0.1
loop.0.1:
- br i1 undef, label %loop.0.1, label %loop.0
+ br i1 %arg, label %loop.0.1, label %loop.0
loop.1:
- br i1 undef, label %loop.1, label %loop.1.bb1
+ br i1 %arg, label %loop.1, label %loop.1.bb1
loop.1.bb1:
- br i1 undef, label %loop.1, label %loop.1.bb2
+ br i1 %arg, label %loop.1, label %loop.1.bb2
loop.1.bb2:
- br i1 undef, label %end, label %loop.1.0
+ br i1 %arg, label %end, label %loop.1.0
loop.1.0:
- br i1 undef, label %loop.1.0, label %loop.1
+ br i1 %arg, label %loop.1.0, label %loop.1
end:
ret void
}
diff --git a/llvm/test/Other/loopnest-pass-ordering.ll b/llvm/test/Other/loopnest-pass-ordering.ll
index e3d58e8e1c7692..553126c2216173 100644
--- a/llvm/test/Other/loopnest-pass-ordering.ll
+++ b/llvm/test/Other/loopnest-pass-ordering.ll
@@ -12,23 +12,23 @@
; CHECK: Running pass: NoOpLoopNestPass on loop %loop.1 in function f
; CHECK-NOT: Running pass: NoOpLoopNestPass on {{loop\..*\..*}}
-define void @f() {
+define void @f(i1 %arg) {
entry:
br label %loop.0
loop.0:
- br i1 undef, label %loop.0.0, label %loop.1
+ br i1 %arg, label %loop.0.0, label %loop.1
loop.0.0:
- br i1 undef, label %loop.0.0, label %loop.0.1
+ br i1 %arg, label %loop.0.0, label %loop.0.1
loop.0.1:
- br i1 undef, label %loop.0.1, label %loop.0
+ br i1 %arg, label %loop.0.1, label %loop.0
loop.1:
- br i1 undef, label %loop.1, label %loop.1.bb1
+ br i1 %arg, label %loop.1, label %loop.1.bb1
loop.1.bb1:
- br i1 undef, label %loop.1, label %loop.1.bb2
+ br i1 %arg, label %loop.1, label %loop.1.bb2
loop.1.bb2:
- br i1 undef, label %end, label %loop.1.0
+ br i1 %arg, label %end, label %loop.1.0
loop.1.0:
- br i1 undef, label %loop.1.0, label %loop.1
+ br i1 %arg, label %loop.1.0, label %loop.1
end:
ret void
}
diff --git a/llvm/test/Other/opt-bisect-new-pass-manager.ll b/llvm/test/Other/opt-bisect-new-pass-manager.ll
index 4e15a56012e5ba..01dad705ec3626 100644
--- a/llvm/test/Other/opt-bisect-new-pass-manager.ll
+++ b/llvm/test/Other/opt-bisect-new-pass-manager.ll
@@ -101,23 +101,23 @@
declare i32 @g()
-define void @f1() {
+define void @f1(i1 %arg) {
entry:
br label %loop.0
loop.0:
- br i1 undef, label %loop.0.0, label %loop.1
+ br i1 %arg, label %loop.0.0, label %loop.1
loop.0.0:
- br i1 undef, label %loop.0.0, label %loop.0.1
+ br i1 %arg, label %loop.0.0, label %loop.0.1
loop.0.1:
- br i1 undef, label %loop.0.1, label %loop.0
+ br i1 %arg, label %loop.0.1, label %loop.0
loop.1:
- br i1 undef, label %loop.1, label %loop.1.bb1
+ br i1 %arg, label %loop.1, label %loop.1.bb1
loop.1.bb1:
- br i1 undef, label %loop.1, label %loop.1.bb2
+ br i1 %arg, label %loop.1, label %loop.1.bb2
loop.1.bb2:
- br i1 undef, label %end, label %loop.1.0
+ br i1 %arg, label %end, label %loop.1.0
loop.1.0:
- br i1 undef, label %loop.1.0, label %loop.1
+ br i1 %arg, label %loop.1.0, label %loop.1
end:
ret void
}
@@ -141,14 +141,14 @@ bb.false:
; This function is here to verify that opt-bisect can skip all passes for
; functions that contain lifetime intrinsics.
-define void @f4() {
+define void @f4(i1 %arg) {
entry:
%i = alloca i32, align 4
call void @llvm.lifetime.start(i64 4, ptr %i)
br label %for.cond
for.cond:
- br i1 undef, label %for.body, label %for.end
+ br i1 %arg, label %for.body, label %for.end
for.body:
br label %for.cond
>From 8181e43832e51c748ad69af5c4656d0d5aefc858 Mon Sep 17 00:00:00 2001
From: Lee <lee10202013 at gmail.com>
Date: Mon, 4 Nov 2024 20:37:52 -0700
Subject: [PATCH 05/10] Remove br undef in DebugInfo directory
---
llvm/test/DebugInfo/ARM/illegal-fragment.ll | 4 +-
.../ARM/machine-cp-updates-dbg-reg.mir | 4 +-
.../InstrRef/follow-spill-of-live-value.mir | 6 +--
.../MIR/InstrRef/out-of-scope-blocks.mir | 4 +-
llvm/test/DebugInfo/MIR/X86/machine-cse.mir | 8 ++--
.../test/DebugInfo/X86/dbg-merge-loc-entry.ll | 6 +--
.../DebugInfo/X86/dbg-value-terminator.ll | 38 +++++++++----------
llvm/test/DebugInfo/X86/deleted-bit-piece.ll | 4 +-
llvm/test/DebugInfo/X86/earlydup-crash.ll | 8 ++--
.../X86/live-debug-values-constprop.mir | 16 ++++----
llvm/test/DebugInfo/X86/mem2reg_fp80.ll | 4 +-
.../DebugInfo/X86/sdag-dbgvalue-phi-use-4.ll | 4 +-
12 files changed, 53 insertions(+), 53 deletions(-)
diff --git a/llvm/test/DebugInfo/ARM/illegal-fragment.ll b/llvm/test/DebugInfo/ARM/illegal-fragment.ll
index 494cdee0c68bee..c581aa2613129c 100644
--- a/llvm/test/DebugInfo/ARM/illegal-fragment.ll
+++ b/llvm/test/DebugInfo/ARM/illegal-fragment.ll
@@ -8,7 +8,7 @@ target triple = "thumbv7s-apple-ios5.0.0"
%struct.vm_object = type { i64 }
; Function Attrs: nounwind ssp
-define void @f(ptr %object, ptr nocapture readonly %start) local_unnamed_addr #0 !dbg !11 {
+define void @f(ptr %object, ptr nocapture readonly %start, i1 %arg) local_unnamed_addr #0 !dbg !11 {
entry:
tail call void @llvm.dbg.value(metadata ptr %object, metadata !21, metadata !DIExpression()), !dbg !27
tail call void @llvm.dbg.value(metadata ptr %start, metadata !22, metadata !DIExpression()), !dbg !28
@@ -17,7 +17,7 @@ entry:
; This debug value cannot safely be split into two 32-bit pieces.
; CHECK-NOT: DW_AT_name(offset)
tail call void @llvm.dbg.value(metadata i32 undef, metadata !23, metadata !DIExpression()), !dbg !31
- br i1 undef, label %for.end, label %for.body.lr.ph, !dbg !31
+ br i1 %arg, label %for.end, label %for.body.lr.ph, !dbg !31
for.body.lr.ph: ; preds = %entry
%0 = load i64, ptr %start, align 4, !dbg !33
diff --git a/llvm/test/DebugInfo/ARM/machine-cp-updates-dbg-reg.mir b/llvm/test/DebugInfo/ARM/machine-cp-updates-dbg-reg.mir
index bbd816a330886a..e14472af7a4eaf 100644
--- a/llvm/test/DebugInfo/ARM/machine-cp-updates-dbg-reg.mir
+++ b/llvm/test/DebugInfo/ARM/machine-cp-updates-dbg-reg.mir
@@ -27,10 +27,10 @@
declare dso_local i32 @get_mm_counter(ptr, i32) local_unnamed_addr #0
- define dso_local i32 @dup_mm() local_unnamed_addr !dbg !16 {
+ define dso_local i32 @dup_mm(i1 %arg) local_unnamed_addr !dbg !16 {
entry:
%call = tail call i32 @kmem_cache_alloc(i32 0)
- br i1 undef, label %cleanup, label %if.end
+ br i1 %arg, label %cleanup, label %if.end
if.end: ; preds = %entry
%tobool1.not = icmp eq i32 undef, 0
diff --git a/llvm/test/DebugInfo/MIR/InstrRef/follow-spill-of-live-value.mir b/llvm/test/DebugInfo/MIR/InstrRef/follow-spill-of-live-value.mir
index e625493f1a3051..79a62c1db58a5f 100644
--- a/llvm/test/DebugInfo/MIR/InstrRef/follow-spill-of-live-value.mir
+++ b/llvm/test/DebugInfo/MIR/InstrRef/follow-spill-of-live-value.mir
@@ -36,13 +36,13 @@
%"class.llvm::Loop" = type opaque
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
- define linkonce_odr void @_ZNSt5dequeIPN4llvm4LoopESaIS2_EE13_M_insert_auxESt15_Deque_iteratorIS2_RS2_PS2_EmRKS2_(ptr %this, ptr %__pos, i64 %__n) local_unnamed_addr align 2 !dbg !3 {
+ define linkonce_odr void @_ZNSt5dequeIPN4llvm4LoopESaIS2_EE13_M_insert_auxESt15_Deque_iteratorIS2_RS2_PS2_EmRKS2_(ptr %this, ptr %__pos, i64 %__n, i1 %arg) local_unnamed_addr align 2 !dbg !3 {
entry:
%0 = load ptr, ptr undef, align 8, !dbg !7
%_M_cur6.i = getelementptr inbounds %"class.std::deque", ptr %this, i64 0, i32 0, i32 0, i32 2, i32 0, !dbg !7
%1 = load ptr, ptr %_M_cur6.i, align 8, !dbg !7
%2 = load ptr, ptr undef, align 8, !dbg !7
- br i1 undef, label %if.then.i851, label %if.end.i856, !dbg !7
+ br i1 %arg, label %if.then.i851, label %if.end.i856, !dbg !7
if.then.i851: ; preds = %entry
%.pre1038 = load ptr, ptr undef, align 8, !dbg !7
@@ -71,7 +71,7 @@
%sunkaddr3 = getelementptr inbounds i8, ptr %13, i64 40, !dbg !7
%14 = bitcast ptr %sunkaddr3 to ptr, !dbg !7
%15 = load ptr, ptr %14, align 8, !dbg !7
- br i1 undef, label %if.then.i.i775, label %cond.true.i.i777, !dbg !7
+ br i1 %arg, label %if.then.i.i775, label %cond.true.i.i777, !dbg !7
if.then.i.i775: ; preds = %if.end.i856
%add.ptr.i.i774 = getelementptr inbounds ptr, ptr %11, i64 %__n, !dbg !7
diff --git a/llvm/test/DebugInfo/MIR/InstrRef/out-of-scope-blocks.mir b/llvm/test/DebugInfo/MIR/InstrRef/out-of-scope-blocks.mir
index c25c467c10f214..5c4f9b0d0e478e 100644
--- a/llvm/test/DebugInfo/MIR/InstrRef/out-of-scope-blocks.mir
+++ b/llvm/test/DebugInfo/MIR/InstrRef/out-of-scope-blocks.mir
@@ -37,14 +37,14 @@
%class._Tree_unchecked_const_iterator = type { %struct._Iterator_base0, ptr }
%struct._Iterator_base0 = type { i32 }
- define i32 @main({ i32, ptr } %call.i) !dbg !6 {
+ define i32 @main({ i32, ptr } %call.i, i1 %arg) !dbg !6 {
entry:
call void @llvm.dbg.value(metadata i32 2, metadata !10, metadata !DIExpression()), !dbg !12
%call.i1 = call { i32, ptr } undef(ptr null)
%0 = extractvalue { i32, ptr } %call.i, 1
call void @llvm.dbg.value(metadata ptr %0, metadata !13, metadata !DIExpression(DW_OP_LLVM_fragment, 64, 64)), !dbg !15
%call.i.i.i.i.i = call i8 undef(ptr null), !dbg !15
- br i1 undef, label %_Z17do_insert_cv_testI5_TreeEvv.exit, label %if.then.i.i.i.i.i
+ br i1 %arg, label %_Z17do_insert_cv_testI5_TreeEvv.exit, label %if.then.i.i.i.i.i
if.then.i.i.i.i.i:
%call3.i.i.i.i.i = call ptr undef(ptr null)
diff --git a/llvm/test/DebugInfo/MIR/X86/machine-cse.mir b/llvm/test/DebugInfo/MIR/X86/machine-cse.mir
index 9bcb4408312a66..c38c0a1a79f751 100644
--- a/llvm/test/DebugInfo/MIR/X86/machine-cse.mir
+++ b/llvm/test/DebugInfo/MIR/X86/machine-cse.mir
@@ -24,11 +24,11 @@
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #0
- define fastcc ptr @t(i32 %base) !dbg !3 {
+ define fastcc ptr @t(i32 %base, i1 %arg) !dbg !3 {
entry:
%0 = zext i32 %base to i64
%1 = getelementptr inbounds %struct.s2, ptr null, i64 %0
- br i1 undef, label %bb1, label %bb2
+ br i1 %arg, label %bb1, label %bb2
bb1: ; preds = %entry
%2 = getelementptr inbounds %struct.s2, ptr null, i64 %0, i32 0
@@ -43,9 +43,9 @@
}
; This is a stub replicating bb structure of @t
- define fastcc ptr @u(i32 %base) !dbg !33 {
+ define fastcc ptr @u(i32 %base, i1 %arg) !dbg !33 {
entry:
- br i1 undef, label %bb1, label %bb2
+ br i1 %arg, label %bb1, label %bb2
bb1: ; preds = %entry
unreachable
diff --git a/llvm/test/DebugInfo/X86/dbg-merge-loc-entry.ll b/llvm/test/DebugInfo/X86/dbg-merge-loc-entry.ll
index bfc1dbafbc93a1..b0ace49e7fb3a3 100644
--- a/llvm/test/DebugInfo/X86/dbg-merge-loc-entry.ll
+++ b/llvm/test/DebugInfo/X86/dbg-merge-loc-entry.ll
@@ -13,18 +13,18 @@ target triple = "x86_64-apple-darwin8"
@__clz_tab = external constant [256 x i8]
-define hidden i128 @__divti3(i128 %u, i128 %v) nounwind readnone !dbg !9 {
+define hidden i128 @__divti3(i128 %u, i128 %v, i1 %arg) nounwind readnone !dbg !9 {
entry:
tail call void @llvm.dbg.value(metadata i128 %u, metadata !14, metadata !DIExpression()), !dbg !15
tail call void @llvm.dbg.value(metadata i64 0, metadata !17, metadata !DIExpression()), !dbg !21
- br i1 undef, label %bb2, label %bb4, !dbg !22
+ br i1 %arg, label %bb2, label %bb4, !dbg !22
bb2: ; preds = %entry
tail call void @llvm.dbg.value(metadata i128 %u, metadata !14, metadata !DIExpression()), !dbg !15
br label %bb4, !dbg !23
bb4: ; preds = %bb2, %entry
- br i1 undef, label %__udivmodti4.exit, label %bb82.i, !dbg !24
+ br i1 %arg, label %__udivmodti4.exit, label %bb82.i, !dbg !24
bb82.i: ; preds = %bb4
unreachable
diff --git a/llvm/test/DebugInfo/X86/dbg-value-terminator.ll b/llvm/test/DebugInfo/X86/dbg-value-terminator.ll
index 4cea19435b6735..e8974491cdeea2 100644
--- a/llvm/test/DebugInfo/X86/dbg-value-terminator.ll
+++ b/llvm/test/DebugInfo/X86/dbg-value-terminator.ll
@@ -10,52 +10,52 @@
%a = type { i32, i32 }
-define hidden fastcc ptr @test() #1 !dbg !1 {
+define hidden fastcc ptr @test(i1 %arg) #1 !dbg !1 {
entry:
%0 = icmp eq ptr undef, null, !dbg !12
br i1 %0, label %"14", label %return, !dbg !12
"14": ; preds = %"8"
- br i1 undef, label %"25", label %"21", !dbg !12
+ br i1 %arg, label %"25", label %"21", !dbg !12
"21": ; preds = %"14"
- br i1 undef, label %may_unswitch_on.exit, label %"6.i", !dbg !12
+ br i1 %arg, label %may_unswitch_on.exit, label %"6.i", !dbg !12
"6.i": ; preds = %"21"
- br i1 undef, label %"10.i", label %may_unswitch_on.exit, !dbg !12
+ br i1 %arg, label %"10.i", label %may_unswitch_on.exit, !dbg !12
"10.i": ; preds = %"6.i"
- br i1 undef, label %may_unswitch_on.exit, label %"12.i", !dbg !12
+ br i1 %arg, label %may_unswitch_on.exit, label %"12.i", !dbg !12
"12.i": ; preds = %"10.i"
- br i1 undef, label %"4.i.i", label %"3.i.i", !dbg !12
+ br i1 %arg, label %"4.i.i", label %"3.i.i", !dbg !12
"3.i.i": ; preds = %"12.i"
- br i1 undef, label %"4.i.i", label %VEC_edge_base_index.exit.i, !dbg !12
+ br i1 %arg, label %"4.i.i", label %VEC_edge_base_index.exit.i, !dbg !12
"4.i.i": ; preds = %"3.i.i", %"12.i"
unreachable, !dbg !12
VEC_edge_base_index.exit.i: ; preds = %"3.i.i"
- br i1 undef, label %may_unswitch_on.exit, label %"16.i", !dbg !12
+ br i1 %arg, label %may_unswitch_on.exit, label %"16.i", !dbg !12
"16.i": ; preds = %VEC_edge_base_index.exit.i
- br i1 undef, label %"4.i6.i", label %"3.i5.i", !dbg !12
+ br i1 %arg, label %"4.i6.i", label %"3.i5.i", !dbg !12
"3.i5.i": ; preds = %"16.i"
- br i1 undef, label %VEC_edge_base_index.exit7.i, label %"4.i6.i", !dbg !12
+ br i1 %arg, label %VEC_edge_base_index.exit7.i, label %"4.i6.i", !dbg !12
"4.i6.i": ; preds = %"3.i5.i", %"16.i"
unreachable, !dbg !12
VEC_edge_base_index.exit7.i: ; preds = %"3.i5.i"
- br i1 undef, label %may_unswitch_on.exit, label %"21.i", !dbg !12
+ br i1 %arg, label %may_unswitch_on.exit, label %"21.i", !dbg !12
"21.i": ; preds = %VEC_edge_base_index.exit7.i
- br i1 undef, label %may_unswitch_on.exit, label %"23.i", !dbg !12
+ br i1 %arg, label %may_unswitch_on.exit, label %"23.i", !dbg !12
"23.i": ; preds = %"21.i"
- br i1 undef, label %may_unswitch_on.exit, label %"26.i", !dbg !12
+ br i1 %arg, label %may_unswitch_on.exit, label %"26.i", !dbg !12
"26.i": ; preds = %"34.i", %"23.i"
%1 = icmp eq i32 undef, 9, !dbg !12
@@ -65,25 +65,25 @@ VEC_edge_base_index.exit7.i: ; preds = %"3.i5.i"
unreachable
"34.i": ; preds = %"26.i"
- br i1 undef, label %"26.i", label %"36.i", !dbg !12
+ br i1 %arg, label %"26.i", label %"36.i", !dbg !12
"36.i": ; preds = %"34.i"
- br i1 undef, label %"37.i", label %"38.i", !dbg !12
+ br i1 %arg, label %"37.i", label %"38.i", !dbg !12
"37.i": ; preds = %"36.i"
br label %"38.i", !dbg !12
"38.i": ; preds = %"37.i", %"36.i"
- br i1 undef, label %"39.i", label %"45.i", !dbg !12
+ br i1 %arg, label %"39.i", label %"45.i", !dbg !12
"39.i": ; preds = %"38.i"
- br i1 undef, label %"41.i", label %may_unswitch_on.exit, !dbg !12
+ br i1 %arg, label %"41.i", label %may_unswitch_on.exit, !dbg !12
"41.i": ; preds = %"39.i"
- br i1 undef, label %may_unswitch_on.exit, label %"42.i", !dbg !12
+ br i1 %arg, label %may_unswitch_on.exit, label %"42.i", !dbg !12
"42.i": ; preds = %"41.i"
- br i1 undef, label %may_unswitch_on.exit, label %"44.i", !dbg !12
+ br i1 %arg, label %may_unswitch_on.exit, label %"44.i", !dbg !12
"44.i": ; preds = %"42.i"
%2 = load ptr, ptr undef, align 8, !dbg !12
diff --git a/llvm/test/DebugInfo/X86/deleted-bit-piece.ll b/llvm/test/DebugInfo/X86/deleted-bit-piece.ll
index fb07e0a26171a1..ff277006f77021 100644
--- a/llvm/test/DebugInfo/X86/deleted-bit-piece.ll
+++ b/llvm/test/DebugInfo/X86/deleted-bit-piece.ll
@@ -9,9 +9,9 @@ target triple = "x86_64-apple-macosx10.8.0"
; CHECK: __Z3foov:
; CHECK: retq
-define void @_Z3foov() !dbg !12 {
+define void @_Z3foov(i1 %arg) !dbg !12 {
entry:
- br i1 undef, label %exit, label %bb
+ br i1 %arg, label %exit, label %bb
bb: ; preds = %entry
call void @llvm.dbg.value(metadata ptr undef, metadata !15, metadata !16), !dbg !17
diff --git a/llvm/test/DebugInfo/X86/earlydup-crash.ll b/llvm/test/DebugInfo/X86/earlydup-crash.ll
index ccb8853fdd1ca9..be67e0f67023c9 100644
--- a/llvm/test/DebugInfo/X86/earlydup-crash.ll
+++ b/llvm/test/DebugInfo/X86/earlydup-crash.ll
@@ -6,15 +6,15 @@
declare void @llvm.dbg.value(metadata, metadata, metadata) nounwind readnone
-define internal ptr @framework_construct_pathname(ptr %fname, ptr %dir) nounwind ssp !dbg !2 {
+define internal ptr @framework_construct_pathname(ptr %fname, ptr %dir, i1 %arg) nounwind ssp !dbg !2 {
entry:
- br i1 undef, label %bb33, label %bb
+ br i1 %arg, label %bb33, label %bb
bb: ; preds = %entry
%tmp = icmp eq i32 undef, 0
%tmp1 = add i32 0, 11
call void @llvm.dbg.value(metadata i32 %tmp1, metadata !0, metadata !DIExpression()), !dbg !DILocation(scope: !1)
- br i1 undef, label %bb18, label %bb31.preheader
+ br i1 %arg, label %bb18, label %bb31.preheader
bb31.preheader: ; preds = %bb19, %bb
br label %bb31
@@ -30,7 +30,7 @@ bb19: ; preds = %bb18
bb22: ; preds = %bb31
%tmp4 = add i32 0, %tmp1
call void @foobar(i32 %tmp4)
- br i1 undef, label %bb33, label %bb31
+ br i1 %arg, label %bb33, label %bb31
bb31: ; preds = %bb22, %bb31.preheader
br i1 false, label %bb33, label %bb22
diff --git a/llvm/test/DebugInfo/X86/live-debug-values-constprop.mir b/llvm/test/DebugInfo/X86/live-debug-values-constprop.mir
index 2dbe8fbc0f2a4f..8a0537658c9c0d 100644
--- a/llvm/test/DebugInfo/X86/live-debug-values-constprop.mir
+++ b/llvm/test/DebugInfo/X86/live-debug-values-constprop.mir
@@ -8,9 +8,9 @@
source_filename = "<stdin>"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
- define i32 @foo(ptr %bees, ptr %output) !dbg !4 {
+ define i32 @foo(ptr %bees, ptr %output, i1 %arg) !dbg !4 {
entry:
- br i1 undef, label %bb1, label %bb1
+ br i1 %arg, label %bb1, label %bb1
bb1:
br label %bb3
bb2:
@@ -19,9 +19,9 @@
ret i32 0
}
- define i32 @bar(ptr %bees, ptr %output) !dbg !40 {
+ define i32 @bar(ptr %bees, ptr %output, i1 %arg) !dbg !40 {
entry:
- br i1 undef, label %bb1, label %bb1
+ br i1 %arg, label %bb1, label %bb1
bb1:
br label %bb3
bb2:
@@ -30,9 +30,9 @@
ret i32 0
}
- define i32 @baz(ptr %bees, ptr %output) !dbg !80 {
+ define i32 @baz(ptr %bees, ptr %output, i1 %arg) !dbg !80 {
entry:
- br i1 undef, label %bb1, label %bb1
+ br i1 %arg, label %bb1, label %bb1
bb1:
br label %bb3
bb2:
@@ -41,9 +41,9 @@
ret i32 0
}
- define i32 @qux(ptr %bees, ptr %output) !dbg !120 {
+ define i32 @qux(ptr %bees, ptr %output, i1 %arg) !dbg !120 {
entry:
- br i1 undef, label %bb1, label %bb1
+ br i1 %arg, label %bb1, label %bb1
bb1:
br label %bb3
bb2:
diff --git a/llvm/test/DebugInfo/X86/mem2reg_fp80.ll b/llvm/test/DebugInfo/X86/mem2reg_fp80.ll
index 342ba5a274a018..72409f4ef34bb6 100644
--- a/llvm/test/DebugInfo/X86/mem2reg_fp80.ll
+++ b/llvm/test/DebugInfo/X86/mem2reg_fp80.ll
@@ -4,11 +4,11 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
-define dso_local x86_fp80 @powixf2() !dbg !1 {
+define dso_local x86_fp80 @powixf2(i1 %arg) !dbg !1 {
entry:
%r = alloca x86_fp80, align 16
call void @llvm.dbg.declare(metadata ptr %r, metadata !14, metadata !DIExpression()), !dbg !15
- br i1 undef, label %if.then, label %if.end, !dbg !16
+ br i1 %arg, label %if.then, label %if.end, !dbg !16
if.then: ; preds = %entry
; CHECK-LABEL: if.then:
diff --git a/llvm/test/DebugInfo/X86/sdag-dbgvalue-phi-use-4.ll b/llvm/test/DebugInfo/X86/sdag-dbgvalue-phi-use-4.ll
index 1c04e77c7d2862..fa456abd51698b 100644
--- a/llvm/test/DebugInfo/X86/sdag-dbgvalue-phi-use-4.ll
+++ b/llvm/test/DebugInfo/X86/sdag-dbgvalue-phi-use-4.ll
@@ -39,9 +39,9 @@ target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
target triple = "i686-w64-windows-gnu"
; Function Attrs: nounwind readnone
-define dso_local i64 @nextafterl(i80 %a) local_unnamed_addr #0 !dbg !6 {
+define dso_local i64 @nextafterl(i80 %a, i1 %arg) local_unnamed_addr #0 !dbg !6 {
entry:
- br i1 undef, label %if.else, label %if.then13, !dbg !28
+ br i1 %arg, label %if.else, label %if.then13, !dbg !28
if.then13: ; preds = %entry
%u.sroa.0.8.insert.insert = or i80 %a, 2222, !dbg !29
>From 3f2f76f848c4b752cd2101c96d3bd9943f00e250 Mon Sep 17 00:00:00 2001
From: Lee <lee10202013 at gmail.com>
Date: Mon, 4 Nov 2024 20:39:48 -0700
Subject: [PATCH 06/10] Remove br undef in Verifier directory
---
llvm/test/Verifier/tbaa-cyclic.ll | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/llvm/test/Verifier/tbaa-cyclic.ll b/llvm/test/Verifier/tbaa-cyclic.ll
index 134fd7c4648cc4..76f7bb6062f9c7 100644
--- a/llvm/test/Verifier/tbaa-cyclic.ll
+++ b/llvm/test/Verifier/tbaa-cyclic.ll
@@ -1,13 +1,13 @@
; RUN: not llvm-as -disable-output < %s 2>&1 | FileCheck %s
; CHECK: Access type node must be a valid scalar type
-define void @test6(ptr %gi) #0 {
+define void @test6(ptr %gi, i1 %arg) #0 {
entry:
store i32 42, ptr %gi, align 4, !tbaa !0
br label %for.cond
for.cond: ; preds = %for.body, %entry
- br i1 undef, label %for.body, label %for.end
+ br i1 %arg, label %for.body, label %for.end
for.body: ; preds = %for.cond
store i32 undef, ptr %gi, align 4, !tbaa !2
>From f1146b2a3947c4aff7256b948e4a88894816dca9 Mon Sep 17 00:00:00 2001
From: Lee <lee10202013 at gmail.com>
Date: Mon, 4 Nov 2024 20:44:09 -0700
Subject: [PATCH 07/10] Remove br undef in tools directory
---
llvm/test/tools/llvm-reduce/operands-skip.ll | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/llvm/test/tools/llvm-reduce/operands-skip.ll b/llvm/test/tools/llvm-reduce/operands-skip.ll
index 505f1d7e369061..ba5bcf44201815 100644
--- a/llvm/test/tools/llvm-reduce/operands-skip.ll
+++ b/llvm/test/tools/llvm-reduce/operands-skip.ll
@@ -27,10 +27,10 @@
@Global = global i32 42
-define void @func(ptr %arg1, ptr %arg2) {
+define void @func(ptr %arg1, ptr %arg2, i1 %arg) {
entry:
%val = getelementptr i32, ptr getelementptr (i32, ptr @Global, i32 1), i32 2
- br i1 undef, label %branch, label %loop
+ br i1 %arg, label %branch, label %loop
branch:
%nondominating1 = getelementptr i32, ptr %val, i32 3
@@ -50,7 +50,7 @@ loop:
store i32 49, ptr %imm, align 4 ; Reduce to null
%nondominating2 = getelementptr i32, ptr %indirect, i32 6
- br i1 undef, label %loop, label %exit
+ br i1 %arg, label %loop, label %exit
exit:
store i32 50, ptr %arg2, align 4 ; Reduce to %arg1 (compactify function arguments)
>From 5ee4e9b8aaa33e27fe290b9db202c9ae6322838b Mon Sep 17 00:00:00 2001
From: Lee <lee10202013 at gmail.com>
Date: Mon, 4 Nov 2024 20:58:42 -0700
Subject: [PATCH 08/10] Remove br undef in SafePointIRVerifier directory
---
.../from-same-relocation-in-phi-nodes.ll | 4 +--
.../unrecorded-live-at-sp.ll | 4 +--
.../SafepointIRVerifier/uses-in-phi-nodes.ll | 32 +++++++++----------
3 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/llvm/test/SafepointIRVerifier/from-same-relocation-in-phi-nodes.ll b/llvm/test/SafepointIRVerifier/from-same-relocation-in-phi-nodes.ll
index a38651a5a1e4ed..392e1f04cbdab7 100644
--- a/llvm/test/SafepointIRVerifier/from-same-relocation-in-phi-nodes.ll
+++ b/llvm/test/SafepointIRVerifier/from-same-relocation-in-phi-nodes.ll
@@ -3,11 +3,11 @@
; In %merge %val.unrelocated, %ptr and %arg should be unrelocated.
; FIXME: if this test fails it is a false-positive alarm. IR is correct.
-define void @test.unrelocated-phi.ok(ptr addrspace(1) %arg) gc "statepoint-example" {
+define void @test.unrelocated-phi.ok(ptr addrspace(1) %arg, i1 %new_arg) gc "statepoint-example" {
; CHECK-LABEL: Verifying gc pointers in function: test.unrelocated-phi.ok
bci_0:
%ptr = getelementptr i8, ptr addrspace(1) %arg, i64 4
- br i1 undef, label %left, label %right
+ br i1 %new_arg, label %left, label %right
left:
%safepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr undef, i32 0, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
diff --git a/llvm/test/SafepointIRVerifier/unrecorded-live-at-sp.ll b/llvm/test/SafepointIRVerifier/unrecorded-live-at-sp.ll
index b64851e76b7164..42130c507fd093 100644
--- a/llvm/test/SafepointIRVerifier/unrecorded-live-at-sp.ll
+++ b/llvm/test/SafepointIRVerifier/unrecorded-live-at-sp.ll
@@ -14,7 +14,7 @@ declare ptr addrspace(1) @generate_obj2() #1
declare ptr addrspace(1) @generate_obj3() #1
; Function Attrs: nounwind
-define void @test(ptr addrspace(1), ptr addrspace(1), i32) #3 gc "statepoint-example" {
+define void @test(ptr addrspace(1), ptr addrspace(1), i32, i1 %new_arg) #3 gc "statepoint-example" {
bci_0:
%result608 = call ptr addrspace(1) @generate_obj3()
br label %bci_37-aload
@@ -24,7 +24,7 @@ bci_37-aload: ; preds = %not_zero179, %bci_0
%base_phi2 = phi ptr addrspace(1) [ %base_phi3, %not_zero179 ], [ %result608, %bci_0 ], !is_base_value !0
%relocated8 = phi ptr addrspace(1) [ %relocated7.relocated, %not_zero179 ], [ %result608, %bci_0 ]
%tmp3 = getelementptr inbounds %jObject, ptr addrspace(1) %relocated8, i64 0, i32 0, i64 32
- br i1 undef, label %not_zero179, label %not_zero146
+ br i1 %new_arg, label %not_zero179, label %not_zero146
not_zero146: ; preds = %bci_37-aload
%addr98.relocated = call ptr addrspace(1) @generate_obj2() #1
diff --git a/llvm/test/SafepointIRVerifier/uses-in-phi-nodes.ll b/llvm/test/SafepointIRVerifier/uses-in-phi-nodes.ll
index 2311d2d53c0eff..e75428bec23f78 100644
--- a/llvm/test/SafepointIRVerifier/uses-in-phi-nodes.ll
+++ b/llvm/test/SafepointIRVerifier/uses-in-phi-nodes.ll
@@ -1,9 +1,9 @@
; RUN: opt -safepoint-ir-verifier-print-only -verify-safepoint-ir -S %s 2>&1 | FileCheck %s
-define ptr addrspace(1) @test.not.ok.0(ptr addrspace(1) %arg) gc "statepoint-example" {
+define ptr addrspace(1) @test.not.ok.0(ptr addrspace(1) %arg, i1 %new_arg) gc "statepoint-example" {
; CHECK-LABEL: Verifying gc pointers in function: test.not.ok.0
bci_0:
- br i1 undef, label %left, label %right
+ br i1 %new_arg, label %left, label %right
left:
%safepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0)
@@ -20,10 +20,10 @@ define ptr addrspace(1) @test.not.ok.0(ptr addrspace(1) %arg) gc "statepoint-exa
ret ptr addrspace(1) %val
}
-define ptr addrspace(1) @test.not.ok.1(ptr addrspace(1) %arg) gc "statepoint-example" {
+define ptr addrspace(1) @test.not.ok.1(ptr addrspace(1) %arg, i1 %new_arg) gc "statepoint-example" {
; CHECK-LABEL: Verifying gc pointers in function: test.not.ok.1
bci_0:
- br i1 undef, label %left, label %right
+ br i1 %new_arg, label %left, label %right
left:
%safepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0)
@@ -40,10 +40,10 @@ define ptr addrspace(1) @test.not.ok.1(ptr addrspace(1) %arg) gc "statepoint-exa
ret ptr addrspace(1) %val
}
-define ptr addrspace(1) @test.ok.0(ptr addrspace(1) %arg) gc "statepoint-example" {
+define ptr addrspace(1) @test.ok.0(ptr addrspace(1) %arg, i1 %new_arg) gc "statepoint-example" {
; CHECK: No illegal uses found by SafepointIRVerifier in: test.ok.0
bci_0:
- br i1 undef, label %left, label %right
+ br i1 %new_arg, label %left, label %right
left:
%safepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0)
@@ -57,10 +57,10 @@ define ptr addrspace(1) @test.ok.0(ptr addrspace(1) %arg) gc "statepoint-example
ret ptr addrspace(1) %val
}
-define ptr addrspace(1) @test.ok.1(ptr addrspace(1) %arg) gc "statepoint-example" {
+define ptr addrspace(1) @test.ok.1(ptr addrspace(1) %arg, i1 %new_arg) gc "statepoint-example" {
; CHECK: No illegal uses found by SafepointIRVerifier in: test.ok.1
bci_0:
- br i1 undef, label %left, label %right
+ br i1 %new_arg, label %left, label %right
left:
call void @not_statepoint()
@@ -75,10 +75,10 @@ define ptr addrspace(1) @test.ok.1(ptr addrspace(1) %arg) gc "statepoint-example
}
; It should be allowed to compare poisoned ptr with null.
-define void @test.poisoned.cmp.ok(ptr addrspace(1) %arg) gc "statepoint-example" {
+define void @test.poisoned.cmp.ok(ptr addrspace(1) %arg, i1 %new_arg) gc "statepoint-example" {
; CHECK-LABEL: Verifying gc pointers in function: test.poisoned.cmp.ok
bci_0:
- br i1 undef, label %left, label %right
+ br i1 %new_arg, label %left, label %right
left:
%safepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0) ["gc-live"(ptr addrspace(1) %arg)]
@@ -97,10 +97,10 @@ define void @test.poisoned.cmp.ok(ptr addrspace(1) %arg) gc "statepoint-example"
}
; It is illegal to compare poisoned ptr and relocated.
-define void @test.poisoned.cmp.fail.0(ptr addrspace(1) %arg) gc "statepoint-example" {
+define void @test.poisoned.cmp.fail.0(ptr addrspace(1) %arg, i1 %new_arg) gc "statepoint-example" {
; CHECK-LABEL: Verifying gc pointers in function: test.poisoned.cmp.fail.0
bci_0:
- br i1 undef, label %left, label %right
+ br i1 %new_arg, label %left, label %right
left:
%safepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0) ["gc-live"(ptr addrspace(1) %arg)]
@@ -123,10 +123,10 @@ define void @test.poisoned.cmp.fail.0(ptr addrspace(1) %arg) gc "statepoint-exam
}
; It is illegal to compare poisoned ptr and unrelocated.
-define void @test.poisoned.cmp.fail.1(ptr addrspace(1) %arg) gc "statepoint-example" {
+define void @test.poisoned.cmp.fail.1(ptr addrspace(1) %arg, i1 %new_arg) gc "statepoint-example" {
; CHECK-LABEL: Verifying gc pointers in function: test.poisoned.cmp.fail.1
bci_0:
- br i1 undef, label %left, label %right
+ br i1 %new_arg, label %left, label %right
left:
%safepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0) ["gc-live"(ptr addrspace(1) %arg)]
@@ -148,10 +148,10 @@ define void @test.poisoned.cmp.fail.1(ptr addrspace(1) %arg) gc "statepoint-exam
}
; It should be allowed to compare unrelocated phi with unrelocated value.
-define void @test.unrelocated-phi.cmp.ok(ptr addrspace(1) %arg) gc "statepoint-example" {
+define void @test.unrelocated-phi.cmp.ok(ptr addrspace(1) %arg, i1 %new_arg) gc "statepoint-example" {
; CHECK-LABEL: Verifying gc pointers in function: test.unrelocated-phi.cmp.ok
bci_0:
- br i1 undef, label %left, label %right
+ br i1 %new_arg, label %left, label %right
left:
%safepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0)
>From f3e741ef413d176c78f02c32b4cdd4481a0b973b Mon Sep 17 00:00:00 2001
From: Lee <lee10202013 at gmail.com>
Date: Tue, 5 Nov 2024 23:22:39 -0700
Subject: [PATCH 09/10] Remove br undef in Analysis directory
---
.../test/Analysis/BasicAA/phi-values-usage.ll | 8 +-
.../test/Analysis/BasicAA/underlying-value.ll | 4 +-
.../irreducible_loop_crash.ll | 6 +-
.../BranchProbabilityInfo/deopt-invoke.ll | 12 +--
.../Analysis/BranchProbabilityInfo/loop.ll | 44 ++++----
.../BranchProbabilityInfo/unreachable.ll | 36 +++----
.../CostModel/SystemZ/intrinsic-cost-crash.ll | 4 +-
llvm/test/Analysis/CycleInfo/basic.ll | 100 +++++++++---------
.../CycleInfo/unreachable-predecessor.ll | 4 +-
.../Analysis/Delinearization/type_mismatch.ll | 4 +-
llvm/test/Analysis/Delinearization/undef.ll | 12 +--
.../DependenceAnalysis/MIVCheckConst.ll | 10 +-
.../DependenceAnalysis/NonAffineExpr.ll | 8 +-
llvm/test/Analysis/Dominators/basic.ll | 14 +--
.../test/Analysis/Dominators/print-dot-dom.ll | 14 +--
.../invariant.group-bug.ll | 30 +++---
llvm/test/Analysis/MemorySSA/cyclicphi.ll | 26 ++---
llvm/test/Analysis/MemorySSA/debugvalue.ll | 4 +-
llvm/test/Analysis/MemorySSA/debugvalue2.ll | 4 +-
.../Analysis/MemorySSA/forward-unreachable.ll | 4 +-
.../Analysis/MemorySSA/function-clobber.ll | 6 +-
.../Analysis/MemorySSA/invariant-groups.ll | 26 ++---
.../MemorySSA/loop-rotate-disablebasicaa.ll | 6 +-
.../MemorySSA/loop-rotate-simplified-clone.ll | 6 +-
.../MemorySSA/loop-rotate-valuemap.ll | 4 +-
.../Analysis/MemorySSA/phi-translation.ll | 22 ++--
llvm/test/Analysis/MemorySSA/pr28880.ll | 6 +-
llvm/test/Analysis/MemorySSA/pr40749_2.ll | 4 +-
llvm/test/Analysis/MemorySSA/pr41640.ll | 30 +++---
llvm/test/Analysis/MemorySSA/pr41853.ll | 8 +-
llvm/test/Analysis/MemorySSA/pr42940.ll | 50 ++++-----
llvm/test/Analysis/MemorySSA/pr43317.ll | 8 +-
llvm/test/Analysis/MemorySSA/pr43320.ll | 12 +--
llvm/test/Analysis/MemorySSA/pr43427.ll | 14 +--
llvm/test/Analysis/MemorySSA/pr43438.ll | 20 ++--
llvm/test/Analysis/MemorySSA/pr43493.ll | 8 +-
llvm/test/Analysis/MemorySSA/pr43541.ll | 6 +-
llvm/test/Analysis/MemorySSA/pr43641.ll | 4 +-
llvm/test/Analysis/MemorySSA/pr45976.ll | 10 +-
.../MemorySSA/reduce_clobber_limit.ll | 6 +-
llvm/test/Analysis/MemorySSA/renamephis.ll | 6 +-
llvm/test/Analysis/MemorySSA/unreachable.ll | 4 +-
llvm/test/Analysis/MemorySSA/update_unroll.ll | 8 +-
llvm/test/Analysis/PhiValues/basic.ll | 66 ++++++------
.../test/Analysis/PhiValues/long_phi_chain.ll | 30 +++---
llvm/test/Analysis/PostDominators/pr6047_a.ll | 4 +-
llvm/test/Analysis/PostDominators/pr6047_b.ll | 6 +-
llvm/test/Analysis/PostDominators/pr6047_c.ll | 4 +-
llvm/test/Analysis/PostDominators/pr6047_d.ll | 4 +-
.../ScalarEvolution/2011-04-26-FoldAddRec.ll | 4 +-
.../ScalarEvolution/SolveQuadraticEquation.ll | 10 +-
.../avoid-infinite-recursion-0.ll | 4 +-
.../avoid-infinite-recursion-1.ll | 48 ++++-----
.../ScalarEvolution/different-loops-recs.ll | 6 +-
.../expander-replace-congruent-ivs.ll | 24 ++---
.../ScalarEvolution/how-far-to-zero.ll | 4 +-
.../overflow-intrinsics-trip-count.ll | 60 +++++------
.../ScalarEvolution/pointer-sign-bits.ll | 68 ++++++------
llvm/test/Analysis/ScalarEvolution/pr22674.ll | 16 +--
llvm/test/Analysis/ScalarEvolution/pr22856.ll | 8 +-
llvm/test/Analysis/ScalarEvolution/pr25369.ll | 8 +-
llvm/test/Analysis/ScalarEvolution/scev-aa.ll | 8 +-
.../ScalarEvolution/scev-canonical-mode.ll | 6 +-
.../Analysis/ScalarEvolution/scev-invalid.ll | 4 +-
.../ScalarEvolution/shift-recurrences.ll | 44 ++++----
.../ValueTracking/memory-dereferenceable.ll | 6 +-
66 files changed, 533 insertions(+), 531 deletions(-)
diff --git a/llvm/test/Analysis/BasicAA/phi-values-usage.ll b/llvm/test/Analysis/BasicAA/phi-values-usage.ll
index 4c5f071ab96692..43df41c9164180 100644
--- a/llvm/test/Analysis/BasicAA/phi-values-usage.ll
+++ b/llvm/test/Analysis/BasicAA/phi-values-usage.ll
@@ -20,10 +20,10 @@ declare void @llvm.lifetime.end.p0(i64, ptr nocapture)
; This function is one where if we didn't free basicaa after memcpyopt then the
; usage of basicaa in instcombine would cause a segfault due to stale phi-values
; results being used.
-define void @fn(ptr %this, ptr %ptr) personality ptr @__gxx_personality_v0 {
+define void @fn(ptr %this, ptr %ptr, i1 %arg) personality ptr @__gxx_personality_v0 {
entry:
%arr = alloca [4 x i8], align 8
- br i1 undef, label %then, label %if
+ br i1 %arg, label %then, label %if
if:
br label %then
@@ -50,7 +50,7 @@ lpad:
; When running instcombine after memdep, the basicaa used by instcombine uses
; the phivalues that memdep used. This would then cause a segfault due to
; instcombine deleting a phi whose values had been cached.
-define void @fn2() {
+define void @fn2(i1 %arg) {
entry:
%a = alloca i8, align 1
%0 = load ptr, ptr @c, align 1
@@ -58,7 +58,7 @@ entry:
for.cond: ; preds = %for.body, %entry
%d.0 = phi ptr [ %0, %entry ], [ null, %for.body ]
- br i1 undef, label %for.body, label %for.cond.cleanup
+ br i1 %arg, label %for.body, label %for.cond.cleanup
for.body: ; preds = %for.cond
store volatile i8 undef, ptr %a, align 1
diff --git a/llvm/test/Analysis/BasicAA/underlying-value.ll b/llvm/test/Analysis/BasicAA/underlying-value.ll
index 4d267af8c44438..36c0c266e9a19a 100644
--- a/llvm/test/Analysis/BasicAA/underlying-value.ll
+++ b/llvm/test/Analysis/BasicAA/underlying-value.ll
@@ -3,12 +3,12 @@
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
-define void @func_20() nounwind {
+define void @func_20(i1 %arg) nounwind {
entry:
br label %for.cond
for.cond: ; preds = %for.cond2, %entry
- br i1 undef, label %for.cond2, label %for.end22
+ br i1 %arg, label %for.cond2, label %for.end22
for.cond2: ; preds = %for.body5, %for.cond
br i1 false, label %for.body5, label %for.cond
diff --git a/llvm/test/Analysis/BlockFrequencyInfo/irreducible_loop_crash.ll b/llvm/test/Analysis/BlockFrequencyInfo/irreducible_loop_crash.ll
index b2aa0648c0a92f..09fe7e50e69cf0 100644
--- a/llvm/test/Analysis/BlockFrequencyInfo/irreducible_loop_crash.ll
+++ b/llvm/test/Analysis/BlockFrequencyInfo/irreducible_loop_crash.ll
@@ -3,10 +3,10 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
-define void @fn1(ptr %f) {
+define void @fn1(ptr %f, i1 %arg) {
entry:
%tobool7 = icmp eq i32 undef, 0
- br i1 undef, label %if.end.12, label %for.body.5
+ br i1 %arg, label %if.end.12, label %for.body.5
for.inc:
store i32 undef, ptr %f, align 4
@@ -19,7 +19,7 @@ for.inc.9: ; preds = %for.body.5
br i1 %tobool7, label %for.inc.9.1, label %for.inc
if.end.12: ; preds = %if.end.12, %for.body
- br i1 undef, label %for.end.17, label %for.inc
+ br i1 %arg, label %for.end.17, label %for.inc
for.end.17: ; preds = %entry
ret void
diff --git a/llvm/test/Analysis/BranchProbabilityInfo/deopt-invoke.ll b/llvm/test/Analysis/BranchProbabilityInfo/deopt-invoke.ll
index f6b906b95ec6ee..0dbfdfdeb34ca6 100644
--- a/llvm/test/Analysis/BranchProbabilityInfo/deopt-invoke.ll
+++ b/llvm/test/Analysis/BranchProbabilityInfo/deopt-invoke.ll
@@ -8,7 +8,7 @@ declare void @cold() cold
; Even though the likeliness of 'invoke' to throw an exception is assessed as low
; all other paths are even less likely. Check that hot paths leads to excepion handler.
-define void @test1(i32 %0) personality ptr @"personality_function" !prof !1 {
+define void @test1(i32 %0, i1 %arg) personality ptr @"personality_function" !prof !1 {
;CHECK: edge %entry -> %unreached probability is 0x00000001 / 0x80000000 = 0.00%
;CHECK: edge %entry -> %invoke probability is 0x7fffffff / 0x80000000 = 100.00% [HOT edge]
;CHECK: edge %invoke -> %invoke.cont.unreached probability is 0x00000000 / 0x80000000 = 0.00%
@@ -16,7 +16,7 @@ define void @test1(i32 %0) personality ptr @"personality_function" !prof !1 {
;CHECK: edge %land.pad -> %exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
entry:
- br i1 undef, label %unreached, label %invoke, !prof !2
+ br i1 %arg, label %unreached, label %invoke, !prof !2
invoke:
invoke void @foo(i32 %0)
to label %invoke.cont.unreached unwind label %land.pad
@@ -38,7 +38,7 @@ exit:
ret void
}
-define void @test2(i32 %0) personality ptr @"personality_function" {
+define void @test2(i32 %0, i1 %arg) personality ptr @"personality_function" {
;CHECK: edge %entry -> %unreached probability is 0x00000000 / 0x80000000 = 0.00%
;CHECK: edge %entry -> %invoke probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
;CHECK: edge %invoke -> %invoke.cont.cold probability is 0x7fff8000 / 0x80000000 = 100.00% [HOT edge]
@@ -46,7 +46,7 @@ define void @test2(i32 %0) personality ptr @"personality_function" {
;CHECK: edge %land.pad -> %exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
entry:
- br i1 undef, label %unreached, label %invoke
+ br i1 %arg, label %unreached, label %invoke
invoke:
invoke void @foo(i32 %0)
to label %invoke.cont.cold unwind label %land.pad
@@ -68,14 +68,14 @@ exit:
ret void
}
-define void @test3(i32 %0) personality ptr @"personality_function" {
+define void @test3(i32 %0, i1 %arg) personality ptr @"personality_function" {
;CHECK: edge %entry -> %unreached probability is 0x00000000 / 0x80000000 = 0.00%
;CHECK: edge %entry -> %invoke probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
;CHECK: edge %invoke -> %invoke.cont.cold probability is 0x7fff8000 / 0x80000000 = 100.00% [HOT edge]
;CHECK: edge %invoke -> %land.pad probability is 0x00008000 / 0x80000000 = 0.00%
;CHECK: edge %land.pad -> %exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
entry:
- br i1 undef, label %unreached, label %invoke
+ br i1 %arg, label %unreached, label %invoke
invoke:
invoke void @foo(i32 %0)
to label %invoke.cont.cold unwind label %land.pad
diff --git a/llvm/test/Analysis/BranchProbabilityInfo/loop.ll b/llvm/test/Analysis/BranchProbabilityInfo/loop.ll
index 0b02cedf03df3e..ffac1cd4666415 100644
--- a/llvm/test/Analysis/BranchProbabilityInfo/loop.ll
+++ b/llvm/test/Analysis/BranchProbabilityInfo/loop.ll
@@ -523,7 +523,7 @@ declare void @cold() cold
; If loop has single exit and it leads to 'cold' block then edge leading to loop enter
; should be considered 'cold' as well.
-define void @test13() {
+define void @test13(i1 %arg) {
; CHECK: edge %entry -> %loop probability is 0x078780e3 / 0x80000000 = 5.88%
; CHECK: edge %entry -> %exit probability is 0x78787f1d / 0x80000000 = 94.12% [HOT edge]
; CHECK: edge %loop -> %loop probability is 0x7fbe1203 / 0x80000000 = 99.80% [HOT edge]
@@ -531,12 +531,12 @@ define void @test13() {
; CHECK: edge %cold -> %exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
entry:
- br i1 undef, label %loop, label %exit
+ br i1 %arg, label %loop, label %exit
loop:
%i.0 = phi i32 [ 0, %entry ], [ %inc, %loop ]
%inc = add nsw i32 %i.0, 1
- br i1 undef, label %loop, label %cold
+ br i1 %arg, label %loop, label %cold
cold:
call void @cold()
@@ -547,7 +547,7 @@ exit:
}
; This is the same case as test13 but with additional loop 'preheader' block.
-define void @test14() {
+define void @test14(i1 %arg) {
; CHECK: edge %entry -> %preheader probability is 0x078780e3 / 0x80000000 = 5.88%
; CHECK: edge %entry -> %exit probability is 0x78787f1d / 0x80000000 = 94.12% [HOT edge]
; CHECK: edge %preheader -> %loop probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
@@ -556,7 +556,7 @@ define void @test14() {
; CHECK: edge %cold -> %exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
entry:
- br i1 undef, label %preheader, label %exit
+ br i1 %arg, label %preheader, label %exit
preheader:
br label %loop
@@ -564,7 +564,7 @@ preheader:
loop:
%i.0 = phi i32 [ 0, %preheader ], [ %inc, %loop ]
%inc = add nsw i32 %i.0, 1
- br i1 undef, label %loop, label %cold
+ br i1 %arg, label %loop, label %cold
cold:
call void @cold()
@@ -576,7 +576,7 @@ exit:
; If loop has multiple low probability exits then edge leading to loop enter
; should be considered low probable as well.
-define void @test15() {
+define void @test15(i1 %arg) {
; CHECK: edge %entry -> %loop probability is 0x078780e3 / 0x80000000 = 5.88%
; CHECK: edge %entry -> %exit probability is 0x78787f1d / 0x80000000 = 94.12% [HOT edge]
; CHECK: edge %loop -> %cont probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
@@ -586,15 +586,15 @@ define void @test15() {
; CHECK: edge %cold -> %exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
entry:
- br i1 undef, label %loop, label %exit
+ br i1 %arg, label %loop, label %exit
loop:
%i.0 = phi i32 [ 0, %entry ], [ %inc, %cont ]
%inc = add nsw i32 %i.0, 1
- br i1 undef, label %cont, label %unreached
+ br i1 %arg, label %cont, label %unreached
cont:
- br i1 undef, label %loop, label %cold
+ br i1 %arg, label %loop, label %cold
unreached:
unreachable
@@ -609,7 +609,7 @@ exit:
}
; This is the same case as test15 but with additional loop 'preheader' block.
-define void @test16() {
+define void @test16(i1 %arg) {
; CHECK: edge %entry -> %preheader probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
; CHECK: edge %preheader -> %loop probability is 0x078780e3 / 0x80000000 = 5.88%
; CHECK: edge %preheader -> %exit probability is 0x78787f1d / 0x80000000 = 94.12% [HOT edge]
@@ -623,15 +623,15 @@ entry:
br label %preheader
preheader:
- br i1 undef, label %loop, label %exit
+ br i1 %arg, label %loop, label %exit
loop:
%i.0 = phi i32 [ 0, %preheader ], [ %inc, %cont ]
%inc = add nsw i32 %i.0, 1
- br i1 undef, label %cont, label %unreached
+ br i1 %arg, label %cont, label %unreached
cont:
- br i1 undef, label %loop, label %cold
+ br i1 %arg, label %loop, label %cold
unreached:
unreachable
@@ -649,7 +649,7 @@ declare void @abort() noreturn
; Check that 'preheader' has 50/50 probability since there is one 'normal' exit.
; Check that exit to 'cold' and 'noreturn' has lower probability than 'normal' exit.
-define void @test17() {
+define void @test17(i1 %arg) {
; CHECK: edge %entry -> %preheader probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
; CHECK: edge %preheader -> %loop probability is 0x40000000 / 0x80000000 = 50.00%
; CHECK: edge %preheader -> %exit probability is 0x40000000 / 0x80000000 = 50.00%
@@ -664,18 +664,18 @@ entry:
br label %preheader
preheader:
- br i1 undef, label %loop, label %exit
+ br i1 %arg, label %loop, label %exit
loop:
%i.0 = phi i32 [ 0, %preheader ], [ %inc, %cont2 ]
%inc = add nsw i32 %i.0, 1
- br i1 undef, label %cont, label %noreturn
+ br i1 %arg, label %cont, label %noreturn
cont:
- br i1 undef, label %cont2, label %cold
+ br i1 %arg, label %cont2, label %cold
cont2:
- br i1 undef, label %loop, label %exit
+ br i1 %arg, label %loop, label %exit
noreturn:
call void @abort()
@@ -692,7 +692,7 @@ exit:
; This is case with two loops where one nested into another. Nested loop has
; low probable exit what encreases robability to take exit in the top level loop.
-define void @test18() {
+define void @test18(i1 %arg) {
; CHECK: edge %entry -> %top.loop probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
; CHECK: edge %top.loop -> %loop probability is 0x546cd4b7 / 0x80000000 = 65.96%
; CHECK: edge %top.loop -> %exit probability is 0x2b932b49 / 0x80000000 = 34.04%
@@ -705,12 +705,12 @@ entry:
top.loop:
%j.0 = phi i32 [ 0, %entry ], [ %j.inc, %cold ]
- br i1 undef, label %loop, label %exit
+ br i1 %arg, label %loop, label %exit
loop:
%i.0 = phi i32 [ %j.0, %top.loop ], [ %inc, %loop ]
%inc = add nsw i32 %i.0, 1
- br i1 undef, label %loop, label %cold
+ br i1 %arg, label %loop, label %cold
cold:
call void @cold()
diff --git a/llvm/test/Analysis/BranchProbabilityInfo/unreachable.ll b/llvm/test/Analysis/BranchProbabilityInfo/unreachable.ll
index d3ada520c4dac9..1de1893a729111 100644
--- a/llvm/test/Analysis/BranchProbabilityInfo/unreachable.ll
+++ b/llvm/test/Analysis/BranchProbabilityInfo/unreachable.ll
@@ -5,7 +5,7 @@ declare void @bar() cold
; Both 'l1' and 'r1' has one edge leading to 'cold' and another one to
; 'unreachable' blocks. Check that 'cold' paths are preferred. Also ensure both
; paths from 'entry' block are equal.
-define void @test1(i32 %0) {
+define void @test1(i32 %0, i1 %arg) {
;CHECK: edge %entry -> %l1 probability is 0x40000000 / 0x80000000 = 50.00%
;CHECK: edge %entry -> %r1 probability is 0x40000000 / 0x80000000 = 50.00%
;CHECK: edge %l1 -> %cold probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
@@ -14,13 +14,13 @@ define void @test1(i32 %0) {
;CHECK: edge %r1 -> %cold probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
entry:
- br i1 undef, label %l1, label %r1
+ br i1 %arg, label %l1, label %r1
l1:
- br i1 undef, label %cold, label %unreached
+ br i1 %arg, label %cold, label %unreached
r1:
- br i1 undef, label %unreached, label %cold
+ br i1 %arg, label %unreached, label %cold
unreached:
unreachable
@@ -33,7 +33,7 @@ cold:
; Both edges of 'l1' leads to 'cold' blocks while one edge of 'r1' leads to
; 'unreachable' block. Check that 'l1' has 50/50 while 'r1' has 0/100
; distributuion. Also ensure both paths from 'entry' block are equal.
-define void @test2(i32 %0) {
+define void @test2(i32 %0, i1 %arg) {
;CHECK: edge %entry -> %l1 probability is 0x40000000 / 0x80000000 = 50.00%
;CHECK: edge %entry -> %r1 probability is 0x40000000 / 0x80000000 = 50.00%
;CHECK: edge %l1 -> %cold probability is 0x40000000 / 0x80000000 = 50.00%
@@ -42,13 +42,13 @@ define void @test2(i32 %0) {
;CHECK: edge %r1 -> %cold probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
entry:
- br i1 undef, label %l1, label %r1
+ br i1 %arg, label %l1, label %r1
l1:
- br i1 undef, label %cold, label %cold2
+ br i1 %arg, label %cold, label %cold2
r1:
- br i1 undef, label %unreached, label %cold
+ br i1 %arg, label %unreached, label %cold
unreached:
unreachable
@@ -64,7 +64,7 @@ cold2:
; Both edges of 'r1' leads to 'unreachable' blocks while one edge of 'l1' leads to
; 'cold' block. Ensure that path leading to 'cold' block is preferred.
-define void @test3(i32 %0) {
+define void @test3(i32 %0, i1 %arg) {
;CHECK: edge %entry -> %l1 probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
;CHECK: edge %entry -> %r1 probability is 0x00000000 / 0x80000000 = 0.00%
;CHECK: edge %l1 -> %cold probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
@@ -73,13 +73,13 @@ define void @test3(i32 %0) {
;CHECK: edge %r1 -> %unreached2 probability is 0x40000000 / 0x80000000 = 50.00%
entry:
- br i1 undef, label %l1, label %r1
+ br i1 %arg, label %l1, label %r1
l1:
- br i1 undef, label %cold, label %unreached
+ br i1 %arg, label %cold, label %unreached
r1:
- br i1 undef, label %unreached, label %unreached2
+ br i1 %arg, label %unreached, label %unreached2
unreached:
unreachable
@@ -95,7 +95,7 @@ cold:
; Left edge of 'entry' leads to 'cold' block while right edge is 'normal' continuation.
; Check that we able to propagate 'cold' weight to 'entry' block. Also ensure
; both edges from 'l1' are equally likely.
-define void @test4(i32 %0) {
+define void @test4(i32 %0, i1 %arg) {
;CHECK: edge %entry -> %l1 probability is 0x078780e3 / 0x80000000 = 5.88%
;CHECK: edge %entry -> %r1 probability is 0x78787f1d / 0x80000000 = 94.12% [HOT edge]
;CHECK: edge %l1 -> %l2 probability is 0x40000000 / 0x80000000 = 50.00%
@@ -105,10 +105,10 @@ define void @test4(i32 %0) {
;CHECK: edge %to.cold -> %cold probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
entry:
- br i1 undef, label %l1, label %r1
+ br i1 %arg, label %l1, label %r1
l1:
- br i1 undef, label %l2, label %r2
+ br i1 %arg, label %l2, label %r2
l2:
br label %to.cold
@@ -128,7 +128,7 @@ cold:
}
; Check that most likely path from 'entry' to 'l2' through 'r1' is preferred.
-define void @test5(i32 %0) {
+define void @test5(i32 %0, i1 %arg) {
;CHECK: edge %entry -> %cold probability is 0x078780e3 / 0x80000000 = 5.88%
;CHECK: edge %entry -> %r1 probability is 0x78787f1d / 0x80000000 = 94.12% [HOT edge]
;CHECK: edge %cold -> %l2 probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
@@ -136,14 +136,14 @@ define void @test5(i32 %0) {
;CHECK: edge %r1 -> %unreached probability is 0x00000000 / 0x80000000 = 0.00%
entry:
- br i1 undef, label %cold, label %r1
+ br i1 %arg, label %cold, label %r1
cold:
call void @bar()
br label %l2
r1:
- br i1 undef, label %l2, label %unreached
+ br i1 %arg, label %l2, label %unreached
l2:
ret void
diff --git a/llvm/test/Analysis/CostModel/SystemZ/intrinsic-cost-crash.ll b/llvm/test/Analysis/CostModel/SystemZ/intrinsic-cost-crash.ll
index d8a864a85ed59d..ecc7fc8fdb98a0 100644
--- a/llvm/test/Analysis/CostModel/SystemZ/intrinsic-cost-crash.ll
+++ b/llvm/test/Analysis/CostModel/SystemZ/intrinsic-cost-crash.ll
@@ -26,12 +26,12 @@
declare void @llvm.lifetime.end(i64, ptr nocapture) #0
; Function Attrs: nounwind ssp uwtable
-define hidden void @fun(ptr %N) #1 align 2 {
+define hidden void @fun(ptr %N, i1 %arg) #1 align 2 {
; CHECK: define
entry:
%NumOperands.i = getelementptr inbounds %"class.llvm::SDNode.310.1762.9990.10474.10958.11442.11926.12410.12894.13378.13862.15314.15798.16282.17734.19186.21122.25962.26930.29350.29834.30318.30802.31286.31770.32254.32738.33706.36610.38062.41642", ptr %N, i64 0, i32 8
%0 = load i16, ptr %NumOperands.i, align 8, !tbaa !1
- br i1 undef, label %for.cond.cleanup, label %for.body.lr.ph
+ br i1 %arg, label %for.cond.cleanup, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%wide.trip.count192 = zext i16 %0 to i64
diff --git a/llvm/test/Analysis/CycleInfo/basic.ll b/llvm/test/Analysis/CycleInfo/basic.ll
index e459b0c317f948..33e5227b162fd3 100644
--- a/llvm/test/Analysis/CycleInfo/basic.ll
+++ b/llvm/test/Analysis/CycleInfo/basic.ll
@@ -7,36 +7,36 @@ define void @empty() {
ret void
}
-define void @simple() {
+define void @simple(i1 %arg) {
; CHECK-LABEL: CycleInfo for function: simple
; CHECK: depth=1: entries(loop)
entry:
br label %loop
loop:
- br i1 undef, label %loop, label %exit
+ br i1 %arg, label %loop, label %exit
exit:
ret void
}
-define void @two_latches() {
+define void @two_latches(i1 %arg) {
; CHECK-LABEL: CycleInfo for function: two_latches
; CHECK: depth=1: entries(loop) loop_next
entry:
br label %loop
loop:
- br i1 undef, label %loop, label %loop_next
+ br i1 %arg, label %loop, label %loop_next
loop_next:
- br i1 undef, label %exit, label %loop
+ br i1 %arg, label %exit, label %loop
exit:
ret void
}
-define void @nested_simple() {
+define void @nested_simple(i1 %arg) {
; CHECK-LABEL: CycleInfo for function: nested_simple
; CHECK: depth=1: entries(outer_header) outer_latch inner
; CHECK: depth=2: entries(inner)
@@ -47,16 +47,16 @@ outer_header:
br label %inner
inner:
- br i1 undef, label %inner, label %outer_latch
+ br i1 %arg, label %inner, label %outer_latch
outer_latch:
- br i1 undef, label %outer_header, label %exit
+ br i1 %arg, label %outer_header, label %exit
exit:
ret void
}
-define void @nested_outer_latch_in_inner_loop() {
+define void @nested_outer_latch_in_inner_loop(i1 %arg) {
; CHECK-LABEL: CycleInfo for function: nested_outer_latch_in_inner_loop
; CHECK: depth=1: entries(outer_header) inner_header inner_latch
; CHECK: depth=2: entries(inner_header) inner_latch
@@ -67,33 +67,33 @@ outer_header:
br label %inner_header
inner_header:
- br i1 undef, label %inner_latch, label %outer_header
+ br i1 %arg, label %inner_latch, label %outer_header
inner_latch:
- br i1 undef, label %exit, label %inner_header
+ br i1 %arg, label %exit, label %inner_header
exit:
ret void
}
-define void @sibling_loops() {
+define void @sibling_loops(i1 %arg) {
; CHECK-LABEL: CycleInfo for function: sibling_loops
; CHECK-DAG: depth=1: entries(left)
; CHECK-DAG: depth=1: entries(right)
entry:
- br i1 undef, label %left, label %right
+ br i1 %arg, label %left, label %right
left:
- br i1 undef, label %left, label %exit
+ br i1 %arg, label %left, label %exit
right:
- br i1 undef, label %right, label %exit
+ br i1 %arg, label %right, label %exit
exit:
ret void
}
-define void @serial_loops() {
+define void @serial_loops(i1 %arg) {
; CHECK-LABEL: CycleInfo for function: serial_loops
; CHECK-DAG: depth=1: entries(second)
; CHECK-DAG: depth=1: entries(first)
@@ -101,16 +101,16 @@ entry:
br label %first
first:
- br i1 undef, label %first, label %second
+ br i1 %arg, label %first, label %second
second:
- br i1 undef, label %second, label %exit
+ br i1 %arg, label %second, label %exit
exit:
ret void
}
-define void @nested_sibling_loops() {
+define void @nested_sibling_loops(i1 %arg) {
; CHECK-LABEL: CycleInfo for function: nested_sibling_loops
; CHECK: depth=1: entries(outer_header) left right
; CHECK-DAG: depth=2: entries(right)
@@ -119,7 +119,7 @@ entry:
br label %outer_header
outer_header:
- br i1 undef, label %left, label %right
+ br i1 %arg, label %left, label %right
left:
switch i32 undef, label %exit [ i32 0, label %left
@@ -133,7 +133,7 @@ exit:
ret void
}
-define void @deeper_nest() {
+define void @deeper_nest(i1 %arg) {
; CHECK-LABEL: CycleInfo for function: deeper_nest
; CHECK: depth=1: entries(outer_header) outer_latch middle_header inner_header inner_latch
; CHECK: depth=2: entries(middle_header) inner_header inner_latch
@@ -148,47 +148,47 @@ middle_header:
br label %inner_header
inner_header:
- br i1 undef, label %middle_header, label %inner_latch
+ br i1 %arg, label %middle_header, label %inner_latch
inner_latch:
- br i1 undef, label %inner_header, label %outer_latch
+ br i1 %arg, label %inner_header, label %outer_latch
outer_latch:
- br i1 undef, label %outer_header, label %exit
+ br i1 %arg, label %outer_header, label %exit
exit:
ret void
}
-define void @irreducible_basic() {
+define void @irreducible_basic(i1 %arg) {
; CHECK-LABEL: CycleInfo for function: irreducible_basic
; CHECK: depth=1: entries(right left)
entry:
- br i1 undef, label %left, label %right
+ br i1 %arg, label %left, label %right
left:
- br i1 undef, label %right, label %exit
+ br i1 %arg, label %right, label %exit
right:
- br i1 undef, label %left, label %exit
+ br i1 %arg, label %left, label %exit
exit:
ret void
}
-define void @irreducible_mess() {
+define void @irreducible_mess(i1 %arg) {
; CHECK-LABEL: CycleInfo for function: irreducible_mess
; CHECK: depth=1: entries(B A) D C
; CHECK: depth=2: entries(D C A)
; CHECK: depth=3: entries(C A)
entry:
- br i1 undef, label %A, label %B
+ br i1 %arg, label %A, label %B
A:
- br i1 undef, label %C, label %D
+ br i1 %arg, label %C, label %D
B:
- br i1 undef, label %C, label %D
+ br i1 %arg, label %C, label %D
C:
switch i32 undef, label %A [ i32 0, label %D
@@ -202,7 +202,7 @@ exit:
ret void
}
-define void @irreducible_into_simple_cycle() {
+define void @irreducible_into_simple_cycle(i1 %arg) {
; CHECK-LABEL: CycleInfo for function: irreducible_into_simple_cycle
; CHECK: depth=1: entries(F C A) E D B
entry:
@@ -219,28 +219,28 @@ C:
br label %D
D:
- br i1 undef, label %E, label %exit
+ br i1 %arg, label %E, label %exit
E:
br label %F
F:
- br i1 undef, label %A, label %exit
+ br i1 %arg, label %A, label %exit
exit:
ret void
}
-define void @irreducible_mountain_bug() {
+define void @irreducible_mountain_bug(i1 %arg) {
; CHECK-LABEL: CycleInfo for function: irreducible_mountain_bug
; CHECK: depth=1: entries(while.cond)
; CHECK: depth=2: entries(cond.end61 cond.true49) while.body63 while.cond47
; CHECK: depth=3: entries(while.body63 cond.true49) while.cond47
entry:
- br i1 undef, label %if.end, label %if.then
+ br i1 %arg, label %if.end, label %if.then
if.end:
- br i1 undef, label %if.then7, label %if.else
+ br i1 %arg, label %if.then7, label %if.else
if.then7:
br label %if.end16
@@ -249,49 +249,49 @@ if.else:
br label %if.end16
if.end16:
- br i1 undef, label %while.cond.preheader, label %if.then39
+ br i1 %arg, label %while.cond.preheader, label %if.then39
while.cond.preheader:
br label %while.cond
while.cond:
- br i1 undef, label %cond.true49, label %lor.rhs
+ br i1 %arg, label %cond.true49, label %lor.rhs
cond.true49:
- br i1 undef, label %if.then69, label %while.body63
+ br i1 %arg, label %if.then69, label %while.body63
while.body63:
- br i1 undef, label %exit, label %while.cond47
+ br i1 %arg, label %exit, label %while.cond47
while.cond47:
- br i1 undef, label %cond.true49, label %cond.end61
+ br i1 %arg, label %cond.true49, label %cond.end61
cond.end61:
- br i1 undef, label %while.body63, label %while.cond
+ br i1 %arg, label %while.body63, label %while.cond
if.then69:
- br i1 undef, label %exit, label %while.cond
+ br i1 %arg, label %exit, label %while.cond
lor.rhs:
- br i1 undef, label %cond.end61, label %while.end76
+ br i1 %arg, label %cond.end61, label %while.end76
while.end76:
br label %exit
if.then39:
- br i1 undef, label %exit, label %if.end.i145
+ br i1 %arg, label %exit, label %if.end.i145
if.end.i145:
- br i1 undef, label %exit, label %if.end8.i149
+ br i1 %arg, label %exit, label %if.end8.i149
if.end8.i149:
br label %exit
if.then:
- br i1 undef, label %exit, label %if.end.i
+ br i1 %arg, label %exit, label %if.end.i
if.end.i:
- br i1 undef, label %exit, label %if.end8.i
+ br i1 %arg, label %exit, label %if.end8.i
if.end8.i:
br label %exit
diff --git a/llvm/test/Analysis/CycleInfo/unreachable-predecessor.ll b/llvm/test/Analysis/CycleInfo/unreachable-predecessor.ll
index 3655095ff6d827..17114de7d0f2d6 100644
--- a/llvm/test/Analysis/CycleInfo/unreachable-predecessor.ll
+++ b/llvm/test/Analysis/CycleInfo/unreachable-predecessor.ll
@@ -1,7 +1,7 @@
; RUN: opt < %s -disable-output -passes='verify<cycles>,print<cycles>' 2>&1 | FileCheck %s
; CHECK-LABEL: CycleInfo for function: unreachable
; CHECK: depth=1: entries(loop.body) loop.latch inner.block
-define void @unreachable(i32 %n) {
+define void @unreachable(i32 %n, i1 %arg) {
entry:
br label %loop.body
@@ -13,7 +13,7 @@ unreachable.block:
br label %inner.block
inner.block:
- br i1 undef, label %loop.exit, label %loop.latch
+ br i1 %arg, label %loop.exit, label %loop.latch
loop.latch:
br label %loop.body
diff --git a/llvm/test/Analysis/Delinearization/type_mismatch.ll b/llvm/test/Analysis/Delinearization/type_mismatch.ll
index c7c2c285a7307f..a9501519d03163 100644
--- a/llvm/test/Analysis/Delinearization/type_mismatch.ll
+++ b/llvm/test/Analysis/Delinearization/type_mismatch.ll
@@ -8,7 +8,7 @@
target datalayout = "e-m:e-p:32:32-i64:64-a:0-v32:32-n16:32"
-define fastcc void @test() {
+define fastcc void @test(i1 %arg) {
entry:
%0 = load i16, ptr undef, align 2
%conv21 = zext i16 %0 to i32
@@ -21,7 +21,7 @@ for.cond7.preheader:
for.body11:
%arrayidx.phi = phi ptr [ %p1.022, %for.cond7.preheader ], [ undef, %for.body11 ]
store i8 undef, ptr %arrayidx.phi, align 1
- br i1 undef, label %for.body11, label %for.end
+ br i1 %arg, label %for.body11, label %for.end
for.end:
%add.ptr = getelementptr inbounds i8, ptr %p1.022, i32 %conv21
diff --git a/llvm/test/Analysis/Delinearization/undef.ll b/llvm/test/Analysis/Delinearization/undef.ll
index 0e8dc5146c3e4e..1e62c4579c9c66 100644
--- a/llvm/test/Analysis/Delinearization/undef.ll
+++ b/llvm/test/Analysis/Delinearization/undef.ll
@@ -2,17 +2,17 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
-define void @foo(ptr %Ey) {
+define void @foo(ptr %Ey, i1 %arg) {
entry:
- br i1 undef, label %for.cond55.preheader, label %for.end324
+ br i1 %arg, label %for.cond55.preheader, label %for.end324
for.cond55.preheader:
%iz.069 = phi i64 [ %inc323, %for.inc322 ], [ 0, %entry ]
- br i1 undef, label %for.cond58.preheader, label %for.inc322
+ br i1 %arg, label %for.cond58.preheader, label %for.inc322
for.cond58.preheader:
%iy.067 = phi i64 [ %inc320, %for.end ], [ 0, %for.cond55.preheader ]
- br i1 undef, label %for.body60, label %for.end
+ br i1 %arg, label %for.body60, label %for.end
for.body60:
%ix.062 = phi i64 [ %inc, %for.body60 ], [ 0, %for.cond58.preheader ]
@@ -27,11 +27,11 @@ for.body60:
for.end:
%inc320 = add nsw i64 %iy.067, 1
- br i1 undef, label %for.cond58.preheader, label %for.inc322
+ br i1 %arg, label %for.cond58.preheader, label %for.inc322
for.inc322:
%inc323 = add nsw i64 %iz.069, 1
- br i1 undef, label %for.cond55.preheader, label %for.end324
+ br i1 %arg, label %for.cond55.preheader, label %for.end324
for.end324:
ret void
diff --git a/llvm/test/Analysis/DependenceAnalysis/MIVCheckConst.ll b/llvm/test/Analysis/DependenceAnalysis/MIVCheckConst.ll
index baa623d4b95540..e33dca9d89c825 100644
--- a/llvm/test/Analysis/DependenceAnalysis/MIVCheckConst.ll
+++ b/llvm/test/Analysis/DependenceAnalysis/MIVCheckConst.ll
@@ -29,21 +29,21 @@ target datalayout = "e-m:e-p:32:32-i1:32-i64:64-a:0-v32:32-n16:32"
%20 = type { [768 x i32] }
%21 = type { [416 x i32] }
-define void @test(ptr %A) #0 align 2 {
+define void @test(ptr %A, i1 %arg) #0 align 2 {
entry:
%v1 = load i32, ptr undef, align 4
br label %bb13
bb13:
%v2 = phi i32 [ undef, %entry ], [ %v39, %bb38 ]
- br i1 undef, label %bb15, label %bb38
+ br i1 %arg, label %bb15, label %bb38
bb15:
%v3 = mul nsw i32 %v2, undef
br label %bb17
bb17:
- br i1 undef, label %bb21, label %bb37
+ br i1 %arg, label %bb21, label %bb37
bb21:
%v22 = add nsw i32 undef, 1
@@ -55,10 +55,10 @@ bb21:
%v29 = mul nsw i32 %v28, 32
%v30 = getelementptr inbounds %1, ptr %A, i32 0, i32 7, i32 14, i32 %v29
%v32 = load <32 x i32>, ptr %v30, align 128
- br i1 undef, label %bb21, label %bb37
+ br i1 %arg, label %bb21, label %bb37
bb37:
- br i1 undef, label %bb17, label %bb38
+ br i1 %arg, label %bb17, label %bb38
bb38:
%v39 = add nsw i32 %v2, 1
diff --git a/llvm/test/Analysis/DependenceAnalysis/NonAffineExpr.ll b/llvm/test/Analysis/DependenceAnalysis/NonAffineExpr.ll
index b4b768b4be2edf..6837d451667b93 100644
--- a/llvm/test/Analysis/DependenceAnalysis/NonAffineExpr.ll
+++ b/llvm/test/Analysis/DependenceAnalysis/NonAffineExpr.ll
@@ -7,7 +7,7 @@
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n8:16:32-S64"
target triple = "thumbv7--linux-gnueabi"
-define void @f(ptr %a, i32 %n) align 2 {
+define void @f(ptr %a, i32 %n, i1 %arg) align 2 {
for.preheader:
%t.0 = ashr exact i32 %n, 3
br label %for.body.1
@@ -15,7 +15,7 @@ for.preheader:
for.body.1:
%i.1 = phi i32 [ %t.5, %for.inc ], [ 0, %for.preheader ]
%i.2 = phi i32 [ %i.5, %for.inc ], [ %t.0, %for.preheader ]
- br i1 undef, label %for.inc, label %for.body.2
+ br i1 %arg, label %for.inc, label %for.body.2
for.body.2:
%i.3 = phi i32 [ %t.1, %for.body.2 ], [ %i.1, %for.body.1 ]
@@ -23,13 +23,13 @@ for.body.2:
%t.2 = load ptr, ptr %a, align 4
%t.3 = getelementptr inbounds i32, ptr %t.2, i32 %i.3
%t.4 = load i32, ptr %t.3, align 4
- br i1 undef, label %for.inc, label %for.body.2
+ br i1 %arg, label %for.inc, label %for.body.2
for.inc:
%i.4 = phi i32 [ %i.2, %for.body.1 ], [ %i.2, %for.body.2 ]
%t.5 = add i32 %i.1, %i.4
%i.5 = add i32 %i.2, -1
- br i1 undef, label %for.exit, label %for.body.1
+ br i1 %arg, label %for.exit, label %for.body.1
for.exit:
ret void
diff --git a/llvm/test/Analysis/Dominators/basic.ll b/llvm/test/Analysis/Dominators/basic.ll
index 1ec45bbefcb075..7e04ae4d53bea7 100644
--- a/llvm/test/Analysis/Dominators/basic.ll
+++ b/llvm/test/Analysis/Dominators/basic.ll
@@ -1,6 +1,6 @@
; RUN: opt < %s -disable-output -passes='print<domtree>' 2>&1 | FileCheck %s
-define void @test1() {
+define void @test1(i1 %arg) {
; CHECK-LABEL: DominatorTree for function: test1
; CHECK: [1] %entry
; CHECK-NEXT: [2] %a
@@ -10,7 +10,7 @@ define void @test1() {
; CHECK-NEXT: [2] %b
entry:
- br i1 undef, label %a, label %b
+ br i1 %arg, label %a, label %b
a:
br label %c
@@ -19,7 +19,7 @@ b:
br label %c
c:
- br i1 undef, label %d, label %e
+ br i1 %arg, label %d, label %e
d:
ret void
@@ -28,7 +28,7 @@ e:
ret void
}
-define void @test2() {
+define void @test2(i1 %arg) {
; CHECK-LABEL: DominatorTree for function: test2
; CHECK: [1] %entry
; CHECK-NEXT: [2] %a
@@ -44,13 +44,13 @@ a:
br label %b
b:
- br i1 undef, label %a, label %c
+ br i1 %arg, label %a, label %c
c:
- br i1 undef, label %d, label %ret
+ br i1 %arg, label %d, label %ret
d:
- br i1 undef, label %a, label %ret
+ br i1 %arg, label %a, label %ret
ret:
ret void
diff --git a/llvm/test/Analysis/Dominators/print-dot-dom.ll b/llvm/test/Analysis/Dominators/print-dot-dom.ll
index f7d3ea9d0f52dd..4782c0201c0ae8 100644
--- a/llvm/test/Analysis/Dominators/print-dot-dom.ll
+++ b/llvm/test/Analysis/Dominators/print-dot-dom.ll
@@ -5,7 +5,7 @@
; RUN: FileCheck %s -input-file=dom.test1.dot -check-prefix=TEST1
; RUN: FileCheck %s -input-file=dom.test2.dot -check-prefix=TEST2
-define void @test1() {
+define void @test1(i1 %arg) {
; TEST1: digraph "Dominator tree for 'test1' function"
; TEST1-NEXT: label="Dominator tree for 'test1' function"
; TEST1: Node0x[[EntryID:.*]] [shape=record,label="{entry:
@@ -21,7 +21,7 @@ define void @test1() {
; TEST1-NEXT: Node0x[[B_ID]] [shape=record,label="{b:
entry:
- br i1 undef, label %a, label %b
+ br i1 %arg, label %a, label %b
a:
br label %c
@@ -30,7 +30,7 @@ b:
br label %c
c:
- br i1 undef, label %d, label %e
+ br i1 %arg, label %d, label %e
d:
ret void
@@ -39,7 +39,7 @@ e:
ret void
}
-define void @test2() {
+define void @test2(i1 %arg) {
; TEST2: digraph "Dominator tree for 'test2' function"
; TEST2-NEXT: label="Dominator tree for 'test2' function"
; TEST2: Node0x[[EntryID:.*]] [shape=record,label="{entry:
@@ -61,13 +61,13 @@ a:
br label %b
b:
- br i1 undef, label %a, label %c
+ br i1 %arg, label %a, label %c
c:
- br i1 undef, label %d, label %e
+ br i1 %arg, label %d, label %e
d:
- br i1 undef, label %a, label %e
+ br i1 %arg, label %a, label %e
e:
ret void
diff --git a/llvm/test/Analysis/MemoryDependenceAnalysis/invariant.group-bug.ll b/llvm/test/Analysis/MemoryDependenceAnalysis/invariant.group-bug.ll
index ac5bd9b852c515..c11191ee96d014 100644
--- a/llvm/test/Analysis/MemoryDependenceAnalysis/invariant.group-bug.ll
+++ b/llvm/test/Analysis/MemoryDependenceAnalysis/invariant.group-bug.ll
@@ -17,35 +17,37 @@ target triple = "x86_64-grtev4-linux-gnu"
%4 = type { ptr }
%5 = type { i64, [8 x i8] }
-define void @fail(ptr noalias sret(i1) %arg, ptr %arg1, ptr %arg2, ptr %arg3) local_unnamed_addr #0 {
+define void @fail(ptr noalias sret(i1) %arg, ptr %arg1, ptr %arg2, ptr %arg3, i1 %arg4) local_unnamed_addr #0 {
; CHECK-LABEL: @fail(
; CHECK-NEXT: bb:
-; CHECK-NEXT: [[I4:%.*]] = load ptr, ptr [[ARG1:%.*]], align 8, !invariant.group !6
+; CHECK-NEXT: [[I4:%.*]] = load ptr, ptr [[ARG1:%.*]], align 8, !invariant.group [[META6:![0-9]+]]
; CHECK-NEXT: [[I5:%.*]] = getelementptr inbounds ptr, ptr [[I4]], i64 6
-; CHECK-NEXT: [[I6:%.*]] = load ptr, ptr [[I5]], align 8, !invariant.load !6
+; CHECK-NEXT: [[I6:%.*]] = load ptr, ptr [[I5]], align 8, !invariant.load [[META6]]
; CHECK-NEXT: [[I7:%.*]] = tail call i64 [[I6]](ptr [[ARG1]]) #[[ATTR1:[0-9]+]]
; CHECK-NEXT: [[I9:%.*]] = load ptr, ptr [[ARG2:%.*]], align 8
; CHECK-NEXT: store i8 0, ptr [[I9]], align 1
-; CHECK-NEXT: br i1 undef, label [[BB10:%.*]], label [[BB29:%.*]]
+; CHECK-NEXT: br i1 [[ARG4:%.*]], label [[BB10:%.*]], label [[BB29:%.*]]
; CHECK: bb10:
; CHECK-NEXT: [[I14_PHI_TRANS_INSERT:%.*]] = getelementptr inbounds ptr, ptr [[I4]], i64 22
-; CHECK-NEXT: [[I15_PRE:%.*]] = load ptr, ptr [[I14_PHI_TRANS_INSERT]], align 8, !invariant.load !6
+; CHECK-NEXT: [[I15_PRE:%.*]] = load ptr, ptr [[I14_PHI_TRANS_INSERT]], align 8, !invariant.load [[META6]]
; CHECK-NEXT: br label [[BB12:%.*]]
; CHECK: bb12:
; CHECK-NEXT: [[I16:%.*]] = call i64 [[I15_PRE]](ptr nonnull [[ARG1]], ptr null, i64 0) #[[ATTR1]]
-; CHECK-NEXT: br i1 undef, label [[BB28:%.*]], label [[BB17:%.*]]
+; CHECK-NEXT: br i1 true, label [[BB28:%.*]], label [[BB17:%.*]]
; CHECK: bb17:
-; CHECK-NEXT: br i1 undef, label [[BB18:%.*]], label [[BB21:%.*]]
+; CHECK-NEXT: br i1 true, label [[BB18:%.*]], label [[BB21:%.*]]
; CHECK: bb18:
; CHECK-NEXT: br label [[BB28]]
; CHECK: bb21:
-; CHECK-NEXT: br i1 undef, label [[BB25:%.*]], label [[BB26:%.*]]
+; CHECK-NEXT: br i1 true, label [[BB25:%.*]], label [[BB26:%.*]]
; CHECK: bb25:
; CHECK-NEXT: br label [[BB28]]
; CHECK: bb26:
; CHECK-NEXT: br label [[BB28]]
; CHECK: bb28:
-; CHECK-NEXT: br i1 undef, label [[BB12]], label [[BB29]]
+; CHECK-NEXT: br i1 true, label [[BB12]], label [[BB28_BB29_CRIT_EDGE:%.*]]
+; CHECK: bb28.bb29_crit_edge:
+; CHECK-NEXT: br label [[BB29]]
; CHECK: bb29:
; CHECK-NEXT: ret void
;
@@ -56,7 +58,7 @@ bb:
%i7 = tail call i64 %i6(ptr %arg1) #1
%i9 = load ptr, ptr %arg2, align 8
store i8 0, ptr %i9, align 1
- br i1 undef, label %bb10, label %bb29
+ br i1 %arg4, label %bb10, label %bb29
bb10: ; preds = %bb
br label %bb12
@@ -66,10 +68,10 @@ bb12: ; preds = %bb28, %bb10
%i14 = getelementptr inbounds ptr, ptr %i13, i64 22
%i15 = load ptr, ptr %i14, align 8, !invariant.load !6
%i16 = call i64 %i15(ptr nonnull %arg1, ptr null, i64 0) #1
- br i1 undef, label %bb28, label %bb17
+ br i1 %arg4, label %bb28, label %bb17
bb17: ; preds = %bb12
- br i1 undef, label %bb18, label %bb21
+ br i1 %arg4, label %bb18, label %bb21
bb18: ; preds = %bb17
br label %bb19
@@ -90,7 +92,7 @@ bb23: ; preds = %bb22
br label %bb24
bb24: ; preds = %bb23
- br i1 undef, label %bb25, label %bb26
+ br i1 %arg4, label %bb25, label %bb26
bb25: ; preds = %bb24
br label %bb28
@@ -102,7 +104,7 @@ bb27: ; preds = %bb26
br label %bb28
bb28: ; preds = %bb27, %bb25, %bb20, %bb12
- br i1 undef, label %bb12, label %bb29
+ br i1 %arg4, label %bb12, label %bb29
bb29: ; preds = %bb28, %bb
ret void
diff --git a/llvm/test/Analysis/MemorySSA/cyclicphi.ll b/llvm/test/Analysis/MemorySSA/cyclicphi.ll
index 8a4ec1753fdc5a..a858107a9c51c4 100644
--- a/llvm/test/Analysis/MemorySSA/cyclicphi.ll
+++ b/llvm/test/Analysis/MemorySSA/cyclicphi.ll
@@ -3,15 +3,15 @@
%struct.hoge = type { i32, %struct.widget }
%struct.widget = type { i64 }
-define hidden void @quux(ptr %f) align 2 {
+define hidden void @quux(ptr %f, i1 %arg) align 2 {
%tmp = getelementptr inbounds %struct.hoge, ptr %f, i64 0, i32 1, i32 0
%tmp24 = getelementptr inbounds %struct.hoge, ptr %f, i64 0, i32 1
br label %bb26
bb26: ; preds = %bb77, %0
; CHECK: 3 = MemoryPhi({%0,liveOnEntry},{bb77,2})
-; CHECK-NEXT: br i1 undef, label %bb68, label %bb77
- br i1 undef, label %bb68, label %bb77
+; CHECK-NEXT: br i1 %arg, label %bb68, label %bb77
+ br i1 %arg, label %bb68, label %bb77
bb68: ; preds = %bb26
; CHECK: MemoryUse(liveOnEntry)
@@ -31,7 +31,7 @@ bb77: ; preds = %bb68, %bb26
br label %bb26
}
-define hidden void @quux_no_null_opt(ptr %f) align 2 #0 {
+define hidden void @quux_no_null_opt(ptr %f, i1 %arg) align 2 #0 {
; CHECK-LABEL: quux_no_null_opt(
%tmp = getelementptr inbounds %struct.hoge, ptr %f, i64 0, i32 1, i32 0
%tmp24 = getelementptr inbounds %struct.hoge, ptr %f, i64 0, i32 1
@@ -39,8 +39,8 @@ define hidden void @quux_no_null_opt(ptr %f) align 2 #0 {
bb26: ; preds = %bb77, %0
; CHECK: 3 = MemoryPhi({%0,liveOnEntry},{bb77,2})
-; CHECK-NEXT: br i1 undef, label %bb68, label %bb77
- br i1 undef, label %bb68, label %bb77
+; CHECK-NEXT: br i1 %arg, label %bb68, label %bb77
+ br i1 %arg, label %bb68, label %bb77
bb68: ; preds = %bb26
; CHECK: MemoryUse(3)
@@ -61,15 +61,15 @@ bb77: ; preds = %bb68, %bb26
}
; CHECK-LABEL: define void @quux_skip
-define void @quux_skip(ptr noalias %f, ptr noalias %g) align 2 {
+define void @quux_skip(ptr noalias %f, ptr noalias %g, i1 %arg) align 2 {
%tmp = getelementptr inbounds %struct.hoge, ptr %f, i64 0, i32 1, i32 0
%tmp24 = getelementptr inbounds %struct.hoge, ptr %f, i64 0, i32 1
br label %bb26
bb26: ; preds = %bb77, %0
; CHECK: 3 = MemoryPhi({%0,liveOnEntry},{bb77,2})
-; CHECK-NEXT: br i1 undef, label %bb68, label %bb77
- br i1 undef, label %bb68, label %bb77
+; CHECK-NEXT: br i1 %arg, label %bb68, label %bb77
+ br i1 %arg, label %bb68, label %bb77
bb68: ; preds = %bb26
; CHECK: MemoryUse(3)
@@ -89,7 +89,7 @@ bb77: ; preds = %bb68, %bb26
}
; CHECK-LABEL: define void @quux_dominated
-define void @quux_dominated(ptr noalias %f, ptr noalias %g) align 2 {
+define void @quux_dominated(ptr noalias %f, ptr noalias %g, i1 %arg) align 2 {
%tmp = getelementptr inbounds %struct.hoge, ptr %f, i64 0, i32 1, i32 0
%tmp24 = getelementptr inbounds %struct.hoge, ptr %f, i64 0, i32 1
br label %bb26
@@ -99,7 +99,7 @@ bb26: ; preds = %bb77, %0
; CHECK: MemoryUse(3)
; CHECK-NEXT: load ptr, ptr %tmp24, align 8
load ptr, ptr %tmp24, align 8
- br i1 undef, label %bb68, label %bb77
+ br i1 %arg, label %bb68, label %bb77
bb68: ; preds = %bb26
; CHECK: MemoryUse(3)
@@ -119,7 +119,7 @@ bb77: ; preds = %bb68, %bb26
}
; CHECK-LABEL: define void @quux_nodominate
-define void @quux_nodominate(ptr noalias %f, ptr noalias %g) align 2 {
+define void @quux_nodominate(ptr noalias %f, ptr noalias %g, i1 %arg) align 2 {
%tmp = getelementptr inbounds %struct.hoge, ptr %f, i64 0, i32 1, i32 0
%tmp24 = getelementptr inbounds %struct.hoge, ptr %f, i64 0, i32 1
br label %bb26
@@ -129,7 +129,7 @@ bb26: ; preds = %bb77, %0
; CHECK: MemoryUse(liveOnEntry)
; CHECK-NEXT: load ptr, ptr %tmp24, align 8
load ptr, ptr %tmp24, align 8
- br i1 undef, label %bb68, label %bb77
+ br i1 %arg, label %bb68, label %bb77
bb68: ; preds = %bb26
; CHECK: MemoryUse(3)
diff --git a/llvm/test/Analysis/MemorySSA/debugvalue.ll b/llvm/test/Analysis/MemorySSA/debugvalue.ll
index 81de8857c2c23d..1ba083fbcd59fa 100644
--- a/llvm/test/Analysis/MemorySSA/debugvalue.ll
+++ b/llvm/test/Analysis/MemorySSA/debugvalue.ll
@@ -2,14 +2,14 @@
; REQUIRES: asserts
; CHECK-LABEL: @f_w4_i2
-define void @f_w4_i2() {
+define void @f_w4_i2(i1 %arg) {
entry:
br label %for.cond
for.cond: ; preds = %for.body, %entry
%i.0 = phi i16 [ 0, %entry ], [ %inc, %for.body ]
call void @llvm.dbg.value(metadata i16 %i.0, metadata !32, metadata !DIExpression()), !dbg !31
- br i1 undef, label %for.body, label %for.cond.cleanup
+ br i1 %arg, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond
ret void
diff --git a/llvm/test/Analysis/MemorySSA/debugvalue2.ll b/llvm/test/Analysis/MemorySSA/debugvalue2.ll
index 4565e3f7bc560c..81784605025857 100644
--- a/llvm/test/Analysis/MemorySSA/debugvalue2.ll
+++ b/llvm/test/Analysis/MemorySSA/debugvalue2.ll
@@ -8,7 +8,7 @@ target triple = "x86_64-unknown-linux-gnu"
; CHECK-LABEL: @overflow_iter_var
; CHECK-NOT: MemoryDef
-define void @overflow_iter_var() !dbg !11 {
+define void @overflow_iter_var(i1 %arg) !dbg !11 {
entry:
call void @llvm.dbg.value(metadata i16 0, metadata !16, metadata !DIExpression()), !dbg !18
br label %for.cond
@@ -16,7 +16,7 @@ entry:
for.cond: ; preds = %for.body, %entry
call void @llvm.dbg.value(metadata i16 0, metadata !16, metadata !DIExpression()), !dbg !18
call void @llvm.dbg.value(metadata i16 undef, metadata !20, metadata !DIExpression()), !dbg !21
- br i1 undef, label %for.end, label %for.body
+ br i1 %arg, label %for.end, label %for.body
for.body: ; preds = %for.cond
%0 = load i16, ptr undef, align 1
diff --git a/llvm/test/Analysis/MemorySSA/forward-unreachable.ll b/llvm/test/Analysis/MemorySSA/forward-unreachable.ll
index aead6277a1fba9..cfc433359301da 100644
--- a/llvm/test/Analysis/MemorySSA/forward-unreachable.ll
+++ b/llvm/test/Analysis/MemorySSA/forward-unreachable.ll
@@ -1,9 +1,9 @@
; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
-define void @test() {
+define void @test(i1 %arg) {
entry:
- br i1 undef, label %split1, label %split2
+ br i1 %arg, label %split1, label %split2
split1:
store i16 undef, ptr undef, align 2
diff --git a/llvm/test/Analysis/MemorySSA/function-clobber.ll b/llvm/test/Analysis/MemorySSA/function-clobber.ll
index 53662b1930c34c..93e8715c7da60c 100644
--- a/llvm/test/Analysis/MemorySSA/function-clobber.ll
+++ b/llvm/test/Analysis/MemorySSA/function-clobber.ll
@@ -5,7 +5,7 @@
@g = external global i32
declare void @modifyG()
-define i32 @foo() {
+define i32 @foo(i1 %arg) {
; CHECK: MemoryUse(liveOnEntry)
; CHECK-NEXT: %1 = load i32
%1 = load i32, ptr @g
@@ -29,11 +29,11 @@ declare void @readEverything() readonly
declare void @clobberEverything()
; CHECK-LABEL: define void @bar
-define void @bar() {
+define void @bar(i1 %arg) {
; CHECK: 1 = MemoryDef(liveOnEntry)
; CHECK-NEXT: call void @clobberEverything()
call void @clobberEverything()
- br i1 undef, label %if.end, label %if.then
+ br i1 %arg, label %if.end, label %if.then
if.then:
; CHECK: MemoryUse(1)
diff --git a/llvm/test/Analysis/MemorySSA/invariant-groups.ll b/llvm/test/Analysis/MemorySSA/invariant-groups.ll
index 8d1ec5226be5ef..2042855af5569e 100644
--- a/llvm/test/Analysis/MemorySSA/invariant-groups.ll
+++ b/llvm/test/Analysis/MemorySSA/invariant-groups.ll
@@ -195,7 +195,7 @@ Ret:
}
; CHECK-LABEL: define {{.*}} @loop2(
-define i8 @loop2(ptr %p) {
+define i8 @loop2(ptr %p, i1 %arg) {
entry:
; CHECK: 1 = MemoryDef(liveOnEntry)
; CHECK-NEXT: store i8
@@ -207,7 +207,7 @@ entry:
; CHECK: 3 = MemoryDef(2)
; CHECK-NEXT: %after = call ptr @llvm.launder.invariant.group.p0(ptr %p)
%after = call ptr @llvm.launder.invariant.group.p0(ptr %p)
- br i1 undef, label %Loop.Body, label %Loop.End
+ br i1 %arg, label %Loop.Body, label %Loop.End
Loop.Body:
; CHECK: MemoryUse(6)
@@ -221,7 +221,7 @@ Loop.Body:
; CHECK: 4 = MemoryDef(6)
store i8 4, ptr %after, !invariant.group !0
- br i1 undef, label %Loop.End, label %Loop.Body
+ br i1 %arg, label %Loop.End, label %Loop.Body
Loop.End:
; CHECK: MemoryUse(5)
@@ -231,7 +231,7 @@ Loop.End:
; CHECK: MemoryUse(5) {{.*}} clobbered by 1
; CHECK-NEXT: %3 = load
%3 = load i8, ptr %p, align 4, !invariant.group !0
- br i1 undef, label %Ret, label %Loop.Body
+ br i1 %arg, label %Ret, label %Loop.Body
Ret:
ret i8 %3
@@ -239,7 +239,7 @@ Ret:
; CHECK-LABEL: define {{.*}} @loop3(
-define i8 @loop3(ptr %p) {
+define i8 @loop3(ptr %p, i1 %arg) {
entry:
; CHECK: 1 = MemoryDef(liveOnEntry)
; CHECK-NEXT: store i8
@@ -251,7 +251,7 @@ entry:
; CHECK: 3 = MemoryDef(2)
; CHECK-NEXT: %after = call ptr @llvm.launder.invariant.group.p0(ptr %p)
%after = call ptr @llvm.launder.invariant.group.p0(ptr %p)
- br i1 undef, label %Loop.Body, label %Loop.End
+ br i1 %arg, label %Loop.Body, label %Loop.End
Loop.Body:
; CHECK: MemoryUse(8)
@@ -266,7 +266,7 @@ Loop.Body:
; CHECK-NEXT: %1 = load i8
%1 = load i8, ptr %after, !invariant.group !0
- br i1 undef, label %Loop.next, label %Loop.Body
+ br i1 %arg, label %Loop.next, label %Loop.Body
Loop.next:
; CHECK: 5 = MemoryDef(4)
; CHECK-NEXT: call void @clobber8
@@ -276,7 +276,7 @@ Loop.next:
; CHECK-NEXT: %2 = load i8
%2 = load i8, ptr %after, !invariant.group !0
- br i1 undef, label %Loop.End, label %Loop.Body
+ br i1 %arg, label %Loop.End, label %Loop.Body
Loop.End:
; CHECK: MemoryUse(7)
@@ -290,14 +290,14 @@ Loop.End:
; CHECK: MemoryUse(6) {{.*}} clobbered by 7
; CHECK-NEXT: %4 = load
%4 = load i8, ptr %after, align 4, !invariant.group !0
- br i1 undef, label %Ret, label %Loop.Body
+ br i1 %arg, label %Ret, label %Loop.Body
Ret:
ret i8 %3
}
; CHECK-LABEL: define {{.*}} @loop4(
-define i8 @loop4(ptr %p) {
+define i8 @loop4(ptr %p, i1 %arg) {
entry:
; CHECK: 1 = MemoryDef(liveOnEntry)
; CHECK-NEXT: store i8
@@ -308,7 +308,7 @@ entry:
; CHECK: 3 = MemoryDef(2)
; CHECK-NEXT: %after = call ptr @llvm.launder.invariant.group.p0(ptr %p)
%after = call ptr @llvm.launder.invariant.group.p0(ptr %p)
- br i1 undef, label %Loop.Pre, label %Loop.End
+ br i1 %arg, label %Loop.Pre, label %Loop.End
Loop.Pre:
; CHECK: MemoryUse(2)
@@ -326,7 +326,7 @@ Loop.Body:
; CHECK: 4 = MemoryDef(6)
store i8 4, ptr %after, !invariant.group !0
- br i1 undef, label %Loop.End, label %Loop.Body
+ br i1 %arg, label %Loop.End, label %Loop.Body
Loop.End:
; CHECK: MemoryUse(5)
@@ -336,7 +336,7 @@ Loop.End:
; CHECK: MemoryUse(5) {{.*}} clobbered by 1
; CHECK-NEXT: %4 = load
%4 = load i8, ptr %p, align 4, !invariant.group !0
- br i1 undef, label %Ret, label %Loop.Body
+ br i1 %arg, label %Ret, label %Loop.Body
Ret:
ret i8 %3
diff --git a/llvm/test/Analysis/MemorySSA/loop-rotate-disablebasicaa.ll b/llvm/test/Analysis/MemorySSA/loop-rotate-disablebasicaa.ll
index dcf83d2fe280d4..34819f1b96af78 100644
--- a/llvm/test/Analysis/MemorySSA/loop-rotate-disablebasicaa.ll
+++ b/llvm/test/Analysis/MemorySSA/loop-rotate-disablebasicaa.ll
@@ -5,13 +5,13 @@
; CHECK-LABEL: @main
; CHECK-NOT: MemoryDef
-define void @main() {
+define void @main(i1 %arg) {
entry:
br label %for.cond120
for.cond120: ; preds = %for.body127, %entry
- call void @foo()
- br i1 undef, label %for.body127, label %for.cond.cleanup126
+ call void @foo(i1 %arg)
+ br i1 %arg, label %for.body127, label %for.cond.cleanup126
for.cond.cleanup126: ; preds = %for.cond120
unreachable
diff --git a/llvm/test/Analysis/MemorySSA/loop-rotate-simplified-clone.ll b/llvm/test/Analysis/MemorySSA/loop-rotate-simplified-clone.ll
index 343c74c96f1dd1..0176fc6f83573f 100644
--- a/llvm/test/Analysis/MemorySSA/loop-rotate-simplified-clone.ll
+++ b/llvm/test/Analysis/MemorySSA/loop-rotate-simplified-clone.ll
@@ -1,8 +1,8 @@
; RUN: opt -verify-memoryssa -passes=loop-rotate %s -S | FileCheck %s
; REQUIRES: asserts
-; CHECK-LABEL: @test()
-define dso_local void @test() {
+; CHECK-LABEL: @test(i1 %arg)
+define dso_local void @test(i1 %arg) {
entry:
br label %preheader
@@ -13,7 +13,7 @@ l39:
%v40 = phi ptr [ @foo, %preheader ], [ %v43, %crit_edge ]
%v41 = call float %v40(float undef)
%v42 = load i32, ptr undef, align 8
- br i1 undef, label %crit_edge, label %loopexit
+ br i1 %arg, label %crit_edge, label %loopexit
crit_edge:
%v43 = load ptr, ptr undef, align 8
diff --git a/llvm/test/Analysis/MemorySSA/loop-rotate-valuemap.ll b/llvm/test/Analysis/MemorySSA/loop-rotate-valuemap.ll
index 1a0448058cca60..25adfbf974f7c9 100644
--- a/llvm/test/Analysis/MemorySSA/loop-rotate-valuemap.ll
+++ b/llvm/test/Analysis/MemorySSA/loop-rotate-valuemap.ll
@@ -5,7 +5,7 @@
; otherwise, MemorySSA will assert.
; CHECK-LABEL: @f
-define void @f() {
+define void @f(i1 %arg) {
entry:
br label %for.body16
@@ -15,7 +15,7 @@ for.cond.cleanup15: ; preds = %for.body16
for.body16: ; preds = %for.body16.for.body16_crit_edge, %entry
%call.i = tail call float @expf(float 0.000000e+00) #1
%0 = load ptr, ptr undef, align 8
- br i1 undef, label %for.cond.cleanup15, label %for.body16.for.body16_crit_edge
+ br i1 %arg, label %for.cond.cleanup15, label %for.body16.for.body16_crit_edge
for.body16.for.body16_crit_edge: ; preds = %for.body16
%.pre = load float, ptr undef, align 8
diff --git a/llvm/test/Analysis/MemorySSA/phi-translation.ll b/llvm/test/Analysis/MemorySSA/phi-translation.ll
index 3fa9691ea95daf..b8244818c6e15f 100644
--- a/llvm/test/Analysis/MemorySSA/phi-translation.ll
+++ b/llvm/test/Analysis/MemorySSA/phi-translation.ll
@@ -73,7 +73,7 @@ phi.1:
}
; CHECK-LABEL: define void @cross_phi
-define void @cross_phi(ptr noalias %p1, ptr noalias %p2) {
+define void @cross_phi(ptr noalias %p1, ptr noalias %p2, i1 %arg) {
; CHECK: 1 = MemoryDef(liveOnEntry)
; CHECK-NEXT: store i8 0, ptr %p1
store i8 0, ptr %p1
@@ -82,19 +82,19 @@ define void @cross_phi(ptr noalias %p1, ptr noalias %p2) {
; LIMIT: MemoryUse(1)
; LIMIT-NEXT: load i8, ptr %p1
load i8, ptr %p1
- br i1 undef, label %a, label %b
+ br i1 %arg, label %a, label %b
a:
; CHECK: 2 = MemoryDef(1)
; CHECK-NEXT: store i8 0, ptr %p2
store i8 0, ptr %p2
- br i1 undef, label %c, label %d
+ br i1 %arg, label %c, label %d
b:
; CHECK: 3 = MemoryDef(1)
; CHECK-NEXT: store i8 1, ptr %p2
store i8 1, ptr %p2
- br i1 undef, label %c, label %d
+ br i1 %arg, label %c, label %d
c:
; CHECK: 6 = MemoryPhi({a,2},{b,3})
@@ -121,7 +121,7 @@ e:
}
; CHECK-LABEL: define void @looped
-define void @looped(ptr noalias %p1, ptr noalias %p2) {
+define void @looped(ptr noalias %p1, ptr noalias %p2, i1 %arg) {
; CHECK: 1 = MemoryDef(liveOnEntry)
; CHECK-NEXT: store i8 0, ptr %p1
store i8 0, ptr %p1
@@ -132,7 +132,7 @@ loop.1:
; CHECK: 2 = MemoryDef(6)
; CHECK-NEXT: store i8 0, ptr %p2
store i8 0, ptr %p2
- br i1 undef, label %loop.2, label %loop.3
+ br i1 %arg, label %loop.2, label %loop.3
loop.2:
; CHECK: 5 = MemoryPhi({loop.1,2},{loop.3,4})
@@ -151,23 +151,23 @@ loop.3:
; LIMIT: MemoryUse(4)
; LIMIT-NEXT: load i8, ptr %p1
load i8, ptr %p1
- br i1 undef, label %loop.2, label %loop.1
+ br i1 %arg, label %loop.2, label %loop.1
}
; CHECK-LABEL: define void @looped_visitedonlyonce
-define void @looped_visitedonlyonce(ptr noalias %p1, ptr noalias %p2) {
+define void @looped_visitedonlyonce(ptr noalias %p1, ptr noalias %p2, i1 %arg) {
br label %while.cond
while.cond:
; CHECK: 5 = MemoryPhi({%0,liveOnEntry},{if.end,3})
-; CHECK-NEXT: br i1 undef, label %if.then, label %if.end
- br i1 undef, label %if.then, label %if.end
+; CHECK-NEXT: br i1 %arg, label %if.then, label %if.end
+ br i1 %arg, label %if.then, label %if.end
if.then:
; CHECK: 1 = MemoryDef(5)
; CHECK-NEXT: store i8 0, ptr %p1
store i8 0, ptr %p1
- br i1 undef, label %if.end, label %if.then2
+ br i1 %arg, label %if.end, label %if.then2
if.then2:
; CHECK: 2 = MemoryDef(1)
diff --git a/llvm/test/Analysis/MemorySSA/pr28880.ll b/llvm/test/Analysis/MemorySSA/pr28880.ll
index 57cdab79204042..98f326180e8578 100644
--- a/llvm/test/Analysis/MemorySSA/pr28880.ll
+++ b/llvm/test/Analysis/MemorySSA/pr28880.ll
@@ -8,9 +8,9 @@
@global.1 = external hidden unnamed_addr global double, align 8
; Function Attrs: nounwind ssp uwtable
-define hidden fastcc void @hoge() unnamed_addr #0 {
+define hidden fastcc void @hoge(i1 %arg) unnamed_addr #0 {
bb:
- br i1 undef, label %bb1, label %bb2
+ br i1 %arg, label %bb1, label %bb2
bb1: ; preds = %bb
; These accesses should not conflict.
@@ -28,7 +28,7 @@ bb2: ; preds = %bb
br label %bb3
bb3: ; preds = %bb2
- br i1 undef, label %bb4, label %bb6
+ br i1 %arg, label %bb4, label %bb6
bb4: ; preds = %bb3
; These accesses should conflict.
diff --git a/llvm/test/Analysis/MemorySSA/pr40749_2.ll b/llvm/test/Analysis/MemorySSA/pr40749_2.ll
index 8bfef3f200e621..0fa45534f9c60e 100644
--- a/llvm/test/Analysis/MemorySSA/pr40749_2.ll
+++ b/llvm/test/Analysis/MemorySSA/pr40749_2.ll
@@ -7,7 +7,7 @@ target triple = "s390x-ibm-linux"
@g_993 = external dso_local local_unnamed_addr global i32, align 4
; CHECK-LABEL: @ff6
-define dso_local fastcc void @ff6(i16 %arg1) unnamed_addr #0 {
+define dso_local fastcc void @ff6(i16 %arg1, i1 %arg2) unnamed_addr #0 {
bb:
%tmp6.i = icmp sgt i16 %arg1, 0
br label %bb10
@@ -50,7 +50,7 @@ bb67: ; preds = %bb27
br label %bb75
bb75: ; preds = %bb67, %bb67.us.loopexit
- br i1 undef, label %bb24.preheader, label %bb84.loopexit
+ br i1 %arg2, label %bb24.preheader, label %bb84.loopexit
bb81.loopexit: ; preds = %bb61.us
br label %bb10
diff --git a/llvm/test/Analysis/MemorySSA/pr41640.ll b/llvm/test/Analysis/MemorySSA/pr41640.ll
index 6c407a518edcd5..18dd83bec3ff8c 100644
--- a/llvm/test/Analysis/MemorySSA/pr41640.ll
+++ b/llvm/test/Analysis/MemorySSA/pr41640.ll
@@ -6,47 +6,47 @@ target triple = "s390x-ibm-linux"
@g_976 = external dso_local global i64, align 8
@g_1087 = external dso_local global ptr, align 8
-; CHECK-LABEL: @f1()
+; CHECK-LABEL: @f1(i1 %arg)
; CHECK: 5 = MemoryPhi(
; CHECK-NOT: 7 = MemoryPhi(
-define dso_local fastcc void @f1() unnamed_addr #0 {
+define dso_local fastcc void @f1(i1 %arg) unnamed_addr #0 {
label0:
- br i1 undef, label %thread-pre-split.i.preheader, label %label5
+ br i1 %arg, label %thread-pre-split.i.preheader, label %label5
thread-pre-split.i.preheader: ; preds = %label0
br label %thread-pre-split.i
thread-pre-split.i.us: ; preds = %.critedge1.i.us
- br i1 undef, label %.preheader.i.us.preheader, label %label2
+ br i1 %arg, label %.preheader.i.us.preheader, label %label2
.preheader.i.us.preheader: ; preds = %thread-pre-split.i.us
br label %.preheader.i.us
.preheader.i.us: ; preds = %._crit_edge.i.us, %.preheader.i.us.preheader
- br i1 undef, label %.lr.ph.i.us, label %._crit_edge.i.us
+ br i1 %arg, label %.lr.ph.i.us, label %._crit_edge.i.us
.lr.ph.i.us: ; preds = %.preheader.i.us
br label %label1
label1: ; preds = %label1, %.lr.ph.i.us
- br i1 undef, label %label1, label %._crit_edge.i.us
+ br i1 %arg, label %label1, label %._crit_edge.i.us
._crit_edge.i.us: ; preds = %label1, %.preheader.i.us
- br i1 undef, label %.preheader.i.us, label %._crit_edge5.i.us
+ br i1 %arg, label %.preheader.i.us, label %._crit_edge5.i.us
._crit_edge5.i.us: ; preds = %._crit_edge.i.us
br label %label2
label2: ; preds = %._crit_edge5.i.us, %thread-pre-split.i.us
tail call void @foo16()
- br i1 undef, label %.lr.ph8.i.us.preheader, label %label4
+ br i1 %arg, label %.lr.ph8.i.us.preheader, label %label4
.lr.ph8.i.us.preheader: ; preds = %label2
br label %.lr.ph8.i.us
.lr.ph8.i.us: ; preds = %.lr.ph8.i.us, %.lr.ph8.i.us.preheader
%tmp3 = load volatile i64, ptr @g_976, align 8
- br i1 undef, label %.lr.ph8.i.us, label %._crit_edge9.i.us
+ br i1 %arg, label %.lr.ph8.i.us, label %._crit_edge9.i.us
._crit_edge9.i.us: ; preds = %.lr.ph8.i.us
br label %label4
@@ -55,31 +55,31 @@ label4: ; preds = %._crit_edge9.i.us, %labe
br i1 true, label %f9.exit, label %.critedge1.i.us
.critedge1.i.us: ; preds = %label4
- br i1 undef, label %thread-pre-split.i.us, label %f9.exit
+ br i1 %arg, label %thread-pre-split.i.us, label %f9.exit
label5: ; preds = %label0
unreachable
thread-pre-split.i: ; preds = %.critedge1.i, %thread-pre-split.i.preheader
- br i1 undef, label %.preheader.i.preheader, label %.critedge1.i
+ br i1 %arg, label %.preheader.i.preheader, label %.critedge1.i
.preheader.i.preheader: ; preds = %thread-pre-split.i
br label %.preheader.i
.preheader.i: ; preds = %._crit_edge.i, %.preheader.i.preheader
- br i1 undef, label %.lr.ph.i, label %._crit_edge.i
+ br i1 %arg, label %.lr.ph.i, label %._crit_edge.i
.lr.ph.i: ; preds = %.preheader.i
br label %label6
label6: ; preds = %label6, %.lr.ph.i
- br i1 undef, label %label6, label %._crit_edge.i.loopexit
+ br i1 %arg, label %label6, label %._crit_edge.i.loopexit
._crit_edge.i.loopexit: ; preds = %label6
br label %._crit_edge.i
._crit_edge.i: ; preds = %._crit_edge.i.loopexit, %.preheader.i
- br i1 undef, label %.preheader.i, label %._crit_edge5.i
+ br i1 %arg, label %.preheader.i, label %._crit_edge5.i
._crit_edge5.i: ; preds = %._crit_edge.i
br label %.critedge1.i
@@ -88,7 +88,7 @@ label6: ; preds = %label6, %.lr.ph.i
%tmp7 = load i32, ptr @g_248, align 4
%tmp8 = xor i32 %tmp7, 55987
store i32 %tmp8, ptr @g_248, align 4
- br i1 undef, label %thread-pre-split.i, label %f9.exit.loopexit
+ br i1 %arg, label %thread-pre-split.i, label %f9.exit.loopexit
f9.exit.loopexit: ; preds = %.critedge1.i
br label %f9.exit
diff --git a/llvm/test/Analysis/MemorySSA/pr41853.ll b/llvm/test/Analysis/MemorySSA/pr41853.ll
index 6b88e80c7b4565..39e88fb8a1eb66 100644
--- a/llvm/test/Analysis/MemorySSA/pr41853.ll
+++ b/llvm/test/Analysis/MemorySSA/pr41853.ll
@@ -2,13 +2,13 @@
; REQUIRES: asserts
target triple = "x86_64-unknown-linux-gnu"
-; CHECK-LABEL: @func()
-define void @func() {
- br i1 undef, label %bb5, label %bb3
+; CHECK-LABEL: @func(i1 %arg)
+define void @func(i1 %arg) {
+ br i1 %arg, label %bb5, label %bb3
bb5: ; preds = %bb5, %0
store i16 undef, ptr undef
- br i1 undef, label %bb5, label %bb3
+ br i1 %arg, label %bb5, label %bb3
bb3: ; preds = %bb5, %0
ret void
diff --git a/llvm/test/Analysis/MemorySSA/pr42940.ll b/llvm/test/Analysis/MemorySSA/pr42940.ll
index f7425b38c7ee54..382ba7dfb26b33 100644
--- a/llvm/test/Analysis/MemorySSA/pr42940.ll
+++ b/llvm/test/Analysis/MemorySSA/pr42940.ll
@@ -6,8 +6,8 @@ target triple = "s390x-ibm-linux"
@g_77 = external dso_local global i16, align 2
-; CHECK-LABEL: @f1()
-define void @f1() {
+; CHECK-LABEL: @f1(i1 %arg)
+define void @f1(i1 %arg) {
entry:
store i16 undef, ptr @g_77, align 2
br label %loop_pre
@@ -20,14 +20,14 @@ loop_pre:
for.cond.header:
store i32 0, ptr undef, align 4
- br i1 undef, label %for.body, label %for.end
+ br i1 %arg, label %for.body, label %for.end
for.body:
%tmp1 = load volatile i16, ptr undef, align 2
br label %for.end
for.end:
- br i1 undef, label %func.exit, label %for.cond.header
+ br i1 %arg, label %func.exit, label %for.cond.header
func.exit:
ret void
@@ -35,8 +35,8 @@ func.exit:
@g_159 = external dso_local global i32, align 4
-; CHECK-LABEL: @f2()
-define void @f2() {
+; CHECK-LABEL: @f2(i1 %arg)
+define void @f2(i1 %arg) {
entry:
br label %for.header.first
@@ -45,10 +45,10 @@ for.header.first:
for.body.first:
store i32 0, ptr @g_159, align 4
- br i1 undef, label %for.body.first, label %for.end.first
+ br i1 %arg, label %for.body.first, label %for.end.first
for.end.first:
- br i1 undef, label %lor.end, label %for.header.first
+ br i1 %arg, label %lor.end, label %for.header.first
lor.end:
br label %for.pre
@@ -67,14 +67,14 @@ for.header.second:
@g_271 = external dso_local global i8, align 2
@g_427 = external dso_local unnamed_addr global [9 x i16], align 2
-; CHECK-LABEL: @f3()
-define void @f3() {
+; CHECK-LABEL: @f3(i1 %arg)
+define void @f3(i1 %arg) {
entry:
br label %for.preheader
for.preheader:
store volatile i8 undef, ptr @g_271, align 2
- br i1 undef, label %for.preheader, label %for.end
+ br i1 %arg, label %for.preheader, label %for.end
for.end:
br label %lbl_1058.i
@@ -91,7 +91,7 @@ for.cond3.preheader.i:
%cmp621.i130 = icmp ugt i32 undef, %conv620.i129
%conv622.i131 = zext i1 %cmp621.i130 to i32
store i32 %conv622.i131, ptr undef, align 4
- br i1 undef, label %func.exit, label %for.cond3.preheader.i
+ br i1 %arg, label %func.exit, label %for.cond3.preheader.i
func.exit:
ret void
@@ -101,17 +101,17 @@ func.exit:
@g_244 = external dso_local global i64, align 8
@g_1164 = external dso_local global i64, align 8
-; CHECK-LABEL: @f4()
-define void @f4() {
+; CHECK-LABEL: @f4(i1 %arg)
+define void @f4(i1 %arg) {
entry:
br label %for.cond8.preheader
for.cond8.preheader:
store i32 0, ptr getelementptr inbounds ([3 x i32], ptr @g_6, i64 0, i64 2), align 4
- br i1 undef, label %if.end, label %for.cond8.preheader
+ br i1 %arg, label %if.end, label %for.cond8.preheader
if.end:
- br i1 undef, label %cleanup1270, label %for.cond504.preheader
+ br i1 %arg, label %cleanup1270, label %for.cond504.preheader
for.cond504.preheader:
store i64 undef, ptr @g_244, align 8
@@ -119,7 +119,7 @@ for.cond504.preheader:
for.cond559.preheader:
store i64 undef, ptr @g_1164, align 8
- br i1 undef, label %for.cond559.preheader, label %cleanup1270
+ br i1 %arg, label %for.cond559.preheader, label %cleanup1270
cleanup1270:
ret void
@@ -127,7 +127,7 @@ cleanup1270:
@g_1504 = external dso_local local_unnamed_addr global ptr, align 8
-define void @f5() {
+define void @f5(i1 %arg) {
bb:
tail call fastcc void @f21()
br label %bb12.outer
@@ -136,7 +136,7 @@ bb12.outer.loopexit: ; No predecessors!
br label %bb12.outer
bb12.outer: ; preds = %bb12.outer.loopexit, %bb
- br i1 undef, label %bb12.outer.split.us, label %bb12.preheader
+ br i1 %arg, label %bb12.outer.split.us, label %bb12.preheader
bb12.preheader: ; preds = %bb12.outer
br label %bb12
@@ -148,16 +148,16 @@ bb16.us.us: ; preds = %bb16.us.us, %bb12.o
br label %bb16.us.us
bb12: ; preds = %bb77.1, %bb12.preheader
- br i1 undef, label %bb25.preheader, label %bb77
+ br i1 %arg, label %bb25.preheader, label %bb77
bb25.preheader: ; preds = %bb12.1, %bb12
br label %bb25
bb25: ; preds = %l0, %bb25.preheader
- br i1 undef, label %bb62, label %bb71.thread
+ br i1 %arg, label %bb62, label %bb71.thread
bb62: ; preds = %bb25
- br i1 undef, label %bb92.loopexit, label %l0
+ br i1 %arg, label %bb92.loopexit, label %l0
l0: ; preds = %bb62
br label %bb25
@@ -168,7 +168,7 @@ bb71.thread: ; preds = %bb25
bb77: ; preds = %bb12
%tmp78 = load ptr, ptr @g_1504, align 8
%tmp79 = load volatile ptr, ptr %tmp78, align 8
- br i1 undef, label %bb91, label %bb12.1
+ br i1 %arg, label %bb91, label %bb12.1
bb91: ; preds = %bb77.1, %bb77
unreachable
@@ -180,10 +180,10 @@ bb92: ; preds = %bb92.loopexit, %bb7
ret void
bb12.1: ; preds = %bb77
- br i1 undef, label %bb25.preheader, label %bb77.1
+ br i1 %arg, label %bb25.preheader, label %bb77.1
bb77.1: ; preds = %bb12.1
- br i1 undef, label %bb91, label %bb12
+ br i1 %arg, label %bb91, label %bb12
}
declare void @f21()
diff --git a/llvm/test/Analysis/MemorySSA/pr43317.ll b/llvm/test/Analysis/MemorySSA/pr43317.ll
index a95079e8828b47..b6bccea1d93033 100644
--- a/llvm/test/Analysis/MemorySSA/pr43317.ll
+++ b/llvm/test/Analysis/MemorySSA/pr43317.ll
@@ -3,15 +3,15 @@
@v_295 = external dso_local global i16, align 1
@v_335 = external dso_local global i32, align 1
-; CHECK-LABEL: @main()
+; CHECK-LABEL: @main(i1 %arg)
; CHECK-NOT: 5 = MemoryPhi(
; CHECK-NOT: 6 = MemoryPhi(
; CHECK: 4 = MemoryPhi(
; CHECK-NOT: 7 = MemoryPhi(
-define dso_local void @main() {
+define dso_local void @main(i1 %arg) {
entry:
store i32 undef, ptr @v_335, align 1
- br i1 undef, label %gate, label %exit
+ br i1 %arg, label %gate, label %exit
nopredentry1: ; No predecessors!
br label %preinfiniteloop
@@ -20,7 +20,7 @@ nopredentry2: ; No predecessors!
br label %gate
gate: ; preds = %nopredentry2, %entry
- br i1 undef, label %preinfiniteloop, label %exit
+ br i1 %arg, label %preinfiniteloop, label %exit
preinfiniteloop: ; preds = %gate, %nopredentry1
br label %infiniteloop
diff --git a/llvm/test/Analysis/MemorySSA/pr43320.ll b/llvm/test/Analysis/MemorySSA/pr43320.ll
index dd62b6afde83b3..23ba8b8a955f82 100644
--- a/llvm/test/Analysis/MemorySSA/pr43320.ll
+++ b/llvm/test/Analysis/MemorySSA/pr43320.ll
@@ -4,8 +4,8 @@
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
target triple = "aarch64"
-; CHECK-LABEL: @e()
-define void @e() {
+; CHECK-LABEL: @e(i1 %arg)
+define void @e(i1 %arg) {
entry:
br label %g
@@ -13,16 +13,16 @@ g: ; preds = %cleanup, %entry
%0 = load i32, ptr null, align 4
%and = and i32 %0, undef
store i32 %and, ptr null, align 4
- br i1 undef, label %if.end8, label %if.then
+ br i1 %arg, label %if.end8, label %if.then
if.then: ; preds = %g
- br i1 undef, label %k, label %cleanup
+ br i1 %arg, label %k, label %cleanup
k: ; preds = %if.end8, %if.then
- br i1 undef, label %if.end8, label %cleanup
+ br i1 %arg, label %if.end8, label %cleanup
if.end8: ; preds = %k, %g
- br i1 undef, label %for.cond.preheader, label %k
+ br i1 %arg, label %for.cond.preheader, label %k
for.cond.preheader: ; preds = %if.end8
unreachable
diff --git a/llvm/test/Analysis/MemorySSA/pr43427.ll b/llvm/test/Analysis/MemorySSA/pr43427.ll
index 18d87251e1067c..a9b442c735b60f 100644
--- a/llvm/test/Analysis/MemorySSA/pr43427.ll
+++ b/llvm/test/Analysis/MemorySSA/pr43427.ll
@@ -1,15 +1,15 @@
; RUN: opt -disable-output -aa-pipeline=basic-aa -passes='loop-mssa(licm),print<memoryssa>' < %s 2>&1 | FileCheck %s
-; CHECK-LABEL: @f()
+; CHECK-LABEL: @f(i1 %arg)
; CHECK: lbl1:
; CHECK-NEXT: ; [[NO4:.*]] = MemoryPhi({entry,liveOnEntry},{lbl1.backedge,[[NO9:.*]]})
; CHECK-NEXT: ; [[NO2:.*]] = MemoryDef([[NO4]])
; CHECK-NEXT: call void @g()
-; CHECK-NEXT: br i1 undef, label %for.end, label %if.else
+; CHECK-NEXT: br i1 %arg, label %for.end, label %if.else
; CHECK: for.end:
-; CHECK-NEXT: br i1 undef, label %lbl3, label %lbl2
+; CHECK-NEXT: br i1 %arg, label %lbl3, label %lbl2
; CHECK: lbl2:
; CHECK-NEXT: ; [[NO8:.*]] = MemoryPhi({lbl3,[[NO7:.*]]},{for.end,[[NO2]]})
@@ -32,7 +32,7 @@
; CHECK-NEXT: 3 = MemoryDef([[NO6]])
; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 1, ptr null)
-define void @f() {
+define void @f(i1 %arg) {
entry:
%e = alloca i16, align 1
br label %lbl1
@@ -40,16 +40,16 @@ entry:
lbl1: ; preds = %if.else, %cleanup, %entry
store i16 undef, ptr %e, align 1
call void @g()
- br i1 undef, label %for.end, label %if.else
+ br i1 %arg, label %for.end, label %if.else
for.end: ; preds = %lbl1
- br i1 undef, label %lbl3, label %lbl2
+ br i1 %arg, label %lbl3, label %lbl2
lbl2: ; preds = %lbl3, %for.end
br label %lbl3
lbl3: ; preds = %lbl2, %for.end
- br i1 undef, label %lbl2, label %cleanup
+ br i1 %arg, label %lbl2, label %cleanup
cleanup: ; preds = %lbl3
%cleanup.dest = load i32, ptr undef, align 1
diff --git a/llvm/test/Analysis/MemorySSA/pr43438.ll b/llvm/test/Analysis/MemorySSA/pr43438.ll
index 30f6c2f2fadbba..d137c52e3e0ff8 100644
--- a/llvm/test/Analysis/MemorySSA/pr43438.ll
+++ b/llvm/test/Analysis/MemorySSA/pr43438.ll
@@ -1,36 +1,36 @@
; RUN: opt -disable-output -aa-pipeline=basic-aa -passes='loop-mssa(licm),print<memoryssa>' < %s 2>&1 | FileCheck %s
target triple = "x86_64-unknown-linux-gnu"
-; CHECK-LABEL: @main()
+; CHECK-LABEL: @main(i1 %arg)
; CHECK: 5 = MemoryPhi(
; CHECK-NOT: 7 = MemoryPhi(
@v_67 = external dso_local global i32, align 1
@v_76 = external dso_local global i16, align 1
@v_86 = external dso_local global ptr, align 1
-define dso_local void @main() {
+define dso_local void @main(i1 %arg) {
entry:
%v_59 = alloca i16, align 2
br label %for.cond
for.cond: ; preds = %for.body, %entry
- br i1 undef, label %for.body, label %for.end
+ br i1 %arg, label %for.body, label %for.end
for.body: ; preds = %for.cond
store i16 undef, ptr %v_59, align 2
br label %for.cond
for.end: ; preds = %for.cond
- br i1 undef, label %if.else568, label %cond.end82
+ br i1 %arg, label %if.else568, label %cond.end82
cond.false69: ; No predecessors!
br label %cond.end82
cond.end82: ; preds = %cond.false69, %cond.true55
- br i1 undef, label %if.else568, label %land.lhs.true87
+ br i1 %arg, label %if.else568, label %land.lhs.true87
land.lhs.true87: ; preds = %cond.end82
- br i1 undef, label %if.then88, label %if.else568
+ br i1 %arg, label %if.then88, label %if.else568
if.then88: ; preds = %land.lhs.true87
store ptr @v_76, ptr @v_86, align 1
@@ -45,13 +45,13 @@ if.end569: ; preds = %if.else568, %if.the
}
-; CHECK-LABEL: @f()
+; CHECK-LABEL: @f(i1 %arg)
; CHECK: 7 = MemoryPhi(
; CHECK: 6 = MemoryPhi(
; CHECK: 10 = MemoryPhi(
; CHECK: 9 = MemoryPhi(
; CHECK: 8 = MemoryPhi(
-define void @f() {
+define void @f(i1 %arg) {
entry:
%e = alloca i16, align 1
br label %lbl1
@@ -60,7 +60,7 @@ lbl1: ; preds = %if.else, %for.end5,
store i16 undef, ptr %e, align 1
%0 = load i16, ptr %e, align 1
%call = call i16 @g(i16 %0)
- br i1 undef, label %for.end, label %if.else
+ br i1 %arg, label %for.end, label %if.else
for.end: ; preds = %if.then
br i1 true, label %for.cond2, label %lbl2
@@ -69,7 +69,7 @@ lbl2: ; preds = %for.body4, %if.end
br label %for.cond2
for.cond2: ; preds = %lbl3
- br i1 undef, label %for.body4, label %for.end5
+ br i1 %arg, label %for.body4, label %for.end5
for.body4: ; preds = %for.cond2
br label %lbl2
diff --git a/llvm/test/Analysis/MemorySSA/pr43493.ll b/llvm/test/Analysis/MemorySSA/pr43493.ll
index 2bd7bdd8b2d7e7..623a510ff3cfe3 100644
--- a/llvm/test/Analysis/MemorySSA/pr43493.ll
+++ b/llvm/test/Analysis/MemorySSA/pr43493.ll
@@ -1,10 +1,10 @@
; RUN: opt -passes=loop-rotate -verify-memoryssa -S %s | FileCheck %s
; REQUIRES: asserts
-; CHECK-LABEL: @func_35()
-define void @func_35() {
+; CHECK-LABEL: @func_35(i1 %arg)
+define void @func_35(i1 %arg) {
entry:
- br i1 undef, label %for.cond1704.preheader, label %return
+ br i1 %arg, label %for.cond1704.preheader, label %return
for.cond1704.preheader: ; preds = %entry
br label %for.cond1704
@@ -17,7 +17,7 @@ for.body1707: ; preds = %for.cond1704
br label %for.cond1704
for.body1102: ; preds = %for.body1102
- br i1 undef, label %for.body1102, label %return
+ br i1 %arg, label %for.body1102, label %return
return.loopexit: ; preds = %for.cond1704
br label %return
diff --git a/llvm/test/Analysis/MemorySSA/pr43541.ll b/llvm/test/Analysis/MemorySSA/pr43541.ll
index 99b2175572042a..ff35989369b45e 100644
--- a/llvm/test/Analysis/MemorySSA/pr43541.ll
+++ b/llvm/test/Analysis/MemorySSA/pr43541.ll
@@ -2,8 +2,8 @@
; REQUIRES: asserts
%struct.job_pool.6.7 = type { i32 }
-; CHECK-LABEL: @f()
-define dso_local void @f() {
+; CHECK-LABEL: @f(i1 %arg)
+define dso_local void @f(i1 %arg) {
entry:
br label %for.cond
@@ -26,7 +26,7 @@ for.body12: ; preds = %if.end40, %for.body
br label %if.then23
if.then23: ; preds = %for.body12
- br i1 undef, label %if.then24, label %if.else
+ br i1 %arg, label %if.then24, label %if.else
if.then24: ; preds = %if.then23
%0 = load ptr, ptr undef, align 8
diff --git a/llvm/test/Analysis/MemorySSA/pr43641.ll b/llvm/test/Analysis/MemorySSA/pr43641.ll
index d4b3531b7e0e13..25bbee007037af 100644
--- a/llvm/test/Analysis/MemorySSA/pr43641.ll
+++ b/llvm/test/Analysis/MemorySSA/pr43641.ll
@@ -2,9 +2,9 @@
; REQUIRES: asserts
; CHECK-LABEL: @c
-define dso_local void @c(i32 signext %d) local_unnamed_addr {
+define dso_local void @c(i32 signext %d, i1 %arg) local_unnamed_addr {
entry:
- br i1 undef, label %while.end, label %while.body.lr.ph
+ br i1 %arg, label %while.end, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%tobool1 = icmp ne i32 %d, 0
diff --git a/llvm/test/Analysis/MemorySSA/pr45976.ll b/llvm/test/Analysis/MemorySSA/pr45976.ll
index b04849b20b780a..5b7c5eb7ee766f 100644
--- a/llvm/test/Analysis/MemorySSA/pr45976.ll
+++ b/llvm/test/Analysis/MemorySSA/pr45976.ll
@@ -4,17 +4,17 @@
@global1 = external global i64, align 8
@global2 = external global [3 x [8 x [8 x { i32, i64, i8, i8, i16, i32 }]]], align 8
-; CHECK-LABEL: @f0()
-define void @f0() {
+; CHECK-LABEL: @f0(i1 %arg)
+define void @f0(i1 %arg) {
bb:
br label %bb18.i
bb18.i: ; preds = %bb49.us.i.us, %bb
tail call void @f1()
- br i1 undef, label %.exit.loopexit, label %bb49.preheader.i
+ br i1 %arg, label %.exit.loopexit, label %bb49.preheader.i
bb49.preheader.i: ; preds = %bb18.i
- br i1 undef, label %bb49.us.preheader.i, label %bb78.loopexit3.i
+ br i1 %arg, label %bb49.us.preheader.i, label %bb78.loopexit3.i
bb49.us.preheader.i: ; preds = %bb49.preheader.i
br label %bb49.us.i.us
@@ -33,7 +33,7 @@ bb78.loopexit3.i: ; preds = %bb49.preheader.i
br label %.exit
.exit: ; preds = %.exit.loopexit, %bb78.loopexit3.i, %bb49.us.i.preheader
- br i1 undef, label %bb4.i.us.preheader, label %bb4.i
+ br i1 %arg, label %bb4.i.us.preheader, label %bb4.i
bb4.i.us.preheader: ; preds = %.exit
br label %bb4.i.us
diff --git a/llvm/test/Analysis/MemorySSA/reduce_clobber_limit.ll b/llvm/test/Analysis/MemorySSA/reduce_clobber_limit.ll
index a752a84b7d1b6e..29d3af5cb259b9 100644
--- a/llvm/test/Analysis/MemorySSA/reduce_clobber_limit.ll
+++ b/llvm/test/Analysis/MemorySSA/reduce_clobber_limit.ll
@@ -3,9 +3,9 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
-; CHECK-LABEL: @func()
+; CHECK-LABEL: @func(i1 %arg)
; Function Attrs: noinline
-define dso_local void @func() unnamed_addr #0 align 2 {
+define dso_local void @func(i1 %arg) unnamed_addr #0 align 2 {
entry:
%NoFinalize.addr = alloca i8, align 1
call void @blah()
@@ -97,7 +97,7 @@ if.then94: ; preds = %while.end
br label %for.cond
for.cond: ; preds = %for.body, %if.then94
- br i1 undef, label %for.body, label %if.end120
+ br i1 %arg, label %for.body, label %if.end120
for.body: ; preds = %for.cond
call void @blah()
diff --git a/llvm/test/Analysis/MemorySSA/renamephis.ll b/llvm/test/Analysis/MemorySSA/renamephis.ll
index ce19d59adbce95..0e8cf8b7c34dbb 100644
--- a/llvm/test/Analysis/MemorySSA/renamephis.ll
+++ b/llvm/test/Analysis/MemorySSA/renamephis.ll
@@ -11,20 +11,20 @@ declare void @g()
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0
; CHECK-LABEL: @f
-define void @f() align 2 {
+define void @f(i1 %arg) align 2 {
entry:
%P = alloca ptr, align 8
br label %cond.end.i.i.i.i
cond.end.i.i.i.i: ; preds = %cont20, %entry
- br i1 undef, label %cont20, label %if.end
+ br i1 %arg, label %cont20, label %if.end
cont20: ; preds = %cond.end.i.i.i.i, %cond.end.i.i.i.i, %cond.end.i.i.i.i
store ptr undef, ptr %P, align 8
br label %cond.end.i.i.i.i
if.end: ; preds = %cond.end.i.i.i.i
- br i1 undef, label %cond.exit, label %handler.type_mismatch2.i
+ br i1 %arg, label %cond.exit, label %handler.type_mismatch2.i
handler.type_mismatch2.i: ; preds = %if.end
tail call void @g()
diff --git a/llvm/test/Analysis/MemorySSA/unreachable.ll b/llvm/test/Analysis/MemorySSA/unreachable.ll
index 208be2f56a00e2..8f71a926e85835 100644
--- a/llvm/test/Analysis/MemorySSA/unreachable.ll
+++ b/llvm/test/Analysis/MemorySSA/unreachable.ll
@@ -8,9 +8,9 @@ target triple = "x86_64-grtev4-linux-gnu"
declare dso_local void @f()
; CHECK-LABEL: @foo
-define dso_local void @foo() {
+define dso_local void @foo(i1 %arg) {
entry:
- br i1 undef, label %if.then, label %if.end
+ br i1 %arg, label %if.then, label %if.end
if.then: ; preds = %entry
br label %try.cont
diff --git a/llvm/test/Analysis/MemorySSA/update_unroll.ll b/llvm/test/Analysis/MemorySSA/update_unroll.ll
index 46a7283eaf103f..8aaa4eee3515ea 100644
--- a/llvm/test/Analysis/MemorySSA/update_unroll.ll
+++ b/llvm/test/Analysis/MemorySSA/update_unroll.ll
@@ -7,7 +7,7 @@ target triple = "x86_64-grtev4-linux-gnu"
; Check verification passes after loop rotate, when adding phis in blocks
; receiving incoming edges and adding phis in IDF blocks.
; CHECK-LABEL: @f
-define void @f() align 32 {
+define void @f(i1 %arg) align 32 {
entry:
br label %while.cond.outer
@@ -15,13 +15,13 @@ while.cond80.while.cond.loopexit_crit_edge: ; preds = %if.else99
br label %while.cond.outer
while.cond.outer: ; preds = %while.cond80.while.cond.loopexit_crit_edge, %entry
- br i1 undef, label %while.cond.outer.return.loopexit2_crit_edge, label %while.body.lr.ph
+ br i1 %arg, label %while.cond.outer.return.loopexit2_crit_edge, label %while.body.lr.ph
while.body.lr.ph: ; preds = %while.cond.outer
br label %while.body
while.body: ; preds = %while.body.lr.ph
- br i1 undef, label %if.then42, label %if.end61
+ br i1 %arg, label %if.then42, label %if.end61
if.then42: ; preds = %while.body
br label %return.loopexit2
@@ -30,7 +30,7 @@ if.end61: ; preds = %while.body
br label %while.body82
while.body82: ; preds = %if.end61
- br i1 undef, label %return.loopexit, label %if.else99
+ br i1 %arg, label %return.loopexit, label %if.else99
if.else99: ; preds = %while.body82
store i32 0, ptr inttoptr (i64 44 to ptr), align 4
diff --git a/llvm/test/Analysis/PhiValues/basic.ll b/llvm/test/Analysis/PhiValues/basic.ll
index fc95927806602c..c7c40dab04aafe 100644
--- a/llvm/test/Analysis/PhiValues/basic.ll
+++ b/llvm/test/Analysis/PhiValues/basic.ll
@@ -3,9 +3,9 @@
@X = common global i32 0
; CHECK-LABEL: PHI Values for function: simple
-define void @simple(ptr %ptr) {
+define void @simple(ptr %ptr, i1 %arg) {
entry:
- br i1 undef, label %if, label %else
+ br i1 %arg, label %if, label %else
if:
br label %end
@@ -26,9 +26,9 @@ end:
}
; CHECK-LABEL: PHI Values for function: chain
-define void @chain() {
+define void @chain(i1 %arg) {
entry:
- br i1 undef, label %if1, label %else1
+ br i1 %arg, label %if1, label %else1
if1:
br label %middle
@@ -41,7 +41,7 @@ middle:
; CHECK-DAG: i32 0
; CHECK-DAG: i32 1
%phi1 = phi i32 [ 0, %if1 ], [ 1, %else1 ]
- br i1 undef, label %if2, label %else2
+ br i1 %arg, label %if2, label %else2
if2:
br label %end
@@ -59,7 +59,7 @@ end:
}
; CHECK-LABEL: PHI Values for function: no_values
-define void @no_values() {
+define void @no_values(i1 %arg) {
entry:
ret void
@@ -71,7 +71,7 @@ unreachable:
}
; CHECK-LABEL: PHI Values for function: simple_loop
-define void @simple_loop() {
+define void @simple_loop(i1 %arg) {
entry:
br label %loop
@@ -79,23 +79,23 @@ loop:
; CHECK: PHI %phi has values:
; CHECK-DAG: i32 0
%phi = phi i32 [ 0, %entry ], [ %phi, %loop ]
- br i1 undef, label %loop, label %end
+ br i1 %arg, label %loop, label %end
end:
ret void
}
; CHECK-LABEL: PHI Values for function: complex_loop
-define void @complex_loop() {
+define void @complex_loop(i1 %arg) {
entry:
- br i1 undef, label %loop, label %end
+ br i1 %arg, label %loop, label %end
loop:
; CHECK: PHI %phi1 has values:
; CHECK-DAG: i32 0
; CHECK-DAG: i32 1
%phi1 = phi i32 [ 0, %entry ], [ %phi2, %then ]
- br i1 undef, label %if, label %else
+ br i1 %arg, label %if, label %else
if:
br label %then
@@ -108,7 +108,7 @@ then:
; CHECK-DAG: i32 0
; CHECK-DAG: i32 1
%phi2 = phi i32 [ %phi1, %if ], [ 1, %else ]
- br i1 undef, label %loop, label %end
+ br i1 %arg, label %loop, label %end
end:
; CHECK: PHI %phi3 has values:
@@ -120,9 +120,9 @@ end:
}
; CHECK-LABEL: PHI Values for function: strange_loop
-define void @strange_loop() {
+define void @strange_loop(i1 %arg) {
entry:
- br i1 undef, label %ifelse, label %inloop
+ br i1 %arg, label %ifelse, label %inloop
loop:
; CHECK: PHI %phi1 has values:
@@ -131,7 +131,7 @@ loop:
; CHECK-DAG: i32 2
; CHECK-DAG: i32 3
%phi1 = phi i32 [ %phi3, %if ], [ 0, %else ], [ %phi2, %inloop ]
- br i1 undef, label %inloop, label %end
+ br i1 %arg, label %inloop, label %end
inloop:
; CHECK: PHI %phi2 has values:
@@ -140,14 +140,14 @@ inloop:
; CHECK-DAG: i32 2
; CHECK-DAG: i32 3
%phi2 = phi i32 [ %phi1, %loop ], [ 1, %entry ]
- br i1 undef, label %ifelse, label %loop
+ br i1 %arg, label %ifelse, label %loop
ifelse:
; CHECK: PHI %phi3 has values:
; CHECK-DAG: i32 2
; CHECK-DAG: i32 3
%phi3 = phi i32 [ 2, %entry ], [ 3, %inloop ]
- br i1 undef, label %if, label %else
+ br i1 %arg, label %if, label %else
if:
br label %loop
@@ -160,9 +160,9 @@ end:
}
; CHECK-LABEL: PHI Values for function: mutual_loops
-define void @mutual_loops() {
+define void @mutual_loops(i1 %arg) {
entry:
- br i1 undef, label %loop1, label %loop2
+ br i1 %arg, label %loop1, label %loop2
loop1:
; CHECK: PHI %phi1 has values:
@@ -172,10 +172,10 @@ loop1:
; CHECK-DAG: 3
; CHECK-DAG: 4
%phi1 = phi i32 [ 0, %entry ], [ %phi2, %loop1.then ], [ %phi3, %loop2.if ]
- br i1 undef, label %loop1.if, label %loop1.else
+ br i1 %arg, label %loop1.if, label %loop1.else
loop1.if:
- br i1 undef, label %loop1.then, label %loop2
+ br i1 %arg, label %loop1.then, label %loop2
loop1.else:
br label %loop1.then
@@ -188,7 +188,7 @@ loop1.then:
; CHECK-DAG: 3
; CHECK-DAG: 4
%phi2 = phi i32 [ 1, %loop1.if ], [ %phi1, %loop1.else ]
- br i1 undef, label %loop1, label %end
+ br i1 %arg, label %loop1, label %end
loop2:
; CHECK: PHI %phi3 has values:
@@ -196,10 +196,10 @@ loop2:
; CHECK-DAG: 3
; CHECK-DAG: 4
%phi3 = phi i32 [ 2, %entry ], [ %phi4, %loop2.then ], [ 3, %loop1.if ]
- br i1 undef, label %loop2.if, label %loop2.else
+ br i1 %arg, label %loop2.if, label %loop2.else
loop2.if:
- br i1 undef, label %loop2.then, label %loop1
+ br i1 %arg, label %loop2.then, label %loop1
loop2.else:
br label %loop2.then
@@ -210,7 +210,7 @@ loop2.then:
; CHECK-DAG: 3
; CHECK-DAG: 4
%phi4 = phi i32 [ 4, %loop2.if ], [ %phi3, %loop2.else ]
- br i1 undef, label %loop2, label %end
+ br i1 %arg, label %loop2, label %end
end:
; CHECK: PHI %phi5 has values:
@@ -224,7 +224,7 @@ end:
}
; CHECK-LABEL: PHI Values for function: nested_loops_several_values
-define void @nested_loops_several_values() {
+define void @nested_loops_several_values(i1 %arg) {
entry:
br label %loop1
@@ -233,14 +233,14 @@ loop1:
; CHECK-DAG: i32 0
; CHECK-DAG: %add
%phi1 = phi i32 [ 0, %entry ], [ %phi2, %loop2 ]
- br i1 undef, label %loop2, label %end
+ br i1 %arg, label %loop2, label %end
loop2:
; CHECK: PHI %phi2 has values:
; CHECK-DAG: i32 0
; CHECK-DAG: %add
%phi2 = phi i32 [ %phi1, %loop1 ], [ %phi3, %loop3 ]
- br i1 undef, label %loop3, label %loop1
+ br i1 %arg, label %loop3, label %loop1
loop3:
; CHECK: PHI %phi3 has values:
@@ -248,14 +248,14 @@ loop3:
; CHECK-DAG: %add
%phi3 = phi i32 [ %add, %loop3 ], [ %phi2, %loop2 ]
%add = add i32 %phi3, 1
- br i1 undef, label %loop3, label %loop2
+ br i1 %arg, label %loop3, label %loop2
end:
ret void
}
; CHECK-LABEL: PHI Values for function: nested_loops_one_value
-define void @nested_loops_one_value() {
+define void @nested_loops_one_value(i1 %arg) {
entry:
br label %loop1
@@ -263,19 +263,19 @@ loop1:
; CHECK: PHI %phi1 has values:
; CHECK-DAG: i32 0
%phi1 = phi i32 [ 0, %entry ], [ %phi2, %loop2 ]
- br i1 undef, label %loop2, label %end
+ br i1 %arg, label %loop2, label %end
loop2:
; CHECK: PHI %phi2 has values:
; CHECK-DAG: i32 0
%phi2 = phi i32 [ %phi1, %loop1 ], [ %phi3, %loop3 ]
- br i1 undef, label %loop3, label %loop1
+ br i1 %arg, label %loop3, label %loop1
loop3:
; CHECK: PHI %phi3 has values:
; CHECK-DAG: i32 0
%phi3 = phi i32 [ 0, %loop3 ], [ %phi2, %loop2 ]
- br i1 undef, label %loop3, label %loop2
+ br i1 %arg, label %loop3, label %loop2
end:
ret void
diff --git a/llvm/test/Analysis/PhiValues/long_phi_chain.ll b/llvm/test/Analysis/PhiValues/long_phi_chain.ll
index c21835e5bb7a03..197ebc0bbbbcd3 100644
--- a/llvm/test/Analysis/PhiValues/long_phi_chain.ll
+++ b/llvm/test/Analysis/PhiValues/long_phi_chain.ll
@@ -4,7 +4,7 @@
; phi values analysis to segfault if it's not careful about that kind of thing.
; CHECK-LABEL: PHI Values for function: fn
-define void @fn(ptr %arg) {
+define void @fn(ptr %arg, i1 %arg1) {
entry:
br label %while1.cond
@@ -12,10 +12,10 @@ while1.cond:
; CHECK: PHI %phi1 has values:
; CHECK: ptr %arg
%phi1 = phi ptr [ %arg, %entry ], [ %phi2, %while1.then ]
- br i1 undef, label %while1.end, label %while1.body
+ br i1 %arg1, label %while1.end, label %while1.body
while1.body:
- br i1 undef, label %while1.then, label %while1.if
+ br i1 %arg1, label %while1.then, label %while1.if
while1.if:
br label %while1.then
@@ -33,16 +33,16 @@ while2.cond1:
; CHECK: PHI %phi3 has values:
; CHECK: ptr %arg
%phi3 = phi ptr [ %phi1, %while1.end ], [ %phi5, %while2.then ]
- br i1 undef, label %while2.end, label %while2.body1
+ br i1 %arg1, label %while2.end, label %while2.body1
while2.body1:
- br i1 undef, label %while2.cond2, label %while2.then
+ br i1 %arg1, label %while2.cond2, label %while2.then
while2.cond2:
; CHECK: PHI %phi4 has values:
; CHECK: ptr %arg
%phi4 = phi ptr [ %phi3, %while2.body1 ], [ %phi4, %while2.if ]
- br i1 undef, label %while2.then, label %while2.if
+ br i1 %arg1, label %while2.then, label %while2.if
while2.if:
br label %while2.cond2
@@ -60,13 +60,13 @@ while3.cond1:
; CHECK: PHI %phi6 has values:
; CHECK: ptr %arg
%phi6 = phi ptr [ %phi3, %while2.end ], [ %phi7, %while3.cond2 ]
- br i1 undef, label %while3.end, label %while3.cond2
+ br i1 %arg1, label %while3.end, label %while3.cond2
while3.cond2:
; CHECK: PHI %phi7 has values:
; CHECK: ptr %arg
%phi7 = phi ptr [ %phi6, %while3.cond1 ], [ %phi7, %while3.body ]
- br i1 undef, label %while3.cond1, label %while3.body
+ br i1 %arg1, label %while3.cond1, label %while3.body
while3.body:
br label %while3.cond2
@@ -78,16 +78,16 @@ while4.cond1:
; CHECK: PHI %phi8 has values:
; CHECK: ptr %arg
%phi8 = phi ptr [ %phi6, %while3.end ], [ %phi10, %while4.then ]
- br i1 undef, label %while4.end, label %while4.if
+ br i1 %arg1, label %while4.end, label %while4.if
while4.if:
- br i1 undef, label %while4.cond2, label %while4.then
+ br i1 %arg1, label %while4.cond2, label %while4.then
while4.cond2:
; CHECK: PHI %phi9 has values:
; CHECK: ptr %arg
%phi9 = phi ptr [ %phi8, %while4.if ], [ %phi9, %while4.body ]
- br i1 undef, label %while4.then, label %while4.body
+ br i1 %arg1, label %while4.then, label %while4.body
while4.body:
br label %while4.cond2
@@ -105,16 +105,16 @@ while5.cond:
; CHECK: PHI %phi11 has values:
; CHECK: ptr %arg
%phi11 = phi ptr [ %phi8, %while4.end ], [ %phi13, %while5.then ]
- br i1 undef, label %while5.end, label %while5.body1
+ br i1 %arg1, label %while5.end, label %while5.body1
while5.body1:
- br i1 undef, label %while5.if, label %while5.then
+ br i1 %arg1, label %while5.if, label %while5.then
while5.if:
; CHECK: PHI %phi12 has values:
; CHECK: ptr %arg
%phi12 = phi ptr [ %phi11, %while5.body1 ], [ %phi12, %while5.body2 ]
- br i1 undef, label %while5.then, label %while5.body2
+ br i1 %arg1, label %while5.then, label %while5.body2
while5.body2:
br label %while5.if
@@ -132,7 +132,7 @@ while6.cond1:
; CHECK: PHI %phi14 has values:
; CHECK: ptr %arg
%phi14 = phi ptr [ %phi11, %while5.end ], [ %phi14, %while6.cond1 ]
- br i1 undef, label %while6.cond2, label %while6.cond1
+ br i1 %arg1, label %while6.cond2, label %while6.cond1
while6.cond2:
; CHECK: PHI %phi15 has values:
diff --git a/llvm/test/Analysis/PostDominators/pr6047_a.ll b/llvm/test/Analysis/PostDominators/pr6047_a.ll
index d72934ea35b897..d9ce4be3d9b7a0 100644
--- a/llvm/test/Analysis/PostDominators/pr6047_a.ll
+++ b/llvm/test/Analysis/PostDominators/pr6047_a.ll
@@ -1,7 +1,7 @@
; RUN: opt < %s -passes='print<postdomtree>' 2>&1 | FileCheck %s
-define internal void @f() {
+define internal void @f(i1 %arg) {
entry:
- br i1 undef, label %bb35, label %bb3.i
+ br i1 %arg, label %bb35, label %bb3.i
bb3.i:
br label %bb3.i
diff --git a/llvm/test/Analysis/PostDominators/pr6047_b.ll b/llvm/test/Analysis/PostDominators/pr6047_b.ll
index 4cd756a14857b6..d73067642fb5fb 100644
--- a/llvm/test/Analysis/PostDominators/pr6047_b.ll
+++ b/llvm/test/Analysis/PostDominators/pr6047_b.ll
@@ -1,10 +1,10 @@
; RUN: opt < %s -passes='print<postdomtree>' 2>&1 | FileCheck %s
-define internal void @f() {
+define internal void @f(i1 %arg) {
entry:
- br i1 undef, label %a, label %bb3.i
+ br i1 %arg, label %a, label %bb3.i
a:
- br i1 undef, label %bb35, label %bb3.i
+ br i1 %arg, label %bb35, label %bb3.i
bb3.i:
br label %bb3.i
diff --git a/llvm/test/Analysis/PostDominators/pr6047_c.ll b/llvm/test/Analysis/PostDominators/pr6047_c.ll
index b95ae6b1d71287..697cb2ccd0811e 100644
--- a/llvm/test/Analysis/PostDominators/pr6047_c.ll
+++ b/llvm/test/Analysis/PostDominators/pr6047_c.ll
@@ -1,7 +1,7 @@
; RUN: opt < %s -passes='print<postdomtree>' 2>&1 | FileCheck %s
-define internal void @f() {
+define internal void @f(i1 %arg) {
entry:
- br i1 undef, label %bb35, label %bb3.i
+ br i1 %arg, label %bb35, label %bb3.i
bb3.i:
br label %bb3.i
diff --git a/llvm/test/Analysis/PostDominators/pr6047_d.ll b/llvm/test/Analysis/PostDominators/pr6047_d.ll
index 50bd15e67ddcac..747fd320c90003 100644
--- a/llvm/test/Analysis/PostDominators/pr6047_d.ll
+++ b/llvm/test/Analysis/PostDominators/pr6047_d.ll
@@ -1,5 +1,5 @@
; RUN: opt < %s -passes='print<postdomtree>' 2>&1 | FileCheck %s
-define internal void @f() {
+define internal void @f(i1 %arg) {
entry:
br i1 1, label %a, label %b
@@ -10,7 +10,7 @@ b:
br label %c
c:
- br i1 undef, label %bb35, label %bb3.i
+ br i1 %arg, label %bb35, label %bb3.i
bb3.i:
br label %bb3.i
diff --git a/llvm/test/Analysis/ScalarEvolution/2011-04-26-FoldAddRec.ll b/llvm/test/Analysis/ScalarEvolution/2011-04-26-FoldAddRec.ll
index a29295ae1c21ad..d6aa3702de4037 100644
--- a/llvm/test/Analysis/ScalarEvolution/2011-04-26-FoldAddRec.ll
+++ b/llvm/test/Analysis/ScalarEvolution/2011-04-26-FoldAddRec.ll
@@ -2,7 +2,7 @@
; PR9633: Tests that SCEV handles the mul.i2 recurrence being folded to
; constant zero.
-define signext i8 @func_14(i8 signext %p_18) nounwind readnone ssp {
+define signext i8 @func_14(i8 signext %p_18, i1 %arg) nounwind readnone ssp {
entry:
br label %for.inc
@@ -16,7 +16,7 @@ for.cond:
%shl.i = select i1 %tobool.i, i32 13, i32 0
%shl.left.i = shl i32 %add, %shl.i
%conv.i4 = trunc i32 %shl.left.i to i8
- br i1 undef, label %for.inc9, label %if.then
+ br i1 %arg, label %for.inc9, label %if.then
for.inc9:
%p_18.addr.011 = phi i8 [ %add12, %for.inc9 ], [ %p_18, %for.cond ]
diff --git a/llvm/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll b/llvm/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll
index 422a0b8cecf3fa..56e7de0ff8d771 100644
--- a/llvm/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll
+++ b/llvm/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll
@@ -42,7 +42,7 @@ return: ; preds = %bb5
; PR10383
; These next two used to crash.
-define void @test2(i1 %cmp, i64 %n) {
+define void @test2(i1 %cmp, i64 %n, i1 %arg) {
; CHECK-LABEL: 'test2'
; CHECK-NEXT: Determining loop execution counts for: @test2
; CHECK-NEXT: Loop %for.body2: Unpredictable backedge-taken count.
@@ -69,13 +69,13 @@ for.body2:
%tmp114 = mul i64 %a0.08, %indvar
%mul542 = mul i64 %tmp114, %tmp111
%indvar.next = add i64 %indvar, 1
- br i1 undef, label %end, label %for.body2
+ br i1 %arg, label %end, label %for.body2
end:
ret void
}
-define i32 @test3() {
+define i32 @test3(i1 %arg) {
; CHECK-LABEL: 'test3'
; CHECK-NEXT: Determining loop execution counts for: @test3
; CHECK-NEXT: Loop %for.inc479: Unpredictable backedge-taken count.
@@ -83,7 +83,7 @@ define i32 @test3() {
; CHECK-NEXT: Loop %for.inc479: Unpredictable symbolic max backedge-taken count.
;
if.then466:
- br i1 undef, label %for.cond539.preheader, label %for.inc479
+ br i1 %arg, label %for.cond539.preheader, label %for.inc479
for.inc479:
%a2.07 = phi i32 [ %add495, %for.inc479 ], [ 0, %if.then466 ]
@@ -93,7 +93,7 @@ for.inc479:
%mul493 = mul i32 %mul491, %mul484
%add495 = add nsw i32 %mul493, %a2.07
%inc497 = add nsw i32 %j.36, 1
- br i1 undef, label %for.cond539.preheader, label %for.inc479
+ br i1 %arg, label %for.cond539.preheader, label %for.inc479
for.cond539.preheader:
unreachable
diff --git a/llvm/test/Analysis/ScalarEvolution/avoid-infinite-recursion-0.ll b/llvm/test/Analysis/ScalarEvolution/avoid-infinite-recursion-0.ll
index c0e6681828deb9..f9fe7a19de22d0 100644
--- a/llvm/test/Analysis/ScalarEvolution/avoid-infinite-recursion-0.ll
+++ b/llvm/test/Analysis/ScalarEvolution/avoid-infinite-recursion-0.ll
@@ -5,14 +5,14 @@
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
target triple = "x86_64-unknown-linux-gnu"
-define i32 @test() {
+define i32 @test(i1 %arg) {
entry:
%0 = load ptr, ptr undef, align 8 ; <ptr> [#uses=1]
%1 = ptrtoint ptr %0 to i64 ; <i64> [#uses=1]
%2 = sub i64 undef, %1 ; <i64> [#uses=1]
%3 = lshr i64 %2, 3 ; <i64> [#uses=1]
%4 = trunc i64 %3 to i32 ; <i32> [#uses=2]
- br i1 undef, label %bb10, label %bb4.i
+ br i1 %arg, label %bb10, label %bb4.i
bb4.i: ; preds = %bb4.i, %entry
%i.0.i6 = phi i32 [ %8, %bb4.i ], [ 0, %entry ] ; <i32> [#uses=2]
diff --git a/llvm/test/Analysis/ScalarEvolution/avoid-infinite-recursion-1.ll b/llvm/test/Analysis/ScalarEvolution/avoid-infinite-recursion-1.ll
index 49b8c88e5e54d7..639914143a0240 100644
--- a/llvm/test/Analysis/ScalarEvolution/avoid-infinite-recursion-1.ll
+++ b/llvm/test/Analysis/ScalarEvolution/avoid-infinite-recursion-1.ll
@@ -207,9 +207,9 @@ module asm ".previous"
%union.pager_info = type <{ [4 x i8] }>
%union.sigval = type <{ [8 x i8] }>
-define i32 @vlrureclaim(ptr %mp) nounwind {
+define i32 @vlrureclaim(ptr %mp, i1 %arg) nounwind {
entry:
- br i1 undef, label %if.then11, label %do.end
+ br i1 %arg, label %if.then11, label %do.end
if.then11: ; preds = %entry
br label %do.end
@@ -230,19 +230,19 @@ while.body: ; preds = %while.cond
br label %while.cond27
while.cond27: ; preds = %while.body36, %while.body
- br i1 undef, label %do.body288.loopexit, label %land.rhs
+ br i1 %arg, label %do.body288.loopexit, label %land.rhs
land.rhs: ; preds = %while.cond27
- br i1 undef, label %while.body36, label %while.end
+ br i1 %arg, label %while.body36, label %while.end
while.body36: ; preds = %land.rhs
br label %while.cond27
while.end: ; preds = %land.rhs
- br i1 undef, label %do.body288.loopexit4, label %do.body46
+ br i1 %arg, label %do.body288.loopexit4, label %do.body46
do.body46: ; preds = %while.end
- br i1 undef, label %if.else64, label %if.then53
+ br i1 %arg, label %if.else64, label %if.then53
if.then53: ; preds = %do.body46
br label %if.end72
@@ -252,58 +252,58 @@ if.else64: ; preds = %do.body46
if.end72: ; preds = %if.else64, %if.then53
%dec = add i32 %count.0, -1 ; <i32> [#uses=2]
- br i1 undef, label %next_iter, label %if.end111
+ br i1 %arg, label %next_iter, label %if.end111
if.end111: ; preds = %if.end72
- br i1 undef, label %lor.lhs.false, label %do.body145
+ br i1 %arg, label %lor.lhs.false, label %do.body145
lor.lhs.false: ; preds = %if.end111
- br i1 undef, label %lor.lhs.false122, label %do.body145
+ br i1 %arg, label %lor.lhs.false122, label %do.body145
lor.lhs.false122: ; preds = %lor.lhs.false
- br i1 undef, label %lor.lhs.false128, label %do.body145
+ br i1 %arg, label %lor.lhs.false128, label %do.body145
lor.lhs.false128: ; preds = %lor.lhs.false122
- br i1 undef, label %do.body162, label %land.lhs.true
+ br i1 %arg, label %do.body162, label %land.lhs.true
land.lhs.true: ; preds = %lor.lhs.false128
- br i1 undef, label %do.body145, label %do.body162
+ br i1 %arg, label %do.body145, label %do.body162
do.body145: ; preds = %land.lhs.true, %lor.lhs.false122, %lor.lhs.false, %if.end111
- br i1 undef, label %if.then156, label %next_iter
+ br i1 %arg, label %if.then156, label %next_iter
if.then156: ; preds = %do.body145
br label %next_iter
do.body162: ; preds = %land.lhs.true, %lor.lhs.false128
- br i1 undef, label %if.then173, label %do.end177
+ br i1 %arg, label %if.then173, label %do.end177
if.then173: ; preds = %do.body162
br label %do.end177
do.end177: ; preds = %if.then173, %do.body162
- br i1 undef, label %do.body185, label %if.then182
+ br i1 %arg, label %do.body185, label %if.then182
if.then182: ; preds = %do.end177
br label %next_iter_mntunlocked
do.body185: ; preds = %do.end177
- br i1 undef, label %if.then196, label %do.end202
+ br i1 %arg, label %if.then196, label %do.end202
if.then196: ; preds = %do.body185
br label %do.end202
do.end202: ; preds = %if.then196, %do.body185
- br i1 undef, label %lor.lhs.false207, label %if.then231
+ br i1 %arg, label %lor.lhs.false207, label %if.then231
lor.lhs.false207: ; preds = %do.end202
- br i1 undef, label %lor.lhs.false214, label %if.then231
+ br i1 %arg, label %lor.lhs.false214, label %if.then231
lor.lhs.false214: ; preds = %lor.lhs.false207
- br i1 undef, label %do.end236, label %land.lhs.true221
+ br i1 %arg, label %do.end236, label %land.lhs.true221
land.lhs.true221: ; preds = %lor.lhs.false214
- br i1 undef, label %if.then231, label %do.end236
+ br i1 %arg, label %if.then231, label %do.end236
if.then231: ; preds = %land.lhs.true221, %lor.lhs.false207, %do.end202
br label %next_iter_mntunlocked
@@ -312,7 +312,7 @@ do.end236: ; preds = %land.lhs.true221, %lor.lhs.false214
br label %next_iter_mntunlocked
next_iter_mntunlocked: ; preds = %do.end236, %if.then231, %if.then182
- br i1 undef, label %yield, label %do.body269
+ br i1 %arg, label %yield, label %do.body269
next_iter: ; preds = %if.then156, %do.body145, %if.end72
%rem2482 = and i32 %dec, 255 ; <i32> [#uses=1]
@@ -320,7 +320,7 @@ next_iter: ; preds = %if.then156, %do.body145, %if.end72
br i1 %cmp249, label %do.body253, label %while.cond
do.body253: ; preds = %next_iter
- br i1 undef, label %if.then264, label %yield
+ br i1 %arg, label %if.then264, label %yield
if.then264: ; preds = %do.body253
br label %yield
@@ -329,7 +329,7 @@ yield: ; preds = %if.then264, %do.body253, %next_iter_mntunlocked
br label %do.body269
do.body269: ; preds = %yield, %next_iter_mntunlocked
- br i1 undef, label %if.then280, label %while.cond.outer.backedge
+ br i1 %arg, label %if.then280, label %while.cond.outer.backedge
if.then280: ; preds = %do.body269
br label %while.cond.outer.backedge
@@ -344,7 +344,7 @@ do.body288.loopexit4: ; preds = %while.end, %while.cond
br label %do.body288
do.body288: ; preds = %do.body288.loopexit4, %do.body288.loopexit
- br i1 undef, label %if.then299, label %do.end303
+ br i1 %arg, label %if.then299, label %do.end303
if.then299: ; preds = %do.body288
br label %do.end303
diff --git a/llvm/test/Analysis/ScalarEvolution/different-loops-recs.ll b/llvm/test/Analysis/ScalarEvolution/different-loops-recs.ll
index 41e1d059803b21..44bff5638bc857 100644
--- a/llvm/test/Analysis/ScalarEvolution/different-loops-recs.ll
+++ b/llvm/test/Analysis/ScalarEvolution/different-loops-recs.ll
@@ -7,7 +7,7 @@
; Check that we can evaluate a sum of phis from two different loops in any
; order.
-define void @test_00() {
+define void @test_00(i1 %arg) {
; CHECK-LABEL: 'test_00'
; CHECK-NEXT: Classifying expressions for: @test_00
; CHECK-NEXT: %phi1 = phi i32 [ 10, %entry ], [ %phi1.inc, %loop1 ]
@@ -383,7 +383,7 @@ exit:
; Another mix of previous use cases that demonstrates that incorrect picking of
; a loop for a recurrence may cause a crash of SCEV analysis.
-define void @test_04() {
+define void @test_04(i1 %arg) {
; CHECK-LABEL: 'test_04'
; CHECK-NEXT: Classifying expressions for: @test_04
; CHECK-NEXT: %tmp = phi i64 [ 2, %bb ], [ %tmp4, %bb3 ]
@@ -425,7 +425,7 @@ bb:
loop1:
%tmp = phi i64 [ 2, %bb ], [ %tmp4, %bb3 ]
%tmp2 = trunc i64 %tmp to i32
- br i1 undef, label %loop2, label %bb3
+ br i1 %arg, label %loop2, label %bb3
bb3:
%tmp4 = add nuw nsw i64 %tmp, 1
diff --git a/llvm/test/Analysis/ScalarEvolution/expander-replace-congruent-ivs.ll b/llvm/test/Analysis/ScalarEvolution/expander-replace-congruent-ivs.ll
index c77697172c71f9..3063e4fc4f47ed 100644
--- a/llvm/test/Analysis/ScalarEvolution/expander-replace-congruent-ivs.ll
+++ b/llvm/test/Analysis/ScalarEvolution/expander-replace-congruent-ivs.ll
@@ -6,10 +6,10 @@ target triple = "x86_64-apple-macosx10.11.0"
; SCEVExpander would try to RAUW %val_2 with %c.lcssa, breaking "def
; dominates uses".
-define void @pr27232(i32 %val) {
+define void @pr27232(i32 %val, i1 %arg) {
; CHECK-LABEL: @pr27232(
entry:
- br i1 undef, label %loop_0.cond, label %for.body.us
+ br i1 %arg, label %loop_0.cond, label %for.body.us
for.body.us:
br label %loop_0.cond
@@ -29,12 +29,12 @@ loop_1.ph:
br label %loop_1
loop_0:
- br i1 undef, label %loop_0, label %loop_1.exit
+ br i1 %arg, label %loop_0, label %loop_1.exit
loop_1:
%d.1 = phi i32 [ %c.lcssa, %loop_1 ], [ %val_2, %loop_1.ph ]
%t.1 = phi i32 [ %val_2, %loop_1 ], [ %c.lcssa, %loop_1.ph ]
- br i1 undef, label %leave, label %loop_1
+ br i1 %arg, label %leave, label %loop_1
leave:
ret void
@@ -44,10 +44,10 @@ leave:
; @ReplaceArg_0 and @ReplaceArg_1 used to trigger a failed cast<>
; assertion in SCEVExpander.
-define void @ReplaceArg_0(i32 %val) {
+define void @ReplaceArg_0(i32 %val, i1 %arg) {
; CHECK-LABEL: @ReplaceArg_0(
entry:
- br i1 undef, label %loop_0.cond, label %for.body.us
+ br i1 %arg, label %loop_0.cond, label %for.body.us
for.body.us:
br label %loop_0.cond
@@ -66,21 +66,21 @@ loop_1.ph:
br label %loop_1
loop_0:
- br i1 undef, label %loop_0, label %loop_1.exit
+ br i1 %arg, label %loop_0, label %loop_1.exit
loop_1:
%d.1 = phi i32 [ %c.lcssa, %loop_1 ], [ %val, %loop_1.ph ]
%t.1 = phi i32 [ %val, %loop_1 ], [ %c.lcssa, %loop_1.ph ]
- br i1 undef, label %leave, label %loop_1
+ br i1 %arg, label %leave, label %loop_1
leave:
ret void
}
-define void @ReplaceArg_1(i32 %val) {
+define void @ReplaceArg_1(i32 %val, i1 %arg) {
; CHECK-LABEL: @ReplaceArg_1(
entry:
- br i1 undef, label %loop_0.cond, label %for.body.us
+ br i1 %arg, label %loop_0.cond, label %for.body.us
for.body.us:
br label %loop_0.cond
@@ -99,12 +99,12 @@ loop_1.ph:
br label %loop_1
loop_0:
- br i1 undef, label %loop_0, label %loop_1.exit
+ br i1 %arg, label %loop_0, label %loop_1.exit
loop_1:
%t.1 = phi i32 [ %val, %loop_1 ], [ %c.lcssa, %loop_1.ph ]
%d.1 = phi i32 [ %c.lcssa, %loop_1 ], [ %val, %loop_1.ph ]
- br i1 undef, label %leave, label %loop_1
+ br i1 %arg, label %leave, label %loop_1
leave:
ret void
diff --git a/llvm/test/Analysis/ScalarEvolution/how-far-to-zero.ll b/llvm/test/Analysis/ScalarEvolution/how-far-to-zero.ll
index eab6faf11bdb3f..f0328d1d706742 100644
--- a/llvm/test/Analysis/ScalarEvolution/how-far-to-zero.ll
+++ b/llvm/test/Analysis/ScalarEvolution/how-far-to-zero.ll
@@ -1,7 +1,7 @@
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck %s
; PR13228
-define void @f() nounwind uwtable readnone {
+define void @f(i1 %arg) nounwind uwtable readnone {
entry:
br label %for.cond
@@ -14,7 +14,7 @@ for.cond: ; preds = %for.cond, %entry
while.cond: ; preds = %while.body, %for.cond
%b.2 = phi i8 [ %add, %while.body ], [ 0, %for.cond ]
- br i1 undef, label %while.end, label %while.body
+ br i1 %arg, label %while.end, label %while.body
while.body: ; preds = %while.cond
%add = add i8 %b.2, %c.0
diff --git a/llvm/test/Analysis/ScalarEvolution/overflow-intrinsics-trip-count.ll b/llvm/test/Analysis/ScalarEvolution/overflow-intrinsics-trip-count.ll
index 15ba27682a128e..88515a310f9bcc 100644
--- a/llvm/test/Analysis/ScalarEvolution/overflow-intrinsics-trip-count.ll
+++ b/llvm/test/Analysis/ScalarEvolution/overflow-intrinsics-trip-count.ll
@@ -8,7 +8,7 @@ declare { i16, i1 } @llvm.usub.with.overflow.i16(i16, i16) nounwind readnone
declare { i16, i1 } @llvm.smul.with.overflow.i16(i16, i16) nounwind readnone
declare { i16, i1 } @llvm.umul.with.overflow.i16(i16, i16) nounwind readnone
-define void @uadd_exhaustive() {
+define void @uadd_exhaustive(i1 %arg) {
; CHECK-LABEL: 'uadd_exhaustive'
; CHECK-NEXT: Determining loop execution counts for: @uadd_exhaustive
; CHECK-NEXT: Loop %for.body: backedge-taken count is i16 35
@@ -17,7 +17,7 @@ define void @uadd_exhaustive() {
; CHECK-NEXT: Loop %for.body: Trip multiple is 36
;
entry:
- br i1 undef, label %for.end, label %for.body.preheader
+ br i1 %arg, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
br label %for.body
@@ -33,7 +33,7 @@ for.end: ; preds = %for.body, %entry
ret void
}
-define void @sadd_exhaustive() {
+define void @sadd_exhaustive(i1 %arg) {
; CHECK-LABEL: 'sadd_exhaustive'
; CHECK-NEXT: Determining loop execution counts for: @sadd_exhaustive
; CHECK-NEXT: Loop %for.body: backedge-taken count is i16 67
@@ -42,7 +42,7 @@ define void @sadd_exhaustive() {
; CHECK-NEXT: Loop %for.body: Trip multiple is 68
;
entry:
- br i1 undef, label %for.end, label %for.body.preheader
+ br i1 %arg, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
br label %for.body
@@ -58,7 +58,7 @@ for.end: ; preds = %for.body, %entry
ret void
}
-define void @usub_exhaustive() {
+define void @usub_exhaustive(i1 %arg) {
; CHECK-LABEL: 'usub_exhaustive'
; CHECK-NEXT: Determining loop execution counts for: @usub_exhaustive
; CHECK-NEXT: Loop %for.body: backedge-taken count is i16 50
@@ -67,7 +67,7 @@ define void @usub_exhaustive() {
; CHECK-NEXT: Loop %for.body: Trip multiple is 51
;
entry:
- br i1 undef, label %for.end, label %for.body.preheader
+ br i1 %arg, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
br label %for.body
@@ -83,7 +83,7 @@ for.end: ; preds = %for.body, %entry
ret void
}
-define void @ssub_exhaustive() {
+define void @ssub_exhaustive(i1 %arg) {
; CHECK-LABEL: 'ssub_exhaustive'
; CHECK-NEXT: Determining loop execution counts for: @ssub_exhaustive
; CHECK-NEXT: Loop %for.body: backedge-taken count is i16 68
@@ -92,7 +92,7 @@ define void @ssub_exhaustive() {
; CHECK-NEXT: Loop %for.body: Trip multiple is 69
;
entry:
- br i1 undef, label %for.end, label %for.body.preheader
+ br i1 %arg, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
br label %for.body
@@ -108,7 +108,7 @@ for.end: ; preds = %for.body, %entry
ret void
}
-define void @smul_exhaustive() {
+define void @smul_exhaustive(i1 %arg) {
; CHECK-LABEL: 'smul_exhaustive'
; CHECK-NEXT: Determining loop execution counts for: @smul_exhaustive
; CHECK-NEXT: Loop %for.body: backedge-taken count is i32 14
@@ -117,7 +117,7 @@ define void @smul_exhaustive() {
; CHECK-NEXT: Loop %for.body: Trip multiple is 15
;
entry:
- br i1 undef, label %for.end, label %for.body.preheader
+ br i1 %arg, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
br label %for.body
@@ -133,7 +133,7 @@ for.end: ; preds = %for.body, %entry
ret void
}
-define void @umul_exhaustive() {
+define void @umul_exhaustive(i1 %arg) {
; CHECK-LABEL: 'umul_exhaustive'
; CHECK-NEXT: Determining loop execution counts for: @umul_exhaustive
; CHECK-NEXT: Loop %for.body: backedge-taken count is i32 15
@@ -142,7 +142,7 @@ define void @umul_exhaustive() {
; CHECK-NEXT: Loop %for.body: Trip multiple is 16
;
entry:
- br i1 undef, label %for.end, label %for.body.preheader
+ br i1 %arg, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
br label %for.body
@@ -158,7 +158,7 @@ for.end: ; preds = %for.body, %entry
ret void
}
-define void @uadd_symbolic_start(i16 %start) {
+define void @uadd_symbolic_start(i16 %start, i1 %arg) {
; CHECK-LABEL: 'uadd_symbolic_start'
; CHECK-NEXT: Determining loop execution counts for: @uadd_symbolic_start
; CHECK-NEXT: Loop %for.body: backedge-taken count is (-1 + (-1 * %start))
@@ -167,7 +167,7 @@ define void @uadd_symbolic_start(i16 %start) {
; CHECK-NEXT: Loop %for.body: Trip multiple is 1
;
entry:
- br i1 undef, label %for.end, label %for.body.preheader
+ br i1 %arg, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
br label %for.body
@@ -183,7 +183,7 @@ for.end: ; preds = %for.body, %entry
ret void
}
-define void @sadd_symbolic_start(i16 %start) {
+define void @sadd_symbolic_start(i16 %start, i1 %arg) {
; CHECK-LABEL: 'sadd_symbolic_start'
; CHECK-NEXT: Determining loop execution counts for: @sadd_symbolic_start
; CHECK-NEXT: Loop %for.body: backedge-taken count is (32767 + (-1 * %start))
@@ -192,7 +192,7 @@ define void @sadd_symbolic_start(i16 %start) {
; CHECK-NEXT: Loop %for.body: Trip multiple is 1
;
entry:
- br i1 undef, label %for.end, label %for.body.preheader
+ br i1 %arg, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
br label %for.body
@@ -208,7 +208,7 @@ for.end: ; preds = %for.body, %entry
ret void
}
-define void @sadd_symbolic_start2(i16 %start) {
+define void @sadd_symbolic_start2(i16 %start, i1 %arg) {
; CHECK-LABEL: 'sadd_symbolic_start2'
; CHECK-NEXT: Determining loop execution counts for: @sadd_symbolic_start2
; CHECK-NEXT: Loop %for.body: Unpredictable backedge-taken count.
@@ -216,7 +216,7 @@ define void @sadd_symbolic_start2(i16 %start) {
; CHECK-NEXT: Loop %for.body: Unpredictable symbolic max backedge-taken count.
;
entry:
- br i1 undef, label %for.end, label %for.body.preheader
+ br i1 %arg, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
br label %for.body
@@ -233,7 +233,7 @@ for.end: ; preds = %for.body, %entry
ret void
}
-define void @sadd_symbolic_swapped(i16 %start) {
+define void @sadd_symbolic_swapped(i16 %start, i1 %arg) {
; CHECK-LABEL: 'sadd_symbolic_swapped'
; CHECK-NEXT: Determining loop execution counts for: @sadd_symbolic_swapped
; CHECK-NEXT: Loop %for.body: Unpredictable backedge-taken count.
@@ -241,7 +241,7 @@ define void @sadd_symbolic_swapped(i16 %start) {
; CHECK-NEXT: Loop %for.body: Unpredictable symbolic max backedge-taken count.
;
entry:
- br i1 undef, label %for.end, label %for.body.preheader
+ br i1 %arg, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
br label %for.body
@@ -257,7 +257,7 @@ for.end: ; preds = %for.body, %entry
ret void
}
-define void @usub_symbolic_start(i16 %start) {
+define void @usub_symbolic_start(i16 %start, i1 %arg) {
; CHECK-LABEL: 'usub_symbolic_start'
; CHECK-NEXT: Determining loop execution counts for: @usub_symbolic_start
; CHECK-NEXT: Loop %for.body: backedge-taken count is %start
@@ -266,7 +266,7 @@ define void @usub_symbolic_start(i16 %start) {
; CHECK-NEXT: Loop %for.body: Trip multiple is 1
;
entry:
- br i1 undef, label %for.end, label %for.body.preheader
+ br i1 %arg, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
br label %for.body
@@ -282,7 +282,7 @@ for.end: ; preds = %for.body, %entry
ret void
}
-define void @ssub_symbolic_start(i16 %start) {
+define void @ssub_symbolic_start(i16 %start, i1 %arg) {
; CHECK-LABEL: 'ssub_symbolic_start'
; CHECK-NEXT: Determining loop execution counts for: @ssub_symbolic_start
; CHECK-NEXT: Loop %for.body: backedge-taken count is (-32768 + %start)
@@ -291,7 +291,7 @@ define void @ssub_symbolic_start(i16 %start) {
; CHECK-NEXT: Loop %for.body: Trip multiple is 1
;
entry:
- br i1 undef, label %for.end, label %for.body.preheader
+ br i1 %arg, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
br label %for.body
@@ -307,7 +307,7 @@ for.end: ; preds = %for.body, %entry
ret void
}
-define void @smul_symbolic_start(i16 %start) {
+define void @smul_symbolic_start(i16 %start, i1 %arg) {
; CHECK-LABEL: 'smul_symbolic_start'
; CHECK-NEXT: Determining loop execution counts for: @smul_symbolic_start
; CHECK-NEXT: Loop %for.body: Unpredictable backedge-taken count.
@@ -315,7 +315,7 @@ define void @smul_symbolic_start(i16 %start) {
; CHECK-NEXT: Loop %for.body: Unpredictable symbolic max backedge-taken count.
;
entry:
- br i1 undef, label %for.end, label %for.body.preheader
+ br i1 %arg, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
br label %for.body
@@ -331,7 +331,7 @@ for.end: ; preds = %for.body, %entry
ret void
}
-define void @umul_symbolic_start(i16 %start) {
+define void @umul_symbolic_start(i16 %start, i1 %arg) {
; CHECK-LABEL: 'umul_symbolic_start'
; CHECK-NEXT: Determining loop execution counts for: @umul_symbolic_start
; CHECK-NEXT: Loop %for.body: Unpredictable backedge-taken count.
@@ -339,7 +339,7 @@ define void @umul_symbolic_start(i16 %start) {
; CHECK-NEXT: Loop %for.body: Unpredictable symbolic max backedge-taken count.
;
entry:
- br i1 undef, label %for.end, label %for.body.preheader
+ br i1 %arg, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
br label %for.body
@@ -355,7 +355,7 @@ for.end: ; preds = %for.body, %entry
ret void
}
-define void @sadd_symbolic_non_latch(i16 %start) {
+define void @sadd_symbolic_non_latch(i16 %start, i1 %arg) {
; CHECK-LABEL: 'sadd_symbolic_non_latch'
; CHECK-NEXT: Determining loop execution counts for: @sadd_symbolic_non_latch
; CHECK-NEXT: Loop %for.body: <multiple exits> backedge-taken count is ((230 + (-1 * %start)) umin (32767 + (-1 * %start)))
@@ -368,7 +368,7 @@ define void @sadd_symbolic_non_latch(i16 %start) {
; CHECK-NEXT: Loop %for.body: Trip multiple is 1
;
entry:
- br i1 undef, label %for.end, label %for.body.preheader
+ br i1 %arg, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
br label %for.body
diff --git a/llvm/test/Analysis/ScalarEvolution/pointer-sign-bits.ll b/llvm/test/Analysis/ScalarEvolution/pointer-sign-bits.ll
index bfd43c82d3a071..02fc2196fb6f90 100644
--- a/llvm/test/Analysis/ScalarEvolution/pointer-sign-bits.ll
+++ b/llvm/test/Analysis/ScalarEvolution/pointer-sign-bits.ll
@@ -3,9 +3,9 @@
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
%JavaObject = type { ptr, ptr }
-define void @JnJVM_antlr_CSharpCodeGenerator_genBitSet__Lantlr_collections_impl_BitSet_2I(ptr, ptr, i32) {
+define void @JnJVM_antlr_CSharpCodeGenerator_genBitSet__Lantlr_collections_impl_BitSet_2I(ptr, ptr, i32, i1 %arg) {
start:
- br i1 undef, label %"stack overflow", label %"no stack overflow"
+ br i1 %arg, label %"stack overflow", label %"no stack overflow"
"GOTO or IF*2": ; preds = %"true verifyAndComputePtr89", %verifyNullCont84
unreachable
@@ -27,151 +27,151 @@ end: ; preds = %"no exception block35"
ret void
"no stack overflow": ; preds = %start
- br i1 undef, label %verifyNullCont, label %"no stack overflow.end_crit_edge"
+ br i1 %arg, label %verifyNullCont, label %"no stack overflow.end_crit_edge"
"no stack overflow.end_crit_edge": ; preds = %"no stack overflow"
ret void
verifyNullCont: ; preds = %"no stack overflow"
- br i1 undef, label %verifyNullCont9, label %verifyNullCont.end_crit_edge
+ br i1 %arg, label %verifyNullCont9, label %verifyNullCont.end_crit_edge
verifyNullCont.end_crit_edge: ; preds = %verifyNullCont
ret void
verifyNullCont9: ; preds = %verifyNullCont
- br i1 undef, label %verifyNullCont12, label %verifyNullCont9.end_crit_edge
+ br i1 %arg, label %verifyNullCont12, label %verifyNullCont9.end_crit_edge
verifyNullCont9.end_crit_edge: ; preds = %verifyNullCont9
ret void
verifyNullCont12: ; preds = %verifyNullCont9
- br i1 undef, label %"no exception block13", label %verifyNullCont12.end_crit_edge
+ br i1 %arg, label %"no exception block13", label %verifyNullCont12.end_crit_edge
verifyNullCont12.end_crit_edge: ; preds = %verifyNullCont12
ret void
"no exception block13": ; preds = %verifyNullCont12
- br i1 undef, label %verifyNullExit14, label %verifyNullCont15
+ br i1 %arg, label %verifyNullExit14, label %verifyNullCont15
verifyNullExit14: ; preds = %"no exception block13"
ret void
verifyNullCont15: ; preds = %"no exception block13"
- br i1 undef, label %"no exception block16", label %verifyNullCont15.end_crit_edge
+ br i1 %arg, label %"no exception block16", label %verifyNullCont15.end_crit_edge
verifyNullCont15.end_crit_edge: ; preds = %verifyNullCont15
ret void
"no exception block16": ; preds = %verifyNullCont15
- br i1 undef, label %verifyNullExit17, label %verifyNullCont18
+ br i1 %arg, label %verifyNullExit17, label %verifyNullCont18
verifyNullExit17: ; preds = %"no exception block16"
ret void
verifyNullCont18: ; preds = %"no exception block16"
- br i1 undef, label %"no exception block19", label %verifyNullCont18.end_crit_edge
+ br i1 %arg, label %"no exception block19", label %verifyNullCont18.end_crit_edge
verifyNullCont18.end_crit_edge: ; preds = %verifyNullCont18
ret void
"no exception block19": ; preds = %verifyNullCont18
- br i1 undef, label %verifyNullExit20, label %verifyNullCont21
+ br i1 %arg, label %verifyNullExit20, label %verifyNullCont21
verifyNullExit20: ; preds = %"no exception block19"
ret void
verifyNullCont21: ; preds = %"no exception block19"
- br i1 undef, label %verifyNullCont24, label %verifyNullCont21.end_crit_edge
+ br i1 %arg, label %verifyNullCont24, label %verifyNullCont21.end_crit_edge
verifyNullCont21.end_crit_edge: ; preds = %verifyNullCont21
ret void
verifyNullCont24: ; preds = %verifyNullCont21
- br i1 undef, label %verifyNullCont27, label %verifyNullCont24.end_crit_edge
+ br i1 %arg, label %verifyNullCont27, label %verifyNullCont24.end_crit_edge
verifyNullCont24.end_crit_edge: ; preds = %verifyNullCont24
ret void
verifyNullCont27: ; preds = %verifyNullCont24
- br i1 undef, label %verifyNullCont32, label %verifyNullCont27.end_crit_edge
+ br i1 %arg, label %verifyNullCont32, label %verifyNullCont27.end_crit_edge
verifyNullCont27.end_crit_edge: ; preds = %verifyNullCont27
ret void
verifyNullCont32: ; preds = %verifyNullCont27
- br i1 undef, label %verifyNullExit33, label %verifyNullCont34
+ br i1 %arg, label %verifyNullExit33, label %verifyNullCont34
verifyNullExit33: ; preds = %verifyNullCont32
ret void
verifyNullCont34: ; preds = %verifyNullCont32
- br i1 undef, label %"no exception block35", label %verifyNullCont34.end_crit_edge
+ br i1 %arg, label %"no exception block35", label %verifyNullCont34.end_crit_edge
verifyNullCont34.end_crit_edge: ; preds = %verifyNullCont34
ret void
"no exception block35": ; preds = %verifyNullCont34
- br i1 undef, label %end, label %verifyNullCont60
+ br i1 %arg, label %end, label %verifyNullCont60
verifyNullCont60: ; preds = %"no exception block35"
- br i1 undef, label %verifyNullCont63, label %verifyNullCont60.end_crit_edge
+ br i1 %arg, label %verifyNullCont63, label %verifyNullCont60.end_crit_edge
verifyNullCont60.end_crit_edge: ; preds = %verifyNullCont60
ret void
verifyNullCont63: ; preds = %verifyNullCont60
- br i1 undef, label %"no exception block64", label %verifyNullCont63.end_crit_edge
+ br i1 %arg, label %"no exception block64", label %verifyNullCont63.end_crit_edge
verifyNullCont63.end_crit_edge: ; preds = %verifyNullCont63
ret void
"no exception block64": ; preds = %verifyNullCont63
- br i1 undef, label %verifyNullExit65, label %verifyNullCont66
+ br i1 %arg, label %verifyNullExit65, label %verifyNullCont66
verifyNullExit65: ; preds = %"no exception block64"
ret void
verifyNullCont66: ; preds = %"no exception block64"
- br i1 undef, label %"no exception block67", label %verifyNullCont66.end_crit_edge
+ br i1 %arg, label %"no exception block67", label %verifyNullCont66.end_crit_edge
verifyNullCont66.end_crit_edge: ; preds = %verifyNullCont66
ret void
"no exception block67": ; preds = %verifyNullCont66
- br i1 undef, label %verifyNullExit68, label %verifyNullCont69
+ br i1 %arg, label %verifyNullExit68, label %verifyNullCont69
verifyNullExit68: ; preds = %"no exception block67"
ret void
verifyNullCont69: ; preds = %"no exception block67"
- br i1 undef, label %"no exception block70", label %verifyNullCont69.end_crit_edge
+ br i1 %arg, label %"no exception block70", label %verifyNullCont69.end_crit_edge
verifyNullCont69.end_crit_edge: ; preds = %verifyNullCont69
ret void
"no exception block70": ; preds = %verifyNullCont69
- br i1 undef, label %verifyNullExit71, label %verifyNullCont72
+ br i1 %arg, label %verifyNullExit71, label %verifyNullCont72
verifyNullExit71: ; preds = %"no exception block70"
ret void
verifyNullCont72: ; preds = %"no exception block70"
- br i1 undef, label %verifyNullCont75, label %verifyNullCont72.end_crit_edge
+ br i1 %arg, label %verifyNullCont75, label %verifyNullCont72.end_crit_edge
verifyNullCont72.end_crit_edge: ; preds = %verifyNullCont72
ret void
verifyNullCont75: ; preds = %verifyNullCont72
- br i1 undef, label %verifyNullCont78, label %verifyNullCont75.end_crit_edge
+ br i1 %arg, label %verifyNullCont78, label %verifyNullCont75.end_crit_edge
verifyNullCont75.end_crit_edge: ; preds = %verifyNullCont75
ret void
verifyNullCont78: ; preds = %verifyNullCont75
- br i1 undef, label %"verifyNullCont78.GOTO or IF*4_crit_edge", label %verifyNullCont78.end_crit_edge
+ br i1 %arg, label %"verifyNullCont78.GOTO or IF*4_crit_edge", label %verifyNullCont78.end_crit_edge
"verifyNullCont78.GOTO or IF*4_crit_edge": ; preds = %verifyNullCont78
- br i1 undef, label %verifyNullExit80, label %verifyNullCont81
+ br i1 %arg, label %verifyNullExit80, label %verifyNullCont81
verifyNullCont78.end_crit_edge: ; preds = %verifyNullCont78
ret void
@@ -185,28 +185,28 @@ verifyNullCont81: ; preds = %"verifyNullCont78.GOTO or IF*4_crit_e
br i1 %5, label %verifyNullCont84, label %verifyNullCont172
verifyNullCont84: ; preds = %verifyNullCont81
- br i1 undef, label %"GOTO or IF*2", label %verifyNullCont86
+ br i1 %arg, label %"GOTO or IF*2", label %verifyNullCont86
verifyNullCont86: ; preds = %verifyNullCont84
- br i1 undef, label %"true verifyAndComputePtr", label %"false verifyAndComputePtr"
+ br i1 %arg, label %"true verifyAndComputePtr", label %"false verifyAndComputePtr"
"true verifyAndComputePtr": ; preds = %verifyNullCont86
- br i1 undef, label %"true verifyAndComputePtr89", label %"false verifyAndComputePtr90"
+ br i1 %arg, label %"true verifyAndComputePtr89", label %"false verifyAndComputePtr90"
"false verifyAndComputePtr": ; preds = %verifyNullCont86
ret void
"true verifyAndComputePtr89": ; preds = %"true verifyAndComputePtr"
- br i1 undef, label %"GOTO or IF*6", label %"GOTO or IF*2"
+ br i1 %arg, label %"GOTO or IF*6", label %"GOTO or IF*2"
"false verifyAndComputePtr90": ; preds = %"true verifyAndComputePtr"
ret void
verifyNullCont126: ; preds = %"GOTO or IF*6"
- br i1 undef, label %"true verifyAndComputePtr127", label %"false verifyAndComputePtr128"
+ br i1 %arg, label %"true verifyAndComputePtr127", label %"false verifyAndComputePtr128"
"true verifyAndComputePtr127": ; preds = %verifyNullCont126
- br i1 undef, label %"true verifyAndComputePtr131.GOTO or IF*6_crit_edge", label %"GOTO or IF*5"
+ br i1 %arg, label %"true verifyAndComputePtr131.GOTO or IF*6_crit_edge", label %"GOTO or IF*5"
"false verifyAndComputePtr128": ; preds = %verifyNullCont126
ret void
diff --git a/llvm/test/Analysis/ScalarEvolution/pr22674.ll b/llvm/test/Analysis/ScalarEvolution/pr22674.ll
index f175b1b3602306..95f96ca17e7639 100644
--- a/llvm/test/Analysis/ScalarEvolution/pr22674.ll
+++ b/llvm/test/Analysis/ScalarEvolution/pr22674.ll
@@ -11,12 +11,12 @@ target triple = "x86_64-pc-linux-gnux32"
%"class.llvm::AttributeImpl.2.1802.3601.5914.6685.7456.8227.9255.9769.10026.18508" = type <{ ptr, %"class.llvm::FoldingSetImpl::Node.1.1801.3600.5913.6684.7455.8226.9254.9768.10025.18505", i8, [3 x i8] }>
; Function Attrs: nounwind uwtable
-define void @_ZNK4llvm11AttrBuilder13hasAttributesENS_12AttributeSetEy() #0 align 2 {
+define void @_ZNK4llvm11AttrBuilder13hasAttributesENS_12AttributeSetEy(i1 %arg) #0 align 2 {
entry:
- br i1 undef, label %cond.false, label %_ZNK4llvm12AttributeSet11getNumSlotsEv.exit
+ br i1 %arg, label %cond.false, label %_ZNK4llvm12AttributeSet11getNumSlotsEv.exit
_ZNK4llvm12AttributeSet11getNumSlotsEv.exit: ; preds = %entry
- br i1 undef, label %cond.false, label %for.body.lr.ph.for.body.lr.ph.split_crit_edge
+ br i1 %arg, label %cond.false, label %for.body.lr.ph.for.body.lr.ph.split_crit_edge
for.body.lr.ph.for.body.lr.ph.split_crit_edge: ; preds = %_ZNK4llvm12AttributeSet11getNumSlotsEv.exit
br label %land.lhs.true.i
@@ -30,15 +30,15 @@ cond.false.i.split: ; preds = %land.lhs.true.i
unreachable
_ZNK4llvm12AttributeSet12getSlotIndexEj.exit: ; preds = %land.lhs.true.i
- br i1 undef, label %for.end, label %for.inc
+ br i1 %arg, label %for.end, label %for.inc
for.inc: ; preds = %_ZNK4llvm12AttributeSet12getSlotIndexEj.exit
%inc = add i32 %I.099, 1
- br i1 undef, label %cond.false, label %land.lhs.true.i
+ br i1 %arg, label %cond.false, label %land.lhs.true.i
for.end: ; preds = %_ZNK4llvm12AttributeSet12getSlotIndexEj.exit
%I.099.lcssa129 = phi i32 [ %I.099, %_ZNK4llvm12AttributeSet12getSlotIndexEj.exit ]
- br i1 undef, label %cond.false, label %_ZNK4llvm12AttributeSet3endEj.exit
+ br i1 %arg, label %cond.false, label %_ZNK4llvm12AttributeSet3endEj.exit
cond.false: ; preds = %for.end, %for.inc, %_ZNK4llvm12AttributeSet11getNumSlotsEv.exit, %entry
unreachable
@@ -49,7 +49,7 @@ _ZNK4llvm12AttributeSet3endEj.exit: ; preds = %for.end
%NumAttrs.i.i.i = getelementptr inbounds %"class.llvm::AttributeSetNode.230.2029.3828.6141.6912.7683.8454.9482.9996.10253.18506", ptr %0, i32 0, i32 1
%1 = load i32, ptr %NumAttrs.i.i.i, align 4, !tbaa !8
%add.ptr.i.i.i55 = getelementptr inbounds %"class.llvm::Attribute.222.2021.3820.6133.6904.7675.8446.9474.9988.10245.18509", ptr undef, i32 %1
- br i1 undef, label %return, label %for.body11
+ br i1 %arg, label %return, label %for.body11
for.cond9: ; preds = %_ZNK4llvm9Attribute13getKindAsEnumEv.exit
%cmp10 = icmp eq ptr %incdec.ptr, %add.ptr.i.i.i55
@@ -70,7 +70,7 @@ _ZNK4llvm9Attribute15isEnumAttributeEv.exit: ; preds = %for.body11
_ZNK4llvm9Attribute13getKindAsEnumEv.exit: ; preds = %_ZNK4llvm9Attribute15isEnumAttributeEv.exit, %_ZNK4llvm9Attribute15isEnumAttributeEv.exit
%incdec.ptr = getelementptr inbounds %"class.llvm::Attribute.222.2021.3820.6133.6904.7675.8446.9474.9988.10245.18509", ptr %I5.096, i32 1
- br i1 undef, label %for.cond9, label %return
+ br i1 %arg, label %for.cond9, label %return
cond.false21: ; preds = %_ZNK4llvm9Attribute15isEnumAttributeEv.exit, %for.body11
unreachable
diff --git a/llvm/test/Analysis/ScalarEvolution/pr22856.ll b/llvm/test/Analysis/ScalarEvolution/pr22856.ll
index 89e83516efdddd..52a67876487454 100644
--- a/llvm/test/Analysis/ScalarEvolution/pr22856.ll
+++ b/llvm/test/Analysis/ScalarEvolution/pr22856.ll
@@ -3,17 +3,17 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64--linux-gnu"
-define void @unbounded() {
+define void @unbounded(i1 %arg) {
block_A:
%0 = sext i32 undef to i64
- br i1 undef, label %block_F, label %block_G
+ br i1 %arg, label %block_F, label %block_G
block_C: ; preds = %block_F
- br i1 undef, label %block_D, label %block_E
+ br i1 %arg, label %block_D, label %block_E
block_D: ; preds = %block_D, %block_C
- br i1 undef, label %block_E, label %block_D
+ br i1 %arg, label %block_E, label %block_D
block_E: ; preds = %block_D, %block_C
%iv2 = phi i64 [ %4, %block_D ], [ %4, %block_C ]
diff --git a/llvm/test/Analysis/ScalarEvolution/pr25369.ll b/llvm/test/Analysis/ScalarEvolution/pr25369.ll
index 5783ef24b8a0a0..e2524de3161ad8 100644
--- a/llvm/test/Analysis/ScalarEvolution/pr25369.ll
+++ b/llvm/test/Analysis/ScalarEvolution/pr25369.ll
@@ -4,7 +4,7 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
-define void @hoge1() {
+define void @hoge1(i1 %arg) {
;
; CHECK-LABEL: 'hoge1'
; CHECK-NEXT: Determining loop execution counts for: @hoge1
@@ -21,7 +21,7 @@ define void @hoge1() {
; CHECK-NEXT: Loop %bb2: Unpredictable symbolic max backedge-taken count.
;
bb:
- br i1 undef, label %bb4, label %bb2
+ br i1 %arg, label %bb4, label %bb2
bb2: ; preds = %bb2, %bb
br i1 false, label %bb4, label %bb2
@@ -53,7 +53,7 @@ bb18: ; preds = %bb13
ret void
}
-define void @hoge2() {
+define void @hoge2(i1 %arg) {
;
; CHECK-LABEL: 'hoge2'
; CHECK-NEXT: Determining loop execution counts for: @hoge2
@@ -69,7 +69,7 @@ define void @hoge2() {
; CHECK-NEXT: Loop %bb2: Unpredictable symbolic max backedge-taken count.
;
bb:
- br i1 undef, label %bb4, label %bb2
+ br i1 %arg, label %bb4, label %bb2
bb2: ; preds = %bb2, %bb
br i1 false, label %bb4, label %bb2
diff --git a/llvm/test/Analysis/ScalarEvolution/scev-aa.ll b/llvm/test/Analysis/ScalarEvolution/scev-aa.ll
index 5610833e9c4745..a1d3699b3cb4b8 100644
--- a/llvm/test/Analysis/ScalarEvolution/scev-aa.ll
+++ b/llvm/test/Analysis/ScalarEvolution/scev-aa.ll
@@ -223,7 +223,7 @@ for.end: ; preds = %for.body, %entry
; different loops where neither dominates the other. This used to crash
; because we expected the arguments to an AddExpr to have a strict
; dominance order.
-define void @test_no_dom(ptr %data) {
+define void @test_no_dom(ptr %data, i1 %arg) {
entry:
load double, ptr %data
br label %for.body
@@ -231,7 +231,7 @@ entry:
for.body:
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.latch ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
- br i1 undef, label %subloop1, label %subloop2
+ br i1 %arg, label %subloop1, label %subloop2
subloop1:
%iv1 = phi i32 [0, %for.body], [%iv1.next, %subloop1]
@@ -266,7 +266,7 @@ declare ptr @get_addr(i32 %i)
; In this case, checking %addr1 and %add2 involves two addrecs in two
; different loops where neither dominates the other. This is analogous
; to test_no_dom, but involves SCEVUnknown as opposed to SCEVAddRecExpr.
-define void @test_no_dom2(ptr %data) {
+define void @test_no_dom2(ptr %data, i1 %arg) {
entry:
load double, ptr %data
br label %for.body
@@ -274,7 +274,7 @@ entry:
for.body:
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.latch ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
- br i1 undef, label %subloop1, label %subloop2
+ br i1 %arg, label %subloop1, label %subloop2
subloop1:
%iv1 = phi i32 [0, %for.body], [%iv1.next, %subloop1]
diff --git a/llvm/test/Analysis/ScalarEvolution/scev-canonical-mode.ll b/llvm/test/Analysis/ScalarEvolution/scev-canonical-mode.ll
index 18df75e290861e..3879b2e71851aa 100644
--- a/llvm/test/Analysis/ScalarEvolution/scev-canonical-mode.ll
+++ b/llvm/test/Analysis/ScalarEvolution/scev-canonical-mode.ll
@@ -6,12 +6,12 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
; Function Attrs: norecurse nounwind uwtable
-define void @ehF() #0 {
+define void @ehF(i1 %arg) #0 {
entry:
- br i1 undef, label %if.then.i, label %hup.exit
+ br i1 %arg, label %if.then.i, label %hup.exit
if.then.i: ; preds = %entry
- br i1 undef, label %for.body.lr.ph.i, label %hup.exit
+ br i1 %arg, label %for.body.lr.ph.i, label %hup.exit
for.body.lr.ph.i: ; preds = %if.then.i
br label %for.body.i
diff --git a/llvm/test/Analysis/ScalarEvolution/scev-invalid.ll b/llvm/test/Analysis/ScalarEvolution/scev-invalid.ll
index 1afc3e175c3ae7..fe2402bec9309b 100644
--- a/llvm/test/Analysis/ScalarEvolution/scev-invalid.ll
+++ b/llvm/test/Analysis/ScalarEvolution/scev-invalid.ll
@@ -15,13 +15,13 @@
; CHECK-NOT: phi
; CHECK-NOT: icmp
; CHECK: ret void
-define void @test() {
+define void @test(i1 %arg) {
entry:
%xor1 = xor i32 0, 1
br label %b17
b17:
- br i1 undef, label %b22, label %b18
+ br i1 %arg, label %b22, label %b18
b18:
%phi1 = phi i32 [ %add1, %b18 ], [ %xor1, %b17 ]
diff --git a/llvm/test/Analysis/ScalarEvolution/shift-recurrences.ll b/llvm/test/Analysis/ScalarEvolution/shift-recurrences.ll
index 9806fd3d57f623..6cd709bfff68f3 100644
--- a/llvm/test/Analysis/ScalarEvolution/shift-recurrences.ll
+++ b/llvm/test/Analysis/ScalarEvolution/shift-recurrences.ll
@@ -1,7 +1,7 @@
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
; RUN: opt -disable-output "-passes=print<scalar-evolution>" < %s 2>&1 | FileCheck %s
-define void @test_lshr() {
+define void @test_lshr(i1 %arg) {
; CHECK-LABEL: 'test_lshr'
; CHECK-NEXT: Classifying expressions for: @test_lshr
; CHECK-NEXT: %iv.lshr = phi i64 [ 1023, %entry ], [ %iv.lshr.next, %loop ]
@@ -18,13 +18,13 @@ entry:
loop:
%iv.lshr = phi i64 [1023, %entry], [%iv.lshr.next, %loop]
%iv.lshr.next = lshr i64 %iv.lshr, 1
- br i1 undef, label %exit, label %loop
+ br i1 %arg, label %exit, label %loop
exit:
ret void
}
; Deliberate overflow doesn't change range
-define void @test_lshr2() {
+define void @test_lshr2(i1 %arg) {
; CHECK-LABEL: 'test_lshr2'
; CHECK-NEXT: Classifying expressions for: @test_lshr2
; CHECK-NEXT: %iv.lshr = phi i64 [ 1023, %entry ], [ %iv.lshr.next, %loop ]
@@ -41,13 +41,13 @@ entry:
loop:
%iv.lshr = phi i64 [1023, %entry], [%iv.lshr.next, %loop]
%iv.lshr.next = lshr i64 %iv.lshr, 4
- br i1 undef, label %exit, label %loop
+ br i1 %arg, label %exit, label %loop
exit:
ret void
}
-define void @test_ashr_zeros() {
+define void @test_ashr_zeros(i1 %arg) {
; CHECK-LABEL: 'test_ashr_zeros'
; CHECK-NEXT: Classifying expressions for: @test_ashr_zeros
; CHECK-NEXT: %iv.ashr = phi i64 [ 1023, %entry ], [ %iv.ashr.next, %loop ]
@@ -64,12 +64,12 @@ entry:
loop:
%iv.ashr = phi i64 [1023, %entry], [%iv.ashr.next, %loop]
%iv.ashr.next = ashr i64 %iv.ashr, 1
- br i1 undef, label %exit, label %loop
+ br i1 %arg, label %exit, label %loop
exit:
ret void
}
-define void @test_ashr_ones() {
+define void @test_ashr_ones(i1 %arg) {
; CHECK-LABEL: 'test_ashr_ones'
; CHECK-NEXT: Classifying expressions for: @test_ashr_ones
; CHECK-NEXT: %iv.ashr = phi i64 [ -1023, %entry ], [ %iv.ashr.next, %loop ]
@@ -86,13 +86,13 @@ entry:
loop:
%iv.ashr = phi i64 [-1023, %entry], [%iv.ashr.next, %loop]
%iv.ashr.next = ashr i64 %iv.ashr, 1
- br i1 undef, label %exit, label %loop
+ br i1 %arg, label %exit, label %loop
exit:
ret void
}
; Same as previous, but swapped operands to phi
-define void @test_ashr_ones2() {
+define void @test_ashr_ones2(i1 %arg) {
; CHECK-LABEL: 'test_ashr_ones2'
; CHECK-NEXT: Classifying expressions for: @test_ashr_ones2
; CHECK-NEXT: %iv.ashr = phi i64 [ %iv.ashr.next, %loop ], [ -1023, %entry ]
@@ -109,14 +109,14 @@ entry:
loop:
%iv.ashr = phi i64 [%iv.ashr.next, %loop], [-1023, %entry]
%iv.ashr.next = ashr i64 %iv.ashr, 1
- br i1 undef, label %exit, label %loop
+ br i1 %arg, label %exit, label %loop
exit:
ret void
}
; negative case for when start is unknown
-define void @test_ashr_unknown(i64 %start) {
+define void @test_ashr_unknown(i64 %start, i1 %arg) {
; CHECK-LABEL: 'test_ashr_unknown'
; CHECK-NEXT: Classifying expressions for: @test_ashr_unknown
; CHECK-NEXT: %iv.ashr = phi i64 [ %start, %entry ], [ %iv.ashr.next, %loop ]
@@ -133,14 +133,14 @@ entry:
loop:
%iv.ashr = phi i64 [%start, %entry], [%iv.ashr.next, %loop]
%iv.ashr.next = ashr i64 %iv.ashr, 1
- br i1 undef, label %exit, label %loop
+ br i1 %arg, label %exit, label %loop
exit:
ret void
}
; Negative case where we don't have a (shift) recurrence because the operands
; of the ashr are swapped. (This does end up being a divide recurrence.)
-define void @test_ashr_wrong_op(i64 %start) {
+define void @test_ashr_wrong_op(i64 %start, i1 %arg) {
; CHECK-LABEL: 'test_ashr_wrong_op'
; CHECK-NEXT: Classifying expressions for: @test_ashr_wrong_op
; CHECK-NEXT: %iv.ashr = phi i64 [ %start, %entry ], [ %iv.ashr.next, %loop ]
@@ -157,13 +157,13 @@ entry:
loop:
%iv.ashr = phi i64 [%start, %entry], [%iv.ashr.next, %loop]
%iv.ashr.next = ashr i64 1, %iv.ashr
- br i1 undef, label %exit, label %loop
+ br i1 %arg, label %exit, label %loop
exit:
ret void
}
-define void @test_shl() {
+define void @test_shl(i1 %arg) {
; CHECK-LABEL: 'test_shl'
; CHECK-NEXT: Classifying expressions for: @test_shl
; CHECK-NEXT: %iv.shl = phi i64 [ 8, %entry ], [ %iv.shl.next, %loop ]
@@ -180,13 +180,13 @@ entry:
loop:
%iv.shl = phi i64 [8, %entry], [%iv.shl.next, %loop]
%iv.shl.next = shl i64 %iv.shl, 1
- br i1 undef, label %exit, label %loop
+ br i1 %arg, label %exit, label %loop
exit:
ret void
}
; use trip count to refine
-define void @test_shl2() {
+define void @test_shl2(i1 %arg) {
; CHECK-LABEL: 'test_shl2'
; CHECK-NEXT: Classifying expressions for: @test_shl2
; CHECK-NEXT: %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
@@ -251,7 +251,7 @@ exit:
}
; edge case on max value not overflowing
-define void @test_shl4() {
+define void @test_shl4(i1 %arg) {
; CHECK-LABEL: 'test_shl4'
; CHECK-NEXT: Classifying expressions for: @test_shl4
; CHECK-NEXT: %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
@@ -282,7 +282,7 @@ exit:
}
; other side of edge case from previous test
-define void @test_shl5() {
+define void @test_shl5(i1 %arg) {
; CHECK-LABEL: 'test_shl5'
; CHECK-NEXT: Classifying expressions for: @test_shl5
; CHECK-NEXT: %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
@@ -379,7 +379,7 @@ exit:
; Corner case where phi is not in a loop because it is in unreachable
; code (which loopinfo ignores, but simple recurrence matching does not).
-define void @unreachable_phi() {
+define void @unreachable_phi(i1 %arg) {
; CHECK-LABEL: 'unreachable_phi'
; CHECK-NEXT: Classifying expressions for: @unreachable_phi
; CHECK-NEXT: %p_58.addr.1 = phi i32 [ undef, %unreachable1 ], [ %sub2629, %unreachable2 ]
@@ -403,7 +403,7 @@ unreachable_nonloop:
; Corner case where phi is not in loop header because binop is in unreachable
; code (which loopinfo ignores, but simple recurrence matching does not).
-define void @unreachable_binop() {
+define void @unreachable_binop(i1 %arg) {
; CHECK-LABEL: 'unreachable_binop'
; CHECK-NEXT: Classifying expressions for: @unreachable_binop
; CHECK-NEXT: %p_58.addr.1 = phi i32 [ undef, %header ], [ %sub2629, %unreachable ]
@@ -423,7 +423,7 @@ header:
for.cond2295:
%p_58.addr.1 = phi i32 [ undef, %header ], [ %sub2629, %unreachable ]
- br i1 undef, label %if.then2321, label %header
+ br i1 %arg, label %if.then2321, label %header
if.then2321:
ret void
diff --git a/llvm/test/Analysis/ValueTracking/memory-dereferenceable.ll b/llvm/test/Analysis/ValueTracking/memory-dereferenceable.ll
index 7a976fa7c0f81b..3da1aaa8a68a86 100644
--- a/llvm/test/Analysis/ValueTracking/memory-dereferenceable.ll
+++ b/llvm/test/Analysis/ValueTracking/memory-dereferenceable.ll
@@ -25,7 +25,7 @@ declare ptr @foo()
; CHECK-LABEL: 'test_sret'
; CHECK: %sret_gep{{.*}}(aligned)
; CHECK-NOT: %sret_gep_outside
-define void @test_sret(ptr sret(%struct.A) %result) {
+define void @test_sret(ptr sret(%struct.A) %result, i1 %arg) {
%sret_gep = getelementptr inbounds %struct.A, ptr %result, i64 0, i32 1, i64 2
load i8, ptr %sret_gep
@@ -287,10 +287,10 @@ define void @infer_noalias2(ptr dereferenceable(8) noalias readonly %p) nosync {
; Just check that we don't crash.
; CHECK-LABEL: 'opaque_type_crasher'
-define void @opaque_type_crasher(ptr dereferenceable(16) %a) {
+define void @opaque_type_crasher(ptr dereferenceable(16) %a, i1 %arg) {
entry:
%ptr8 = getelementptr inbounds i8, ptr %a, i32 8
- br i1 undef, label %if.then, label %if.end
+ br i1 %arg, label %if.then, label %if.end
if.then:
%res = load i32, ptr %ptr8, align 4
>From b08f8d97e7661e9d39b6fbac6af857c26050178b Mon Sep 17 00:00:00 2001
From: Lee <lee10202013 at gmail.com>
Date: Wed, 6 Nov 2024 16:36:32 -0700
Subject: [PATCH 10/10] Replace branches with poison
This test is a crash test, which generates different code for
well defined-branches. The original approach with replacing undef with
a new function argument may break some tests coverage. However, LLVM
will not support undef in the long run. Thus, we replaced
the original undef branches with poison, so that we remove undef and
also keep the test coverage.
---
llvm/test/DebugInfo/X86/earlydup-crash.ll | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/llvm/test/DebugInfo/X86/earlydup-crash.ll b/llvm/test/DebugInfo/X86/earlydup-crash.ll
index be67e0f67023c9..a83a4ae69708a2 100644
--- a/llvm/test/DebugInfo/X86/earlydup-crash.ll
+++ b/llvm/test/DebugInfo/X86/earlydup-crash.ll
@@ -6,15 +6,15 @@
declare void @llvm.dbg.value(metadata, metadata, metadata) nounwind readnone
-define internal ptr @framework_construct_pathname(ptr %fname, ptr %dir, i1 %arg) nounwind ssp !dbg !2 {
+define internal ptr @framework_construct_pathname(ptr %fname, ptr %dir) nounwind ssp !dbg !2 {
entry:
- br i1 %arg, label %bb33, label %bb
+ br i1 poison, label %bb33, label %bb
bb: ; preds = %entry
%tmp = icmp eq i32 undef, 0
%tmp1 = add i32 0, 11
call void @llvm.dbg.value(metadata i32 %tmp1, metadata !0, metadata !DIExpression()), !dbg !DILocation(scope: !1)
- br i1 %arg, label %bb18, label %bb31.preheader
+ br i1 poison, label %bb18, label %bb31.preheader
bb31.preheader: ; preds = %bb19, %bb
br label %bb31
@@ -30,7 +30,7 @@ bb19: ; preds = %bb18
bb22: ; preds = %bb31
%tmp4 = add i32 0, %tmp1
call void @foobar(i32 %tmp4)
- br i1 %arg, label %bb33, label %bb31
+ br i1 poison, label %bb33, label %bb31
bb31: ; preds = %bb22, %bb31.preheader
br i1 false, label %bb33, label %bb22
More information about the llvm-commits
mailing list