diff --git a/llvm/test/Analysis/BasicAA/phi-values-usage.ll b/llvm/test/Analysis/BasicAA/phi-values-usage.ll --- a/llvm/test/Analysis/BasicAA/phi-values-usage.ll +++ b/llvm/test/Analysis/BasicAA/phi-values-usage.ll @@ -20,10 +20,10 @@ ; 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 %replace_undef_0) personality ptr @__gxx_personality_v0 { entry: %arr = alloca [4 x i8], align 8 - br i1 undef, label %then, label %if + br i1 %replace_undef_0, label %then, label %if if: br label %then @@ -50,7 +50,7 @@ ; 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 %replace_undef_0) { entry: %a = alloca i8, align 1 %0 = load ptr, ptr @c, align 1 @@ -58,7 +58,7 @@ 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 %replace_undef_0, 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 --- 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 %replace_undef_0) nounwind { entry: br label %for.cond for.cond: ; preds = %for.cond2, %entry - br i1 undef, label %for.cond2, label %for.end22 + br i1 %replace_undef_0, 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 --- 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(i32* %f) { +define void @fn1(i32* %f, i1 %replace_undef_0, i1 %replace_undef_1) { entry: %tobool7 = icmp eq i32 undef, 0 - br i1 undef, label %if.end.12, label %for.body.5 + br i1 %replace_undef_0, label %if.end.12, label %for.body.5 for.inc: store i32 undef, i32* %f, align 4 @@ -19,7 +19,7 @@ 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 %replace_undef_1, 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 --- a/llvm/test/Analysis/BranchProbabilityInfo/deopt-invoke.ll +++ b/llvm/test/Analysis/BranchProbabilityInfo/deopt-invoke.ll @@ -8,7 +8,7 @@ ; 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 %replace_undef_0) 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 @@ ;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 %replace_undef_0, 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 @@ ret void } -define void @test2(i32 %0) personality ptr @"personality_function" { +define void @test2(i32 %0, i1 %replace_undef_0) 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 @@ ;CHECK: edge land.pad -> exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] entry: - br i1 undef, label %unreached, label %invoke + br i1 %replace_undef_0, label %unreached, label %invoke invoke: invoke void @foo(i32 %0) to label %invoke.cont.cold unwind label %land.pad @@ -68,14 +68,14 @@ ret void } -define void @test3(i32 %0) personality ptr @"personality_function" { +define void @test3(i32 %0, i1 %replace_undef_0) 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 %replace_undef_0, 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 --- a/llvm/test/Analysis/BranchProbabilityInfo/loop.ll +++ b/llvm/test/Analysis/BranchProbabilityInfo/loop.ll @@ -523,7 +523,7 @@ ; 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 %replace_undef_0, i1 %replace_undef_1) { ; 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 @@ ; CHECK: edge cold -> exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] entry: - br i1 undef, label %loop, label %exit + br i1 %replace_undef_0, 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 %replace_undef_1, label %loop, label %cold cold: call void @cold() @@ -547,7 +547,7 @@ } ; This is the same case as test13 but with additional loop 'preheader' block. -define void @test14() { +define void @test14( i1 %replace_undef_0, i1 %replace_undef_1) { ; 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 @@ ; CHECK: edge cold -> exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] entry: - br i1 undef, label %preheader, label %exit + br i1 %replace_undef_0, label %preheader, label %exit preheader: br label %loop @@ -564,7 +564,7 @@ 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 %replace_undef_1, label %loop, label %cold cold: call void @cold() @@ -576,7 +576,7 @@ ; 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 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2) { ; 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 @@ ; CHECK: edge cold -> exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] entry: - br i1 undef, label %loop, label %exit + br i1 %replace_undef_0, 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 %replace_undef_1, label %cont, label %unreached cont: - br i1 undef, label %loop, label %cold + br i1 %replace_undef_2, label %loop, label %cold unreached: unreachable @@ -609,7 +609,7 @@ } ; This is the same case as test15 but with additional loop 'preheader' block. -define void @test16() { +define void @test16( i1 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2) { ; 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 @@ br label %preheader preheader: - br i1 undef, label %loop, label %exit + br i1 %replace_undef_0, 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 %replace_undef_1, label %cont, label %unreached cont: - br i1 undef, label %loop, label %cold + br i1 %replace_undef_2, label %loop, label %cold unreached: unreachable @@ -649,7 +649,7 @@ ; 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 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2, i1 %replace_undef_3) { ; 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 @@ br label %preheader preheader: - br i1 undef, label %loop, label %exit + br i1 %replace_undef_0, 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 %replace_undef_1, label %cont, label %noreturn cont: - br i1 undef, label %cont2, label %cold + br i1 %replace_undef_2, label %cont2, label %cold cont2: - br i1 undef, label %loop, label %exit + br i1 %replace_undef_3, label %loop, label %exit noreturn: call void @abort() @@ -692,7 +692,7 @@ ; 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 %replace_undef_0, i1 %replace_undef_1) { ; 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 @@ top.loop: %j.0 = phi i32 [ 0, %entry ], [ %j.inc, %cold ] - br i1 undef, label %loop, label %exit + br i1 %replace_undef_0, 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 %replace_undef_1, label %loop, label %cold cold: call void @cold() diff --git a/llvm/test/Analysis/BranchProbabilityInfo/unreachable.ll b/llvm/test/Analysis/BranchProbabilityInfo/unreachable.ll --- a/llvm/test/Analysis/BranchProbabilityInfo/unreachable.ll +++ b/llvm/test/Analysis/BranchProbabilityInfo/unreachable.ll @@ -5,7 +5,7 @@ ; 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 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2) { ;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 @@ ;CHECK: edge r1 -> cold probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] entry: - br i1 undef, label %l1, label %r1 + br i1 %replace_undef_0, label %l1, label %r1 l1: - br i1 undef, label %cold, label %unreached + br i1 %replace_undef_1, label %cold, label %unreached r1: - br i1 undef, label %unreached, label %cold + br i1 %replace_undef_2, label %unreached, label %cold unreached: unreachable @@ -33,7 +33,7 @@ ; 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 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2) { ;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 @@ ;CHECK: edge r1 -> cold probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] entry: - br i1 undef, label %l1, label %r1 + br i1 %replace_undef_0, label %l1, label %r1 l1: - br i1 undef, label %cold, label %cold2 + br i1 %replace_undef_1, label %cold, label %cold2 r1: - br i1 undef, label %unreached, label %cold + br i1 %replace_undef_2, label %unreached, label %cold unreached: unreachable @@ -64,7 +64,7 @@ ; 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 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2) { ;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 @@ ;CHECK: edge r1 -> unreached2 probability is 0x40000000 / 0x80000000 = 50.00% entry: - br i1 undef, label %l1, label %r1 + br i1 %replace_undef_0, label %l1, label %r1 l1: - br i1 undef, label %cold, label %unreached + br i1 %replace_undef_1, label %cold, label %unreached r1: - br i1 undef, label %unreached, label %unreached2 + br i1 %replace_undef_2, label %unreached, label %unreached2 unreached: unreachable @@ -95,7 +95,7 @@ ; 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 %replace_undef_0, i1 %replace_undef_1) { ;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 @@ ;CHECK: edge to.cold -> cold probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] entry: - br i1 undef, label %l1, label %r1 + br i1 %replace_undef_0, label %l1, label %r1 l1: - br i1 undef, label %l2, label %r2 + br i1 %replace_undef_1, label %l2, label %r2 l2: br label %to.cold @@ -128,7 +128,7 @@ } ; Check that most likely path from 'entry' to 'l2' through 'r1' is preferred. -define void @test5(i32 %0) { +define void @test5(i32 %0, i1 %replace_undef_0, i1 %replace_undef_1) { ;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 @@ ;CHECK: edge r1 -> unreached probability is 0x00000000 / 0x80000000 = 0.00% entry: - br i1 undef, label %cold, label %r1 + br i1 %replace_undef_0, label %cold, label %r1 cold: call void @bar() br label %l2 r1: - br i1 undef, label %l2, label %unreached + br i1 %replace_undef_1, label %l2, label %unreached l2: ret void diff --git a/llvm/test/Analysis/CostModel/AMDGPU/control-flow.ll b/llvm/test/Analysis/CostModel/AMDGPU/control-flow.ll --- a/llvm/test/Analysis/CostModel/AMDGPU/control-flow.ll +++ b/llvm/test/Analysis/CostModel/AMDGPU/control-flow.ll @@ -3,21 +3,19 @@ ; RUN: opt -passes="print" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgcn-unknown-amdhsa < %s | FileCheck --check-prefixes=ALL-SIZE %s ; END. -define amdgpu_kernel void @test_br_cost(ptr addrspace(1) %vaddr, i32 %b) #0 { +define amdgpu_kernel void @test_br_cost(ptr addrspace(1) %vaddr, i32 %b, i1 %replace_undef_0) #0 { ; ALL-LABEL: 'test_br_cost' -; ALL-NEXT: Cost Model: Found an estimated cost of 7 for instruction: br i1 undef, label %bb1, label %bb2 ; ALL-NEXT: Cost Model: Found an estimated cost of 4 for instruction: br label %bb2 ; ALL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %phi = phi i32 [ %b, %bb0 ], [ undef, %bb1 ] ; ALL-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void ; ; ALL-SIZE-LABEL: 'test_br_cost' -; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 5 for instruction: br i1 undef, label %bb1, label %bb2 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br label %bb2 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %phi = phi i32 [ %b, %bb0 ], [ undef, %bb1 ] ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; bb0: - br i1 undef, label %bb1, label %bb2 + br i1 %replace_undef_0, label %bb1, label %bb2 bb1: br label %bb2 diff --git a/llvm/test/Analysis/CostModel/SystemZ/intrinsic-cost-crash.ll b/llvm/test/Analysis/CostModel/SystemZ/intrinsic-cost-crash.ll --- a/llvm/test/Analysis/CostModel/SystemZ/intrinsic-cost-crash.ll +++ b/llvm/test/Analysis/CostModel/SystemZ/intrinsic-cost-crash.ll @@ -31,7 +31,7 @@ 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 %replace_undef_0, 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 --- a/llvm/test/Analysis/CycleInfo/basic.ll +++ b/llvm/test/Analysis/CycleInfo/basic.ll @@ -7,36 +7,36 @@ ret void } -define void @simple() { +define void @simple( i1 %replace_undef_0) { ; 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 %replace_undef_0, label %loop, label %exit exit: ret void } -define void @two_latches() { +define void @two_latches( i1 %replace_undef_0, i1 %replace_undef_1) { ; 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 %replace_undef_0, label %loop, label %loop_next loop_next: - br i1 undef, label %exit, label %loop + br i1 %replace_undef_1, label %exit, label %loop exit: ret void } -define void @nested_simple() { +define void @nested_simple( i1 %replace_undef_0, i1 %replace_undef_1) { ; 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 @@ br label %inner inner: - br i1 undef, label %inner, label %outer_latch + br i1 %replace_undef_0, label %inner, label %outer_latch outer_latch: - br i1 undef, label %outer_header, label %exit + br i1 %replace_undef_1, 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 %replace_undef_0, i1 %replace_undef_1) { ; 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 @@ br label %inner_header inner_header: - br i1 undef, label %inner_latch, label %outer_header + br i1 %replace_undef_0, label %inner_latch, label %outer_header inner_latch: - br i1 undef, label %exit, label %inner_header + br i1 %replace_undef_1, label %exit, label %inner_header exit: ret void } -define void @sibling_loops() { +define void @sibling_loops( i1 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2) { ; 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 %replace_undef_0, label %left, label %right left: - br i1 undef, label %left, label %exit + br i1 %replace_undef_1, label %left, label %exit right: - br i1 undef, label %right, label %exit + br i1 %replace_undef_2, label %right, label %exit exit: ret void } -define void @serial_loops() { +define void @serial_loops( i1 %replace_undef_0, i1 %replace_undef_1) { ; CHECK-LABEL: CycleInfo for function: serial_loops ; CHECK-DAG: depth=1: entries(second) ; CHECK-DAG: depth=1: entries(first) @@ -101,16 +101,16 @@ br label %first first: - br i1 undef, label %first, label %second + br i1 %replace_undef_0, label %first, label %second second: - br i1 undef, label %second, label %exit + br i1 %replace_undef_1, label %second, label %exit exit: ret void } -define void @nested_sibling_loops() { +define void @nested_sibling_loops( i1 %replace_undef_0) { ; 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 @@ br label %outer_header outer_header: - br i1 undef, label %left, label %right + br i1 %replace_undef_0, label %left, label %right left: switch i32 undef, label %exit [ i32 0, label %left @@ -133,7 +133,7 @@ ret void } -define void @deeper_nest() { +define void @deeper_nest( i1 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2) { ; 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 @@ br label %inner_header inner_header: - br i1 undef, label %middle_header, label %inner_latch + br i1 %replace_undef_0, label %middle_header, label %inner_latch inner_latch: - br i1 undef, label %inner_header, label %outer_latch + br i1 %replace_undef_1, label %inner_header, label %outer_latch outer_latch: - br i1 undef, label %outer_header, label %exit + br i1 %replace_undef_2, label %outer_header, label %exit exit: ret void } -define void @irreducible_basic() { +define void @irreducible_basic( i1 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2) { ; CHECK-LABEL: CycleInfo for function: irreducible_basic ; CHECK: depth=1: entries(right left) entry: - br i1 undef, label %left, label %right + br i1 %replace_undef_0, label %left, label %right left: - br i1 undef, label %right, label %exit + br i1 %replace_undef_1, label %right, label %exit right: - br i1 undef, label %left, label %exit + br i1 %replace_undef_2, label %left, label %exit exit: ret void } -define void @irreducible_mess() { +define void @irreducible_mess( i1 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2) { ; 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 %replace_undef_0, label %A, label %B A: - br i1 undef, label %C, label %D + br i1 %replace_undef_1, label %C, label %D B: - br i1 undef, label %C, label %D + br i1 %replace_undef_2, label %C, label %D C: switch i32 undef, label %A [ i32 0, label %D @@ -202,7 +202,7 @@ ret void } -define void @irreducible_into_simple_cycle() { +define void @irreducible_into_simple_cycle( i1 %replace_undef_0, i1 %replace_undef_1) { ; CHECK-LABEL: CycleInfo for function: irreducible_into_simple_cycle ; CHECK: depth=1: entries(F C A) E D B entry: @@ -219,28 +219,28 @@ br label %D D: - br i1 undef, label %E, label %exit + br i1 %replace_undef_0, label %E, label %exit E: br label %F F: - br i1 undef, label %A, label %exit + br i1 %replace_undef_1, label %A, label %exit exit: ret void } -define void @irreducible_mountain_bug() { +define void @irreducible_mountain_bug( i1 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2, i1 %replace_undef_3, i1 %replace_undef_4, i1 %replace_undef_5, i1 %replace_undef_6, i1 %replace_undef_7, i1 %replace_undef_8, i1 %replace_undef_9, i1 %replace_undef_10, i1 %replace_undef_11, i1 %replace_undef_12, i1 %replace_undef_13) { ; 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 %replace_undef_0, label %if.end, label %if.then if.end: - br i1 undef, label %if.then7, label %if.else + br i1 %replace_undef_1, label %if.then7, label %if.else if.then7: br label %if.end16 @@ -249,49 +249,49 @@ br label %if.end16 if.end16: - br i1 undef, label %while.cond.preheader, label %if.then39 + br i1 %replace_undef_2, 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 %replace_undef_3, label %cond.true49, label %lor.rhs cond.true49: - br i1 undef, label %if.then69, label %while.body63 + br i1 %replace_undef_4, label %if.then69, label %while.body63 while.body63: - br i1 undef, label %exit, label %while.cond47 + br i1 %replace_undef_5, label %exit, label %while.cond47 while.cond47: - br i1 undef, label %cond.true49, label %cond.end61 + br i1 %replace_undef_6, label %cond.true49, label %cond.end61 cond.end61: - br i1 undef, label %while.body63, label %while.cond + br i1 %replace_undef_7, label %while.body63, label %while.cond if.then69: - br i1 undef, label %exit, label %while.cond + br i1 %replace_undef_8, label %exit, label %while.cond lor.rhs: - br i1 undef, label %cond.end61, label %while.end76 + br i1 %replace_undef_9, label %cond.end61, label %while.end76 while.end76: br label %exit if.then39: - br i1 undef, label %exit, label %if.end.i145 + br i1 %replace_undef_10, label %exit, label %if.end.i145 if.end.i145: - br i1 undef, label %exit, label %if.end8.i149 + br i1 %replace_undef_11, 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 %replace_undef_12, label %exit, label %if.end.i if.end.i: - br i1 undef, label %exit, label %if.end8.i + br i1 %replace_undef_13, label %exit, label %if.end8.i if.end8.i: br label %exit diff --git a/llvm/test/Analysis/Delinearization/type_mismatch.ll b/llvm/test/Analysis/Delinearization/type_mismatch.ll --- 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 %replace_undef_0) { entry: %0 = load i16, ptr undef, align 2 %conv21 = zext i16 %0 to i32 @@ -21,7 +21,7 @@ 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 %replace_undef_0, 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 --- 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 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2, i1 %replace_undef_3, i1 %replace_undef_4) { entry: - br i1 undef, label %for.cond55.preheader, label %for.end324 + br i1 %replace_undef_0, 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 %replace_undef_1, 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 %replace_undef_2, label %for.body60, label %for.end for.body60: %ix.062 = phi i64 [ %inc, %for.body60 ], [ 0, %for.cond58.preheader ] @@ -27,11 +27,11 @@ for.end: %inc320 = add nsw i64 %iy.067, 1 - br i1 undef, label %for.cond58.preheader, label %for.inc322 + br i1 %replace_undef_3, 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 %replace_undef_4, 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 --- a/llvm/test/Analysis/DependenceAnalysis/MIVCheckConst.ll +++ b/llvm/test/Analysis/DependenceAnalysis/MIVCheckConst.ll @@ -29,21 +29,21 @@ %20 = type { [768 x i32] } %21 = type { [416 x i32] } -define void @test(ptr %A) #0 align 2 { +define void @test(ptr %A, i1 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2, i1 %replace_undef_3) #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 %replace_undef_0, label %bb15, label %bb38 bb15: %v3 = mul nsw i32 %v2, undef br label %bb17 bb17: - br i1 undef, label %bb21, label %bb37 + br i1 %replace_undef_1, label %bb21, label %bb37 bb21: %v22 = add nsw i32 undef, 1 @@ -55,10 +55,10 @@ %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 %replace_undef_2, label %bb21, label %bb37 bb37: - br i1 undef, label %bb17, label %bb38 + br i1 %replace_undef_3, 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 --- 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 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2) align 2 { for.preheader: %t.0 = ashr exact i32 %n, 3 br label %for.body.1 @@ -15,7 +15,7 @@ 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 %replace_undef_0, 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 @@ %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 %replace_undef_1, 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 %replace_undef_2, label %for.exit, label %for.body.1 for.exit: ret void diff --git a/llvm/test/Analysis/DivergenceAnalysis/AMDGPU/join-at-loop-heart.ll b/llvm/test/Analysis/DivergenceAnalysis/AMDGPU/join-at-loop-heart.ll --- a/llvm/test/Analysis/DivergenceAnalysis/AMDGPU/join-at-loop-heart.ll +++ b/llvm/test/Analysis/DivergenceAnalysis/AMDGPU/join-at-loop-heart.ll @@ -7,7 +7,7 @@ ; CHECK: DIVERGENT: %inc = add i32 %phi.h, 1 ; CHECK: DIVERGENT: br i1 %div.cond, label %C, label %D -define void @nested_loop_extension() { +define void @nested_loop_extension( i1 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2) { entry: %anchor = call token @llvm.experimental.convergence.anchor() br label %A @@ -23,14 +23,14 @@ br i1 %div.cond, label %C, label %D C: - br i1 undef, label %A, label %E + br i1 %replace_undef_0, label %A, label %E D: - br i1 undef, label %A, label %E + br i1 %replace_undef_1, label %A, label %E E: %b = call token @llvm.experimental.convergence.loop() [ "convergencectrl"(token %anchor) ] - br i1 undef, label %A, label %F + br i1 %replace_undef_2, label %A, label %F F: ret void diff --git a/llvm/test/Analysis/Dominators/basic.ll b/llvm/test/Analysis/Dominators/basic.ll --- 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' 2>&1 | FileCheck %s -define void @test1() { +define void @test1( i1 %replace_undef_0, i1 %replace_undef_1) { ; CHECK-LABEL: DominatorTree for function: test1 ; CHECK: [1] %entry ; CHECK-NEXT: [2] %a @@ -10,7 +10,7 @@ ; CHECK-NEXT: [2] %b entry: - br i1 undef, label %a, label %b + br i1 %replace_undef_0, label %a, label %b a: br label %c @@ -19,7 +19,7 @@ br label %c c: - br i1 undef, label %d, label %e + br i1 %replace_undef_1, label %d, label %e d: ret void @@ -28,7 +28,7 @@ ret void } -define void @test2() { +define void @test2( i1 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2) { ; CHECK-LABEL: DominatorTree for function: test2 ; CHECK: [1] %entry ; CHECK-NEXT: [2] %a @@ -44,13 +44,13 @@ br label %b b: - br i1 undef, label %a, label %c + br i1 %replace_undef_0, label %a, label %c c: - br i1 undef, label %d, label %ret + br i1 %replace_undef_1, label %d, label %ret d: - br i1 undef, label %a, label %ret + br i1 %replace_undef_2, 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 --- a/llvm/test/Analysis/Dominators/print-dot-dom.ll +++ b/llvm/test/Analysis/Dominators/print-dot-dom.ll @@ -2,7 +2,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 %replace_undef_0, i1 %replace_undef_1) { ; TEST1: digraph "Dominator tree for 'test1' function" ; TEST1-NEXT: label="Dominator tree for 'test1' function" ; TEST1: Node0x[[EntryID:.*]] [shape=record,label="{entry: @@ -18,7 +18,7 @@ ; TEST1-NEXT: Node0x[[B_ID]] [shape=record,label="{b: entry: - br i1 undef, label %a, label %b + br i1 %replace_undef_0, label %a, label %b a: br label %c @@ -27,7 +27,7 @@ br label %c c: - br i1 undef, label %d, label %e + br i1 %replace_undef_1, label %d, label %e d: ret void @@ -36,7 +36,7 @@ ret void } -define void @test2() { +define void @test2( i1 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2) { ; TEST2: digraph "Dominator tree for 'test2' function" ; TEST2-NEXT: label="Dominator tree for 'test2' function" ; TEST2: Node0x[[EntryID:.*]] [shape=record,label="{entry: @@ -58,13 +58,13 @@ br label %b b: - br i1 undef, label %a, label %c + br i1 %replace_undef_0, label %a, label %c c: - br i1 undef, label %d, label %e + br i1 %replace_undef_1, label %d, label %e d: - br i1 undef, label %a, label %e + br i1 %replace_undef_2, label %a, label %e e: ret void diff --git a/llvm/test/Analysis/MemorySSA/cyclicphi.ll b/llvm/test/Analysis/MemorySSA/cyclicphi.ll --- a/llvm/test/Analysis/MemorySSA/cyclicphi.ll +++ b/llvm/test/Analysis/MemorySSA/cyclicphi.ll @@ -3,15 +3,14 @@ %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 %replace_undef_0) 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 + br i1 %replace_undef_0, label %bb68, label %bb77 bb68: ; preds = %bb26 ; CHECK: MemoryUse(liveOnEntry) @@ -31,7 +30,7 @@ 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 %replace_undef_0) 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 +38,7 @@ 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 + br i1 %replace_undef_0, label %bb68, label %bb77 bb68: ; preds = %bb26 ; CHECK: MemoryUse(3) @@ -61,15 +59,14 @@ } ; 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 %replace_undef_0) 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 + br i1 %replace_undef_0, label %bb68, label %bb77 bb68: ; preds = %bb26 ; CHECK: MemoryUse(3) @@ -89,7 +86,7 @@ } ; 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 %replace_undef_0) 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 +96,7 @@ ; 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 %replace_undef_0, label %bb68, label %bb77 bb68: ; preds = %bb26 ; CHECK: MemoryUse(3) @@ -119,7 +116,7 @@ } ; 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 %replace_undef_0) 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 +126,7 @@ ; 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 %replace_undef_0, 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 --- 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 %replace_undef_0) { 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 %replace_undef_0, 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 --- a/llvm/test/Analysis/MemorySSA/debugvalue2.ll +++ b/llvm/test/Analysis/MemorySSA/debugvalue2.ll @@ -8,7 +8,7 @@ ; CHECK-LABEL: @overflow_iter_var ; CHECK-NOT: MemoryDef -define void @overflow_iter_var() !dbg !11 { +define void @overflow_iter_var( i1 %replace_undef_0) !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 @@ 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 %replace_undef_0, 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 --- 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,verify' -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 %replace_undef_0) { entry: - br i1 undef, label %split1, label %split2 + br i1 %replace_undef_0, 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 --- a/llvm/test/Analysis/MemorySSA/function-clobber.ll +++ b/llvm/test/Analysis/MemorySSA/function-clobber.ll @@ -29,11 +29,11 @@ declare void @clobberEverything() ; CHECK-LABEL: define void @bar -define void @bar() { +define void @bar( i1 %replace_undef_0) { ; CHECK: 1 = MemoryDef(liveOnEntry) ; CHECK-NEXT: call void @clobberEverything() call void @clobberEverything() - br i1 undef, label %if.end, label %if.then + br i1 %replace_undef_0, 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 --- a/llvm/test/Analysis/MemorySSA/invariant-groups.ll +++ b/llvm/test/Analysis/MemorySSA/invariant-groups.ll @@ -195,7 +195,7 @@ } ; CHECK-LABEL: define {{.*}} @loop2( -define i8 @loop2(ptr %p) { +define i8 @loop2(ptr %p, i1 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2) { entry: ; CHECK: 1 = MemoryDef(liveOnEntry) ; CHECK-NEXT: store i8 @@ -207,7 +207,7 @@ ; 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 %replace_undef_0, label %Loop.Body, label %Loop.End Loop.Body: ; CHECK: MemoryUse(6) @@ -221,7 +221,7 @@ ; CHECK: 4 = MemoryDef(6) store i8 4, ptr %after, !invariant.group !0 - br i1 undef, label %Loop.End, label %Loop.Body + br i1 %replace_undef_1, label %Loop.End, label %Loop.Body Loop.End: ; CHECK: MemoryUse(5) @@ -231,7 +231,7 @@ ; 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 %replace_undef_2, label %Ret, label %Loop.Body Ret: ret i8 %3 @@ -239,7 +239,7 @@ ; CHECK-LABEL: define {{.*}} @loop3( -define i8 @loop3(ptr %p) { +define i8 @loop3(ptr %p, i1 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2, i1 %replace_undef_3) { entry: ; CHECK: 1 = MemoryDef(liveOnEntry) ; CHECK-NEXT: store i8 @@ -251,7 +251,7 @@ ; 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 %replace_undef_0, label %Loop.Body, label %Loop.End Loop.Body: ; CHECK: MemoryUse(8) @@ -266,7 +266,7 @@ ; CHECK-NEXT: %1 = load i8 %1 = load i8, ptr %after, !invariant.group !0 - br i1 undef, label %Loop.next, label %Loop.Body + br i1 %replace_undef_1, label %Loop.next, label %Loop.Body Loop.next: ; CHECK: 5 = MemoryDef(4) ; CHECK-NEXT: call void @clobber8 @@ -276,7 +276,7 @@ ; CHECK-NEXT: %2 = load i8 %2 = load i8, ptr %after, !invariant.group !0 - br i1 undef, label %Loop.End, label %Loop.Body + br i1 %replace_undef_2, label %Loop.End, label %Loop.Body Loop.End: ; CHECK: MemoryUse(7) @@ -290,14 +290,14 @@ ; 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 %replace_undef_3, label %Ret, label %Loop.Body Ret: ret i8 %3 } ; CHECK-LABEL: define {{.*}} @loop4( -define i8 @loop4(ptr %p) { +define i8 @loop4(ptr %p, i1 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2) { entry: ; CHECK: 1 = MemoryDef(liveOnEntry) ; CHECK-NEXT: store i8 @@ -308,7 +308,7 @@ ; 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 %replace_undef_0, label %Loop.Pre, label %Loop.End Loop.Pre: ; CHECK: MemoryUse(2) @@ -326,7 +326,7 @@ ; CHECK: 4 = MemoryDef(6) store i8 4, ptr %after, !invariant.group !0 - br i1 undef, label %Loop.End, label %Loop.Body + br i1 %replace_undef_1, label %Loop.End, label %Loop.Body Loop.End: ; CHECK: MemoryUse(5) @@ -336,7 +336,7 @@ ; 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 %replace_undef_2, 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 --- 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 %replace_undef_0) { entry: br label %for.cond120 for.cond120: ; preds = %for.body127, %entry call void @foo() - br i1 undef, label %for.body127, label %for.cond.cleanup126 + br i1 %replace_undef_0, label %for.body127, label %for.cond.cleanup126 for.cond.cleanup126: ; preds = %for.cond120 unreachable diff --git a/llvm/test/Analysis/MemorySSA/loop-rotate-valuemap.ll b/llvm/test/Analysis/MemorySSA/loop-rotate-valuemap.ll --- 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 %replace_undef_0) { entry: br label %for.body16 @@ -15,7 +15,7 @@ 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 %replace_undef_0, 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 --- a/llvm/test/Analysis/MemorySSA/phi-translation.ll +++ b/llvm/test/Analysis/MemorySSA/phi-translation.ll @@ -73,7 +73,7 @@ } ; 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 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2) { ; CHECK: 1 = MemoryDef(liveOnEntry) ; CHECK-NEXT: store i8 0, ptr %p1 store i8 0, ptr %p1 @@ -82,19 +82,19 @@ ; LIMIT: MemoryUse(1) ; LIMIT-NEXT: load i8, ptr %p1 load i8, ptr %p1 - br i1 undef, label %a, label %b + br i1 %replace_undef_0, 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 %replace_undef_1, 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 %replace_undef_2, label %c, label %d c: ; CHECK: 6 = MemoryPhi({a,2},{b,3}) @@ -121,7 +121,7 @@ } ; CHECK-LABEL: define void @looped -define void @looped(ptr noalias %p1, ptr noalias %p2) { +define void @looped(ptr noalias %p1, ptr noalias %p2, i1 %replace_undef_0, i1 %replace_undef_1) { ; CHECK: 1 = MemoryDef(liveOnEntry) ; CHECK-NEXT: store i8 0, ptr %p1 store i8 0, ptr %p1 @@ -132,7 +132,7 @@ ; 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 %replace_undef_0, label %loop.2, label %loop.3 loop.2: ; CHECK: 5 = MemoryPhi({loop.1,2},{loop.3,4}) @@ -151,23 +151,22 @@ ; LIMIT: MemoryUse(4) ; LIMIT-NEXT: load i8, ptr %p1 load i8, ptr %p1 - br i1 undef, label %loop.2, label %loop.1 + br i1 %replace_undef_1, 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 %replace_undef_0, i1 %replace_undef_1) { 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 + br i1 %replace_undef_0, 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 %replace_undef_1, 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 --- 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 %replace_undef_0, i1 %replace_undef_1) unnamed_addr #0 { bb: - br i1 undef, label %bb1, label %bb2 + br i1 %replace_undef_0, label %bb1, label %bb2 bb1: ; preds = %bb ; These accesses should not conflict. @@ -28,7 +28,7 @@ br label %bb3 bb3: ; preds = %bb2 - br i1 undef, label %bb4, label %bb6 + br i1 %replace_undef_1, 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 --- a/llvm/test/Analysis/MemorySSA/pr40749_2.ll +++ b/llvm/test/Analysis/MemorySSA/pr40749_2.ll @@ -7,7 +7,7 @@ @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 %replace_undef_0) unnamed_addr #0 { bb: %tmp6.i = icmp sgt i16 %arg1, 0 br label %bb10 @@ -50,7 +50,7 @@ br label %bb75 bb75: ; preds = %bb67, %bb67.us.loopexit - br i1 undef, label %bb24.preheader, label %bb84.loopexit + br i1 %replace_undef_0, label %bb24.preheader, label %bb84.loopexit bb81.loopexit: ; preds = %bb61.us br label %bb10 diff --git a/llvm/test/Analysis/MemorySSA/pr43641.ll b/llvm/test/Analysis/MemorySSA/pr43641.ll --- 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 %replace_undef_0) local_unnamed_addr { entry: - br i1 undef, label %while.end, label %while.body.lr.ph + br i1 %replace_undef_0, 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/renamephis.ll b/llvm/test/Analysis/MemorySSA/renamephis.ll --- a/llvm/test/Analysis/MemorySSA/renamephis.ll +++ b/llvm/test/Analysis/MemorySSA/renamephis.ll @@ -11,20 +11,20 @@ declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0 ; CHECK-LABEL: @f -define void @f() align 2 { +define void @f( i1 %replace_undef_0, i1 %replace_undef_1) 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 %replace_undef_0, 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 %replace_undef_1, 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 --- a/llvm/test/Analysis/MemorySSA/unreachable.ll +++ b/llvm/test/Analysis/MemorySSA/unreachable.ll @@ -8,9 +8,9 @@ declare dso_local void @f() ; CHECK-LABEL: @foo -define dso_local void @foo() { +define dso_local void @foo( i1 %replace_undef_0) { entry: - br i1 undef, label %if.then, label %if.end + br i1 %replace_undef_0, 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 --- a/llvm/test/Analysis/MemorySSA/update_unroll.ll +++ b/llvm/test/Analysis/MemorySSA/update_unroll.ll @@ -7,7 +7,7 @@ ; 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 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2) align 32 { entry: br label %while.cond.outer @@ -15,13 +15,13 @@ 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 %replace_undef_0, 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 %replace_undef_1, label %if.then42, label %if.end61 if.then42: ; preds = %while.body br label %return.loopexit2 @@ -30,7 +30,7 @@ br label %while.body82 while.body82: ; preds = %if.end61 - br i1 undef, label %return.loopexit, label %if.else99 + br i1 %replace_undef_2, 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 --- 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 %replace_undef_0) { entry: - br i1 undef, label %if, label %else + br i1 %replace_undef_0, label %if, label %else if: br label %end @@ -26,9 +26,9 @@ } ; CHECK-LABEL: PHI Values for function: chain -define void @chain() { +define void @chain( i1 %replace_undef_0, i1 %replace_undef_1) { entry: - br i1 undef, label %if1, label %else1 + br i1 %replace_undef_0, label %if1, label %else1 if1: br label %middle @@ -41,7 +41,7 @@ ; CHECK-DAG: i32 0 ; CHECK-DAG: i32 1 %phi1 = phi i32 [ 0, %if1 ], [ 1, %else1 ] - br i1 undef, label %if2, label %else2 + br i1 %replace_undef_1, label %if2, label %else2 if2: br label %end @@ -71,7 +71,7 @@ } ; CHECK-LABEL: PHI Values for function: simple_loop -define void @simple_loop() { +define void @simple_loop( i1 %replace_undef_0) { entry: br label %loop @@ -79,23 +79,23 @@ ; 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 %replace_undef_0, label %loop, label %end end: ret void } ; CHECK-LABEL: PHI Values for function: complex_loop -define void @complex_loop() { +define void @complex_loop( i1 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2) { entry: - br i1 undef, label %loop, label %end + br i1 %replace_undef_0, 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 %replace_undef_1, label %if, label %else if: br label %then @@ -108,7 +108,7 @@ ; CHECK-DAG: i32 0 ; CHECK-DAG: i32 1 %phi2 = phi i32 [ %phi1, %if ], [ 1, %else ] - br i1 undef, label %loop, label %end + br i1 %replace_undef_2, label %loop, label %end end: ; CHECK: PHI %phi3 has values: @@ -120,9 +120,9 @@ } ; CHECK-LABEL: PHI Values for function: strange_loop -define void @strange_loop() { +define void @strange_loop( i1 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2, i1 %replace_undef_3) { entry: - br i1 undef, label %ifelse, label %inloop + br i1 %replace_undef_0, label %ifelse, label %inloop loop: ; CHECK: PHI %phi1 has values: @@ -131,7 +131,7 @@ ; 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 %replace_undef_1, label %inloop, label %end inloop: ; CHECK: PHI %phi2 has values: @@ -140,14 +140,14 @@ ; CHECK-DAG: i32 2 ; CHECK-DAG: i32 3 %phi2 = phi i32 [ %phi1, %loop ], [ 1, %entry ] - br i1 undef, label %ifelse, label %loop + br i1 %replace_undef_2, 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 %replace_undef_3, label %if, label %else if: br label %loop @@ -160,9 +160,9 @@ } ; CHECK-LABEL: PHI Values for function: mutual_loops -define void @mutual_loops() { +define void @mutual_loops( i1 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2, i1 %replace_undef_3, i1 %replace_undef_4, i1 %replace_undef_5, i1 %replace_undef_6) { entry: - br i1 undef, label %loop1, label %loop2 + br i1 %replace_undef_0, label %loop1, label %loop2 loop1: ; CHECK: PHI %phi1 has values: @@ -172,10 +172,10 @@ ; 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 %replace_undef_1, label %loop1.if, label %loop1.else loop1.if: - br i1 undef, label %loop1.then, label %loop2 + br i1 %replace_undef_2, label %loop1.then, label %loop2 loop1.else: br label %loop1.then @@ -188,7 +188,7 @@ ; CHECK-DAG: 3 ; CHECK-DAG: 4 %phi2 = phi i32 [ 1, %loop1.if ], [ %phi1, %loop1.else ] - br i1 undef, label %loop1, label %end + br i1 %replace_undef_3, label %loop1, label %end loop2: ; CHECK: PHI %phi3 has values: @@ -196,10 +196,10 @@ ; 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 %replace_undef_4, label %loop2.if, label %loop2.else loop2.if: - br i1 undef, label %loop2.then, label %loop1 + br i1 %replace_undef_5, label %loop2.then, label %loop1 loop2.else: br label %loop2.then @@ -210,7 +210,7 @@ ; CHECK-DAG: 3 ; CHECK-DAG: 4 %phi4 = phi i32 [ 4, %loop2.if ], [ %phi3, %loop2.else ] - br i1 undef, label %loop2, label %end + br i1 %replace_undef_6, label %loop2, label %end end: ; CHECK: PHI %phi5 has values: @@ -224,7 +224,7 @@ } ; CHECK-LABEL: PHI Values for function: nested_loops_several_values -define void @nested_loops_several_values() { +define void @nested_loops_several_values( i1 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2) { entry: br label %loop1 @@ -233,14 +233,14 @@ ; CHECK-DAG: i32 0 ; CHECK-DAG: %add %phi1 = phi i32 [ 0, %entry ], [ %phi2, %loop2 ] - br i1 undef, label %loop2, label %end + br i1 %replace_undef_0, 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 %replace_undef_1, label %loop3, label %loop1 loop3: ; CHECK: PHI %phi3 has values: @@ -248,14 +248,14 @@ ; CHECK-DAG: %add %phi3 = phi i32 [ %add, %loop3 ], [ %phi2, %loop2 ] %add = add i32 %phi3, 1 - br i1 undef, label %loop3, label %loop2 + br i1 %replace_undef_2, 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 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2) { entry: br label %loop1 @@ -263,19 +263,19 @@ ; 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 %replace_undef_0, 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 %replace_undef_1, 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 %replace_undef_2, 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 --- 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 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2, i1 %replace_undef_3, i1 %replace_undef_4, i1 %replace_undef_5, i1 %replace_undef_6, i1 %replace_undef_7, i1 %replace_undef_8, i1 %replace_undef_9, i1 %replace_undef_10, i1 %replace_undef_11, i1 %replace_undef_12, i1 %replace_undef_13) { entry: br label %while1.cond @@ -12,10 +12,10 @@ ; 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 %replace_undef_0, label %while1.end, label %while1.body while1.body: - br i1 undef, label %while1.then, label %while1.if + br i1 %replace_undef_1, label %while1.then, label %while1.if while1.if: br label %while1.then @@ -33,16 +33,16 @@ ; 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 %replace_undef_2, label %while2.end, label %while2.body1 while2.body1: - br i1 undef, label %while2.cond2, label %while2.then + br i1 %replace_undef_3, 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 %replace_undef_4, label %while2.then, label %while2.if while2.if: br label %while2.cond2 @@ -60,13 +60,13 @@ ; 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 %replace_undef_5, 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 %replace_undef_6, label %while3.cond1, label %while3.body while3.body: br label %while3.cond2 @@ -78,16 +78,16 @@ ; 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 %replace_undef_7, label %while4.end, label %while4.if while4.if: - br i1 undef, label %while4.cond2, label %while4.then + br i1 %replace_undef_8, 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 %replace_undef_9, label %while4.then, label %while4.body while4.body: br label %while4.cond2 @@ -105,16 +105,16 @@ ; 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 %replace_undef_10, label %while5.end, label %while5.body1 while5.body1: - br i1 undef, label %while5.if, label %while5.then + br i1 %replace_undef_11, 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 %replace_undef_12, label %while5.then, label %while5.body2 while5.body2: br label %while5.if @@ -132,7 +132,7 @@ ; 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 %replace_undef_13, 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 --- 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' 2>&1 | FileCheck %s -define internal void @f() { +define internal void @f( i1 %replace_undef_0) { entry: - br i1 undef, label %bb35, label %bb3.i + br i1 %replace_undef_0, 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 --- 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' 2>&1 | FileCheck %s -define internal void @f() { +define internal void @f( i1 %replace_undef_0, i1 %replace_undef_1) { entry: - br i1 undef, label %a, label %bb3.i + br i1 %replace_undef_0, label %a, label %bb3.i a: - br i1 undef, label %bb35, label %bb3.i + br i1 %replace_undef_1, 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 --- 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' 2>&1 | FileCheck %s -define internal void @f() { +define internal void @f( i1 %replace_undef_0) { entry: - br i1 undef, label %bb35, label %bb3.i + br i1 %replace_undef_0, 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 --- 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' 2>&1 | FileCheck %s -define internal void @f() { +define internal void @f( i1 %replace_undef_0) { entry: br i1 1, label %a, label %b @@ -10,7 +10,7 @@ br label %c c: - br i1 undef, label %bb35, label %bb3.i + br i1 %replace_undef_0, 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 --- 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 %replace_undef_0) nounwind readnone ssp { entry: br label %for.inc @@ -16,7 +16,7 @@ %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 %replace_undef_0, 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 --- a/llvm/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll +++ b/llvm/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll @@ -36,7 +36,7 @@ ; PR10383 ; These next two used to crash. -define void @test2(i1 %cmp, i64 %n) { +define void @test2(i1 %cmp, i64 %n, i1 %replace_undef_0) { entry: br label %for.body1 @@ -54,16 +54,16 @@ %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 %replace_undef_0, label %end, label %for.body2 end: ret void } ; CHECK: Determining loop execution counts for: @test2 -define i32 @test3() { +define i32 @test3( i1 %replace_undef_0, i1 %replace_undef_1) { if.then466: - br i1 undef, label %for.cond539.preheader, label %for.inc479 + br i1 %replace_undef_0, label %for.cond539.preheader, label %for.inc479 for.inc479: %a2.07 = phi i32 [ %add495, %for.inc479 ], [ 0, %if.then466 ] @@ -73,7 +73,7 @@ %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 %replace_undef_1, 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 --- 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 %replace_undef_0) { entry: %0 = load ptr, ptr undef, align 8 ; [#uses=1] %1 = ptrtoint ptr %0 to i64 ; [#uses=1] %2 = sub i64 undef, %1 ; [#uses=1] %3 = lshr i64 %2, 3 ; [#uses=1] %4 = trunc i64 %3 to i32 ; [#uses=2] - br i1 undef, label %bb10, label %bb4.i + br i1 %replace_undef_0, label %bb10, label %bb4.i bb4.i: ; preds = %bb4.i, %entry %i.0.i6 = phi i32 [ %8, %bb4.i ], [ 0, %entry ] ; [#uses=2] diff --git a/llvm/test/Analysis/ScalarEvolution/avoid-infinite-recursion-1.ll b/llvm/test/Analysis/ScalarEvolution/avoid-infinite-recursion-1.ll --- a/llvm/test/Analysis/ScalarEvolution/avoid-infinite-recursion-1.ll +++ b/llvm/test/Analysis/ScalarEvolution/avoid-infinite-recursion-1.ll @@ -207,9 +207,9 @@ %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 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2, i1 %replace_undef_3, i1 %replace_undef_4, i1 %replace_undef_5, i1 %replace_undef_6, i1 %replace_undef_7, i1 %replace_undef_8, i1 %replace_undef_9, i1 %replace_undef_10, i1 %replace_undef_11, i1 %replace_undef_12, i1 %replace_undef_13, i1 %replace_undef_14, i1 %replace_undef_15, i1 %replace_undef_16, i1 %replace_undef_17, i1 %replace_undef_18, i1 %replace_undef_19, i1 %replace_undef_20, i1 %replace_undef_21, i1 %replace_undef_22) nounwind { entry: - br i1 undef, label %if.then11, label %do.end + br i1 %replace_undef_0, label %if.then11, label %do.end if.then11: ; preds = %entry br label %do.end @@ -230,19 +230,19 @@ br label %while.cond27 while.cond27: ; preds = %while.body36, %while.body - br i1 undef, label %do.body288.loopexit, label %land.rhs + br i1 %replace_undef_1, label %do.body288.loopexit, label %land.rhs land.rhs: ; preds = %while.cond27 - br i1 undef, label %while.body36, label %while.end + br i1 %replace_undef_2, 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 %replace_undef_3, label %do.body288.loopexit4, label %do.body46 do.body46: ; preds = %while.end - br i1 undef, label %if.else64, label %if.then53 + br i1 %replace_undef_4, label %if.else64, label %if.then53 if.then53: ; preds = %do.body46 br label %if.end72 @@ -252,58 +252,58 @@ if.end72: ; preds = %if.else64, %if.then53 %dec = add i32 %count.0, -1 ; [#uses=2] - br i1 undef, label %next_iter, label %if.end111 + br i1 %replace_undef_5, label %next_iter, label %if.end111 if.end111: ; preds = %if.end72 - br i1 undef, label %lor.lhs.false, label %do.body145 + br i1 %replace_undef_6, 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 %replace_undef_7, 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 %replace_undef_8, 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 %replace_undef_9, 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 %replace_undef_10, 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 %replace_undef_11, 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 %replace_undef_12, 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 %replace_undef_13, 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 %replace_undef_14, 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 %replace_undef_15, 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 %replace_undef_16, 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 %replace_undef_17, 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 %replace_undef_18, 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 @@ 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 %replace_undef_19, label %yield, label %do.body269 next_iter: ; preds = %if.then156, %do.body145, %if.end72 %rem2482 = and i32 %dec, 255 ; [#uses=1] @@ -320,7 +320,7 @@ br i1 %cmp249, label %do.body253, label %while.cond do.body253: ; preds = %next_iter - br i1 undef, label %if.then264, label %yield + br i1 %replace_undef_20, label %if.then264, label %yield if.then264: ; preds = %do.body253 br label %yield @@ -329,7 +329,7 @@ br label %do.body269 do.body269: ; preds = %yield, %next_iter_mntunlocked - br i1 undef, label %if.then280, label %while.cond.outer.backedge + br i1 %replace_undef_21, label %if.then280, label %while.cond.outer.backedge if.then280: ; preds = %do.body269 br label %while.cond.outer.backedge @@ -344,7 +344,7 @@ br label %do.body288 do.body288: ; preds = %do.body288.loopexit4, %do.body288.loopexit - br i1 undef, label %if.then299, label %do.end303 + br i1 %replace_undef_22, 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 --- a/llvm/test/Analysis/ScalarEvolution/different-loops-recs.ll +++ b/llvm/test/Analysis/ScalarEvolution/different-loops-recs.ll @@ -261,7 +261,7 @@ ; 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 %replace_undef_0) { ; CHECK-LABEL: Classifying expressions for: @test_04 ; CHECK: %tmp = phi i64 [ 2, %bb ], [ %tmp4, %bb3 ] @@ -290,7 +290,7 @@ loop1: %tmp = phi i64 [ 2, %bb ], [ %tmp4, %bb3 ] %tmp2 = trunc i64 %tmp to i32 - br i1 undef, label %loop2, label %bb3 + br i1 %replace_undef_0, 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 --- a/llvm/test/Analysis/ScalarEvolution/expander-replace-congruent-ivs.ll +++ b/llvm/test/Analysis/ScalarEvolution/expander-replace-congruent-ivs.ll @@ -6,10 +6,10 @@ ; 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 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2) { ; CHECK-LABEL: @pr27232( entry: - br i1 undef, label %loop_0.cond, label %for.body.us + br i1 %replace_undef_0, label %loop_0.cond, label %for.body.us for.body.us: br label %loop_0.cond @@ -29,12 +29,12 @@ br label %loop_1 loop_0: - br i1 undef, label %loop_0, label %loop_1.exit + br i1 %replace_undef_1, 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 %replace_undef_2, label %leave, label %loop_1 leave: ret void @@ -44,10 +44,10 @@ ; @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 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2) { ; CHECK-LABEL: @ReplaceArg_0( entry: - br i1 undef, label %loop_0.cond, label %for.body.us + br i1 %replace_undef_0, label %loop_0.cond, label %for.body.us for.body.us: br label %loop_0.cond @@ -66,21 +66,21 @@ br label %loop_1 loop_0: - br i1 undef, label %loop_0, label %loop_1.exit + br i1 %replace_undef_1, 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 %replace_undef_2, label %leave, label %loop_1 leave: ret void } -define void @ReplaceArg_1(i32 %val) { +define void @ReplaceArg_1(i32 %val, i1 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2) { ; CHECK-LABEL: @ReplaceArg_1( entry: - br i1 undef, label %loop_0.cond, label %for.body.us + br i1 %replace_undef_0, label %loop_0.cond, label %for.body.us for.body.us: br label %loop_0.cond @@ -99,12 +99,12 @@ br label %loop_1 loop_0: - br i1 undef, label %loop_0, label %loop_1.exit + br i1 %replace_undef_1, 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 %replace_undef_2, 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 --- 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" 2>&1 | FileCheck %s ; PR13228 -define void @f() nounwind uwtable readnone { +define void @f( i1 %replace_undef_0) nounwind uwtable readnone { entry: br label %for.cond @@ -14,7 +14,7 @@ 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 %replace_undef_0, 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 --- 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.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 %replace_undef_0) { ; CHECK-LABEL: 'uadd_exhaustive' ; CHECK-NEXT: Determining loop execution counts for: @uadd_exhaustive ; CHECK-NEXT: Loop %for.body: backedge-taken count is 35 @@ -19,7 +19,7 @@ ; CHECK: Loop %for.body: Trip multiple is 36 ; entry: - br i1 undef, label %for.end, label %for.body.preheader + br i1 %replace_undef_0, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry br label %for.body @@ -35,7 +35,7 @@ ret void } -define void @sadd_exhaustive() { +define void @sadd_exhaustive( i1 %replace_undef_0) { ; CHECK-LABEL: 'sadd_exhaustive' ; CHECK-NEXT: Determining loop execution counts for: @sadd_exhaustive ; CHECK-NEXT: Loop %for.body: backedge-taken count is 67 @@ -46,7 +46,7 @@ ; CHECK: Loop %for.body: Trip multiple is 68 ; entry: - br i1 undef, label %for.end, label %for.body.preheader + br i1 %replace_undef_0, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry br label %for.body @@ -62,7 +62,7 @@ ret void } -define void @usub_exhaustive() { +define void @usub_exhaustive( i1 %replace_undef_0) { ; CHECK-LABEL: 'usub_exhaustive' ; CHECK-NEXT: Determining loop execution counts for: @usub_exhaustive ; CHECK-NEXT: Loop %for.body: backedge-taken count is 50 @@ -73,7 +73,7 @@ ; CHECK: Loop %for.body: Trip multiple is 51 ; entry: - br i1 undef, label %for.end, label %for.body.preheader + br i1 %replace_undef_0, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry br label %for.body @@ -89,7 +89,7 @@ ret void } -define void @ssub_exhaustive() { +define void @ssub_exhaustive( i1 %replace_undef_0) { ; CHECK-LABEL: 'ssub_exhaustive' ; CHECK-NEXT: Determining loop execution counts for: @ssub_exhaustive ; CHECK-NEXT: Loop %for.body: backedge-taken count is 68 @@ -100,7 +100,7 @@ ; CHECK: Loop %for.body: Trip multiple is 69 ; entry: - br i1 undef, label %for.end, label %for.body.preheader + br i1 %replace_undef_0, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry br label %for.body @@ -116,7 +116,7 @@ ret void } -define void @smul_exhaustive() { +define void @smul_exhaustive( i1 %replace_undef_0) { ; CHECK-LABEL: 'smul_exhaustive' ; CHECK-NEXT: Determining loop execution counts for: @smul_exhaustive ; CHECK-NEXT: Loop %for.body: backedge-taken count is 14 @@ -127,7 +127,7 @@ ; CHECK: Loop %for.body: Trip multiple is 15 ; entry: - br i1 undef, label %for.end, label %for.body.preheader + br i1 %replace_undef_0, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry br label %for.body @@ -143,7 +143,7 @@ ret void } -define void @umul_exhaustive() { +define void @umul_exhaustive( i1 %replace_undef_0) { ; CHECK-LABEL: 'umul_exhaustive' ; CHECK-NEXT: Determining loop execution counts for: @umul_exhaustive ; CHECK-NEXT: Loop %for.body: backedge-taken count is 15 @@ -154,7 +154,7 @@ ; CHECK: Loop %for.body: Trip multiple is 16 ; entry: - br i1 undef, label %for.end, label %for.body.preheader + br i1 %replace_undef_0, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry br label %for.body @@ -170,7 +170,7 @@ ret void } -define void @uadd_symbolic_start(i16 %start) { +define void @uadd_symbolic_start(i16 %start, i1 %replace_undef_0) { ; 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)) @@ -181,7 +181,7 @@ ; CHECK: Loop %for.body: Trip multiple is 1 ; entry: - br i1 undef, label %for.end, label %for.body.preheader + br i1 %replace_undef_0, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry br label %for.body @@ -197,7 +197,7 @@ ret void } -define void @sadd_symbolic_start(i16 %start) { +define void @sadd_symbolic_start(i16 %start, i1 %replace_undef_0) { ; 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)) @@ -208,7 +208,7 @@ ; CHECK: Loop %for.body: Trip multiple is 1 ; entry: - br i1 undef, label %for.end, label %for.body.preheader + br i1 %replace_undef_0, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry br label %for.body @@ -224,7 +224,7 @@ ret void } -define void @sadd_symbolic_start2(i16 %start) { +define void @sadd_symbolic_start2(i16 %start, i1 %replace_undef_0) { ; CHECK-LABEL: 'sadd_symbolic_start2' ; CHECK-NEXT: Determining loop execution counts for: @sadd_symbolic_start2 ; CHECK-NEXT: Loop %for.body: Unpredictable backedge-taken count. @@ -233,7 +233,7 @@ ; CHECK-NEXT: Loop %for.body: Unpredictable predicated backedge-taken count. ; entry: - br i1 undef, label %for.end, label %for.body.preheader + br i1 %replace_undef_0, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry br label %for.body @@ -250,7 +250,7 @@ ret void } -define void @sadd_symbolic_swapped(i16 %start) { +define void @sadd_symbolic_swapped(i16 %start, i1 %replace_undef_0) { ; CHECK-LABEL: 'sadd_symbolic_swapped' ; CHECK-NEXT: Determining loop execution counts for: @sadd_symbolic_swapped ; CHECK-NEXT: Loop %for.body: Unpredictable backedge-taken count. @@ -259,7 +259,7 @@ ; CHECK-NEXT: Loop %for.body: Unpredictable predicated backedge-taken count. ; entry: - br i1 undef, label %for.end, label %for.body.preheader + br i1 %replace_undef_0, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry br label %for.body @@ -275,7 +275,7 @@ ret void } -define void @usub_symbolic_start(i16 %start) { +define void @usub_symbolic_start(i16 %start, i1 %replace_undef_0) { ; 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 @@ -286,7 +286,7 @@ ; CHECK: Loop %for.body: Trip multiple is 1 ; entry: - br i1 undef, label %for.end, label %for.body.preheader + br i1 %replace_undef_0, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry br label %for.body @@ -302,7 +302,7 @@ ret void } -define void @ssub_symbolic_start(i16 %start) { +define void @ssub_symbolic_start(i16 %start, i1 %replace_undef_0) { ; 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) @@ -313,7 +313,7 @@ ; CHECK: Loop %for.body: Trip multiple is 1 ; entry: - br i1 undef, label %for.end, label %for.body.preheader + br i1 %replace_undef_0, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry br label %for.body @@ -329,7 +329,7 @@ ret void } -define void @smul_symbolic_start(i16 %start) { +define void @smul_symbolic_start(i16 %start, i1 %replace_undef_0) { ; CHECK-LABEL: 'smul_symbolic_start' ; CHECK-NEXT: Determining loop execution counts for: @smul_symbolic_start ; CHECK-NEXT: Loop %for.body: Unpredictable backedge-taken count. @@ -338,7 +338,7 @@ ; CHECK-NEXT: Loop %for.body: Unpredictable predicated backedge-taken count. ; entry: - br i1 undef, label %for.end, label %for.body.preheader + br i1 %replace_undef_0, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry br label %for.body @@ -354,7 +354,7 @@ ret void } -define void @umul_symbolic_start(i16 %start) { +define void @umul_symbolic_start(i16 %start, i1 %replace_undef_0) { ; CHECK-LABEL: 'umul_symbolic_start' ; CHECK-NEXT: Determining loop execution counts for: @umul_symbolic_start ; CHECK-NEXT: Loop %for.body: Unpredictable backedge-taken count. @@ -363,7 +363,7 @@ ; CHECK-NEXT: Loop %for.body: Unpredictable predicated backedge-taken count. ; entry: - br i1 undef, label %for.end, label %for.body.preheader + br i1 %replace_undef_0, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry br label %for.body @@ -379,7 +379,7 @@ ret void } -define void @sadd_symbolic_non_latch(i16 %start) { +define void @sadd_symbolic_non_latch(i16 %start, i1 %replace_undef_0) { ; CHECK-LABEL: 'sadd_symbolic_non_latch' ; CHECK-NEXT: Determining loop execution counts for: @sadd_symbolic_non_latch ; CHECK-NEXT: Loop %for.body: backedge-taken count is ((230 + (-1 * %start)) umin (32767 + (-1 * %start))) @@ -394,7 +394,7 @@ ; CHECK: Loop %for.body: Trip multiple is 1 ; entry: - br i1 undef, label %for.end, label %for.body.preheader + br i1 %replace_undef_0, 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 --- 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 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2, i1 %replace_undef_3, i1 %replace_undef_4, i1 %replace_undef_5, i1 %replace_undef_6, i1 %replace_undef_7, i1 %replace_undef_8, i1 %replace_undef_9, i1 %replace_undef_10, i1 %replace_undef_11, i1 %replace_undef_12, i1 %replace_undef_13, i1 %replace_undef_14, i1 %replace_undef_15, i1 %replace_undef_16, i1 %replace_undef_17, i1 %replace_undef_18, i1 %replace_undef_19, i1 %replace_undef_20, i1 %replace_undef_21, i1 %replace_undef_22, i1 %replace_undef_23, i1 %replace_undef_24, i1 %replace_undef_25, i1 %replace_undef_26, i1 %replace_undef_27, i1 %replace_undef_28, i1 %replace_undef_29, i1 %replace_undef_30, i1 %replace_undef_31, i1 %replace_undef_32) { start: - br i1 undef, label %"stack overflow", label %"no stack overflow" + br i1 %replace_undef_0, label %"stack overflow", label %"no stack overflow" "GOTO or IF*2": ; preds = %"true verifyAndComputePtr89", %verifyNullCont84 unreachable @@ -27,151 +27,151 @@ ret void "no stack overflow": ; preds = %start - br i1 undef, label %verifyNullCont, label %"no stack overflow.end_crit_edge" + br i1 %replace_undef_1, 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 %replace_undef_2, 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 %replace_undef_3, 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 %replace_undef_4, 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 %replace_undef_5, 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 %replace_undef_6, 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 %replace_undef_7, 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 %replace_undef_8, 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 %replace_undef_9, 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 %replace_undef_10, 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 %replace_undef_11, 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 %replace_undef_12, 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 %replace_undef_13, 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 %replace_undef_14, 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 %replace_undef_15, label %end, label %verifyNullCont60 verifyNullCont60: ; preds = %"no exception block35" - br i1 undef, label %verifyNullCont63, label %verifyNullCont60.end_crit_edge + br i1 %replace_undef_16, 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 %replace_undef_17, 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 %replace_undef_18, 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 %replace_undef_19, 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 %replace_undef_20, 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 %replace_undef_21, 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 %replace_undef_22, 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 %replace_undef_23, 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 %replace_undef_24, 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 %replace_undef_25, 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 %replace_undef_26, label %verifyNullExit80, label %verifyNullCont81 verifyNullCont78.end_crit_edge: ; preds = %verifyNullCont78 ret void @@ -185,28 +185,28 @@ br i1 %5, label %verifyNullCont84, label %verifyNullCont172 verifyNullCont84: ; preds = %verifyNullCont81 - br i1 undef, label %"GOTO or IF*2", label %verifyNullCont86 + br i1 %replace_undef_27, label %"GOTO or IF*2", label %verifyNullCont86 verifyNullCont86: ; preds = %verifyNullCont84 - br i1 undef, label %"true verifyAndComputePtr", label %"false verifyAndComputePtr" + br i1 %replace_undef_28, label %"true verifyAndComputePtr", label %"false verifyAndComputePtr" "true verifyAndComputePtr": ; preds = %verifyNullCont86 - br i1 undef, label %"true verifyAndComputePtr89", label %"false verifyAndComputePtr90" + br i1 %replace_undef_29, 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 %replace_undef_30, 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 %replace_undef_31, 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 %replace_undef_32, 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 --- a/llvm/test/Analysis/ScalarEvolution/pr22674.ll +++ b/llvm/test/Analysis/ScalarEvolution/pr22674.ll @@ -11,12 +11,12 @@ %"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 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2, i1 %replace_undef_3, i1 %replace_undef_4, i1 %replace_undef_5, i1 %replace_undef_6) #0 align 2 { entry: - br i1 undef, label %cond.false, label %_ZNK4llvm12AttributeSet11getNumSlotsEv.exit + br i1 %replace_undef_0, 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 %replace_undef_1, 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 @@ unreachable _ZNK4llvm12AttributeSet12getSlotIndexEj.exit: ; preds = %land.lhs.true.i - br i1 undef, label %for.end, label %for.inc + br i1 %replace_undef_2, 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 %replace_undef_3, 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 %replace_undef_4, label %cond.false, label %_ZNK4llvm12AttributeSet3endEj.exit cond.false: ; preds = %for.end, %for.inc, %_ZNK4llvm12AttributeSet11getNumSlotsEv.exit, %entry unreachable @@ -49,7 +49,7 @@ %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 %replace_undef_5, 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 @@ _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 %replace_undef_6, 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 --- 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 %replace_undef_0, i1 %replace_undef_1, i1 %replace_undef_2) { block_A: %0 = sext i32 undef to i64 - br i1 undef, label %block_F, label %block_G + br i1 %replace_undef_0, label %block_F, label %block_G block_C: ; preds = %block_F - br i1 undef, label %block_D, label %block_E + br i1 %replace_undef_1, label %block_D, label %block_E block_D: ; preds = %block_D, %block_C - br i1 undef, label %block_E, label %block_D + br i1 %replace_undef_2, 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 --- a/llvm/test/Analysis/ScalarEvolution/pr25369.ll +++ b/llvm/test/Analysis/ScalarEvolution/pr25369.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 @hoge1() { +define void @hoge1( i1 %replace_undef_0) { ; CHECK-LABEL: Classifying expressions for: @hoge1 bb: - br i1 undef, label %bb4, label %bb2 + br i1 %replace_undef_0, label %bb4, label %bb2 bb2: ; preds = %bb2, %bb br i1 false, label %bb4, label %bb2 @@ -40,10 +40,10 @@ ret void } -define void @hoge2() { +define void @hoge2( i1 %replace_undef_0) { ; CHECK-LABEL: Classifying expressions for: @hoge2 bb: - br i1 undef, label %bb4, label %bb2 + br i1 %replace_undef_0, 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 --- a/llvm/test/Analysis/ScalarEvolution/scev-aa.ll +++ b/llvm/test/Analysis/ScalarEvolution/scev-aa.ll @@ -223,7 +223,7 @@ ; 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 %replace_undef_0) { entry: load double, ptr %data br label %for.body @@ -231,7 +231,7 @@ 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 %replace_undef_0, label %subloop1, label %subloop2 subloop1: %iv1 = phi i32 [0, %for.body], [%iv1.next, %subloop1] @@ -266,7 +266,7 @@ ; 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 %replace_undef_0) { entry: load double, ptr %data br label %for.body @@ -274,7 +274,7 @@ 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 %replace_undef_0, 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 --- a/llvm/test/Analysis/ScalarEvolution/scev-canonical-mode.ll +++ b/llvm/test/Analysis/ScalarEvolution/scev-canonical-mode.ll @@ -6,12 +6,12 @@ target triple = "x86_64-unknown-linux-gnu" ; Function Attrs: norecurse nounwind uwtable -define void @ehF() #0 { +define void @ehF( i1 %replace_undef_0, i1 %replace_undef_1) #0 { entry: - br i1 undef, label %if.then.i, label %hup.exit + br i1 %replace_undef_0, 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 %replace_undef_1, 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 --- 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 %replace_undef_0) { entry: %xor1 = xor i32 0, 1 br label %b17 b17: - br i1 undef, label %b22, label %b18 + br i1 %replace_undef_0, 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 --- 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" < %s 2>&1 | FileCheck %s -define void @test_lshr() { +define void @test_lshr( i1 %replace_undef_0) { ; CHECK-LABEL: 'test_lshr' ; CHECK-NEXT: Classifying expressions for: @test_lshr ; CHECK-NEXT: %iv.lshr = phi i64 [ 1023, %entry ], [ %iv.lshr.next, %loop ] @@ -19,13 +19,13 @@ 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 %replace_undef_0, label %exit, label %loop exit: ret void } ; Deliberate overflow doesn't change range -define void @test_lshr2() { +define void @test_lshr2( i1 %replace_undef_0) { ; CHECK-LABEL: 'test_lshr2' ; CHECK-NEXT: Classifying expressions for: @test_lshr2 ; CHECK-NEXT: %iv.lshr = phi i64 [ 1023, %entry ], [ %iv.lshr.next, %loop ] @@ -43,13 +43,13 @@ 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 %replace_undef_0, label %exit, label %loop exit: ret void } -define void @test_ashr_zeros() { +define void @test_ashr_zeros( i1 %replace_undef_0) { ; 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 ] @@ -67,12 +67,12 @@ 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 %replace_undef_0, label %exit, label %loop exit: ret void } -define void @test_ashr_ones() { +define void @test_ashr_ones( i1 %replace_undef_0) { ; 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 ] @@ -90,13 +90,13 @@ 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 %replace_undef_0, 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 %replace_undef_0) { ; 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 ] @@ -114,14 +114,14 @@ 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 %replace_undef_0, 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 %replace_undef_0) { ; 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 ] @@ -139,14 +139,14 @@ 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 %replace_undef_0, 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 %replace_undef_0) { ; 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 ] @@ -164,13 +164,13 @@ 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 %replace_undef_0, label %exit, label %loop exit: ret void } -define void @test_shl() { +define void @test_shl( i1 %replace_undef_0) { ; CHECK-LABEL: 'test_shl' ; CHECK-NEXT: Classifying expressions for: @test_shl ; CHECK-NEXT: %iv.shl = phi i64 [ 8, %entry ], [ %iv.shl.next, %loop ] @@ -188,7 +188,7 @@ 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 %replace_undef_0, label %exit, label %loop exit: ret void } @@ -423,7 +423,7 @@ ; 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 %replace_undef_0) { ; CHECK-LABEL: 'unreachable_binop' ; CHECK-NEXT: Classifying expressions for: @unreachable_binop ; CHECK-NEXT: %p_58.addr.1 = phi i32 [ undef, %header ], [ %sub2629, %unreachable ] @@ -444,7 +444,7 @@ for.cond2295: %p_58.addr.1 = phi i32 [ undef, %header ], [ %sub2629, %unreachable ] - br i1 undef, label %if.then2321, label %header + br i1 %replace_undef_0, 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 --- a/llvm/test/Analysis/ValueTracking/memory-dereferenceable.ll +++ b/llvm/test/Analysis/ValueTracking/memory-dereferenceable.ll @@ -287,10 +287,10 @@ ; 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 %replace_undef_0) { entry: %ptr8 = getelementptr inbounds i8, ptr %a, i32 8 - br i1 undef, label %if.then, label %if.end + br i1 %replace_undef_0, label %if.then, label %if.end if.then: %res = load i32, ptr %ptr8, align 4 diff --git a/llvm/test/Analysis/ValueTracking/shift-recurrence-knownbits.ll b/llvm/test/Analysis/ValueTracking/shift-recurrence-knownbits.ll --- a/llvm/test/Analysis/ValueTracking/shift-recurrence-knownbits.ll +++ b/llvm/test/Analysis/ValueTracking/shift-recurrence-knownbits.ll @@ -1,12 +1,11 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt < %s -passes=instcombine -S | FileCheck %s -define i64 @test_lshr() { +define i64 @test_lshr( i1 %replace_undef_0) { ; CHECK-LABEL: @test_lshr( ; CHECK-NEXT: entry: ; CHECK-NEXT: br label [[LOOP:%.*]] ; CHECK: loop: -; CHECK-NEXT: br i1 undef, label [[EXIT:%.*]], label [[LOOP]] ; CHECK: exit: ; CHECK-NEXT: ret i64 1023 ; @@ -15,18 +14,17 @@ 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 %replace_undef_0, label %exit, label %loop exit: %res = or i64 %iv.lshr, 1023 ret i64 %res } -define i64 @test_ashr_zeros() { +define i64 @test_ashr_zeros( i1 %replace_undef_0) { ; CHECK-LABEL: @test_ashr_zeros( ; CHECK-NEXT: entry: ; CHECK-NEXT: br label [[LOOP:%.*]] ; CHECK: loop: -; CHECK-NEXT: br i1 undef, label [[EXIT:%.*]], label [[LOOP]] ; CHECK: exit: ; CHECK-NEXT: ret i64 1023 ; @@ -35,18 +33,17 @@ 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 %replace_undef_0, label %exit, label %loop exit: %res = or i64 %iv.ashr, 1023 ret i64 %res } -define i64 @test_ashr_ones() { +define i64 @test_ashr_ones( i1 %replace_undef_0) { ; CHECK-LABEL: @test_ashr_ones( ; CHECK-NEXT: entry: ; CHECK-NEXT: br label [[LOOP:%.*]] ; CHECK: loop: -; CHECK-NEXT: br i1 undef, label [[EXIT:%.*]], label [[LOOP]] ; CHECK: exit: ; CHECK-NEXT: ret i64 -1 ; @@ -55,19 +52,18 @@ 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 %replace_undef_0, label %exit, label %loop exit: %res = or i64 %iv.ashr, 1023 ret i64 %res } ; Same as previous, but swapped operands to phi -define i64 @test_ashr_ones2() { +define i64 @test_ashr_ones2( i1 %replace_undef_0) { ; CHECK-LABEL: @test_ashr_ones2( ; CHECK-NEXT: entry: ; CHECK-NEXT: br label [[LOOP:%.*]] ; CHECK: loop: -; CHECK-NEXT: br i1 undef, label [[EXIT:%.*]], label [[LOOP]] ; CHECK: exit: ; CHECK-NEXT: ret i64 -1 ; @@ -76,7 +72,7 @@ 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 %replace_undef_0, label %exit, label %loop exit: %res = or i64 %iv.ashr, 1023 ret i64 %res @@ -84,14 +80,13 @@ ; negative case for when start is unknown -define i64 @test_ashr_unknown(i64 %start) { +define i64 @test_ashr_unknown(i64 %start, i1 %replace_undef_0) { ; CHECK-LABEL: @test_ashr_unknown( ; CHECK-NEXT: entry: ; CHECK-NEXT: br label [[LOOP:%.*]] ; CHECK: loop: ; CHECK-NEXT: [[IV_ASHR:%.*]] = phi i64 [ [[START:%.*]], [[ENTRY:%.*]] ], [ [[IV_ASHR_NEXT:%.*]], [[LOOP]] ] ; CHECK-NEXT: [[IV_ASHR_NEXT]] = ashr i64 [[IV_ASHR]], 1 -; CHECK-NEXT: br i1 undef, label [[EXIT:%.*]], label [[LOOP]] ; CHECK: exit: ; CHECK-NEXT: [[RES:%.*]] = or i64 [[IV_ASHR]], 1023 ; CHECK-NEXT: ret i64 [[RES]] @@ -101,7 +96,7 @@ 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 %replace_undef_0, label %exit, label %loop exit: %res = or i64 %iv.ashr, 1023 ret i64 %res @@ -109,14 +104,13 @@ ; 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 i64 @test_ashr_wrong_op(i64 %start) { +define i64 @test_ashr_wrong_op(i64 %start, i1 %replace_undef_0) { ; CHECK-LABEL: @test_ashr_wrong_op( ; CHECK-NEXT: entry: ; CHECK-NEXT: br label [[LOOP:%.*]] ; CHECK: loop: ; CHECK-NEXT: [[IV_ASHR:%.*]] = phi i64 [ [[START:%.*]], [[ENTRY:%.*]] ], [ [[IV_ASHR_NEXT:%.*]], [[LOOP]] ] ; CHECK-NEXT: [[IV_ASHR_NEXT]] = lshr i64 1, [[IV_ASHR]] -; CHECK-NEXT: br i1 undef, label [[EXIT:%.*]], label [[LOOP]] ; CHECK: exit: ; CHECK-NEXT: [[RES:%.*]] = or i64 [[IV_ASHR]], 1023 ; CHECK-NEXT: ret i64 [[RES]] @@ -126,19 +120,18 @@ 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 %replace_undef_0, label %exit, label %loop exit: %res = or i64 %iv.ashr, 1023 ret i64 %res } -define i64 @test_shl() { +define i64 @test_shl( i1 %replace_undef_0) { ; CHECK-LABEL: @test_shl( ; CHECK-NEXT: entry: ; CHECK-NEXT: br label [[LOOP:%.*]] ; CHECK: loop: -; CHECK-NEXT: br i1 undef, label [[EXIT:%.*]], label [[LOOP]] ; CHECK: exit: ; CHECK-NEXT: ret i64 0 ; @@ -147,7 +140,7 @@ 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 %replace_undef_0, label %exit, label %loop exit: %res = and i64 %iv.shl, 7 ret i64 %res