1 ; RUN: opt -passes=loop-unroll -unroll-peel-count=2 -S -disable-output -debug-only=loop-unroll < %s 2>&1 | FileCheck %s
5 ; CHECK-LABEL: Loop Unroll: F[test] Loop %loop3
6 ; CHECK-NEXT: Loop Size = 7
7 ; CHECK-NEXT: PEELING loop %loop3 with iteration count 2!
8 ; CHECK-NEXT: Loop Unroll: F[test] Loop %loop2
9 ; CHECK-NEXT: Loop Size = 28
10 ; CHECK-NEXT: PEELING loop %loop2 with iteration count 2!
11 ; CHECK-NEXT: Loop Unroll: F[test] Loop %loop4
12 ; CHECK-NEXT: Loop Size = 3
13 ; CHECK-NEXT: PEELING loop %loop4 with iteration count 2!
14 ; CHECK-NEXT: Loop Unroll: F[test] Loop %loop1
15 ; CHECK-NEXT: Loop Size = 95
16 ; CHECK-NEXT: PEELING loop %loop1 with iteration count 2!
21 %phi = phi i32 [ 1, %entry ], [ 0, %loop1.latch ]
25 %phi3 = phi i64 [ 0, %loop1 ], [ %sext, %loop2.latch ]
29 %phi5 = phi i64 [ %phi3, %loop2 ], [ %sext, %loop3.latch ]
30 %phi6 = phi i32 [ 1, %loop2 ], [ %add10, %loop3.latch ]
31 %trunc = trunc i64 %phi5 to i32
32 br i1 true, label %loop3.latch, label %exit
35 %add = add i32 1, %phi
36 %sext = sext i32 %add to i64
37 %add10 = add i32 %phi6, 1
38 %icmp = icmp ugt i32 %add10, 2
39 br i1 %icmp, label %loop2.latch, label %loop3
42 br i1 false, label %loop4.preheader, label %loop2
48 br i1 false, label %loop1.latch, label %loop4
54 %phi8 = phi i32 [ %trunc, %loop3 ]