1 ; This test checks that nested loops are revisited in various scenarios when
2 ; unrolling. Note that if we ever start doing outer loop peeling a test case
3 ; for that should be added here.
5 ; RUN: opt < %s -disable-output -debug-pass-manager 2>&1 \
6 ; RUN: -passes='require<opt-remark-emit>,loop(loop-unroll-full)' \
9 ; Basic test is fully unrolled and we revisit the post-unroll new sibling
10 ; loops, including the ones that used to be child loops.
11 define void @full_unroll(ptr %ptr) {
12 ; CHECK-LABEL: OptimizationRemarkEmitterAnalysis on full_unroll
13 ; CHECK-NOT: LoopFullUnrollPass
19 %cond.0 = load volatile i1, ptr %ptr
20 br i1 %cond.0, label %l0.0.ph, label %exit
26 %iv = phi i32 [ %iv.next, %l0.0.latch ], [ 0, %l0.0.ph ]
27 %iv.next = add i32 %iv, 1
34 %cond.0.0.0 = load volatile i1, ptr %ptr
35 br i1 %cond.0.0.0, label %l0.0.0, label %l0.0.1.ph
36 ; CHECK: LoopFullUnrollPass on loop %l0.0.0
37 ; CHECK-NOT: LoopFullUnrollPass
43 %cond.0.0.1 = load volatile i1, ptr %ptr
44 br i1 %cond.0.0.1, label %l0.0.1, label %l0.0.latch
45 ; CHECK: LoopFullUnrollPass on loop %l0.0.1 in function full_unroll
46 ; CHECK-NOT: LoopFullUnrollPass
49 %cmp = icmp slt i32 %iv.next, 2
50 br i1 %cmp, label %l0.0, label %l0.latch
51 ; CHECK: LoopFullUnrollPass on loop %l0.0 in function full_unroll
52 ; CHECK-NOT: LoopFullUnrollPass
54 ; Unrolling occurs, so we visit what were the inner loops twice over. First we
55 ; visit their clones, and then we visit the original loops re-parented.
56 ; CHECK: LoopFullUnrollPass on loop %l0.0.1.1 in function full_unroll
57 ; CHECK-NOT: LoopFullUnrollPass
58 ; CHECK: LoopFullUnrollPass on loop %l0.0.0.1 in function full_unroll
59 ; CHECK-NOT: LoopFullUnrollPass
60 ; CHECK: LoopFullUnrollPass on loop %l0.0.1 in function full_unroll
61 ; CHECK-NOT: LoopFullUnrollPass
62 ; CHECK: LoopFullUnrollPass on loop %l0.0.0 in function full_unroll
63 ; CHECK-NOT: LoopFullUnrollPass
67 ; CHECK: LoopFullUnrollPass on loop %l0 in function full_unroll
68 ; CHECK-NOT: LoopFullUnrollPass