1 ; RUN: opt -S -loop-unroll < %s | FileCheck %s
2 ; RUN: opt < %s -passes='require<opt-remark-emit>,loop(unroll-full)' -S | FileCheck %s
4 ; LLVM should not try to fully unroll this loop.
10 define void @trivial_loop() {
11 ; CHECK-LABEL: @trivial_loop(
16 %idx = phi i32 [ 0, %entry ], [ %idx.inc, %loop ]
17 %idx.inc = add i32 %idx, 1
33 %be = icmp slt i32 %idx, 268435456
34 br i1 %be, label %loop, label %exit
37 ; CHECK-NEXT: %idx = phi i32 [ 0, %entry ], [ %idx.inc, %loop ]
38 ; CHECK-NEXT: %idx.inc = add i32 %idx, 1
39 ; CHECK-NEXT: call void @f()
40 ; CHECK-NEXT: call void @g()
41 ; CHECK-NEXT: call void @h()
42 ; CHECK-NEXT: call void @f()
43 ; CHECK-NEXT: call void @g()
44 ; CHECK-NEXT: call void @h()
45 ; CHECK-NEXT: call void @f()
46 ; CHECK-NEXT: call void @g()
47 ; CHECK-NEXT: call void @h()
48 ; CHECK-NEXT: call void @f()
49 ; CHECK-NEXT: call void @g()
50 ; CHECK-NEXT: call void @h()
51 ; CHECK-NEXT: call void @f()
52 ; CHECK-NEXT: call void @g()
53 ; CHECK-NEXT: call void @h()
54 ; CHECK-NEXT: %be = icmp slt i32 %idx, 268435456
55 ; CHECK-NEXT: br i1 %be, label %loop, label %exit