1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -S -loop-unroll -loop-unroll -verify-dom-info -debug-only=loop-unroll -unroll-peel-max-count=7 2>&1 | FileCheck %s
8 ; Check that we can peel off iterations that make conditions true.
9 ; The second invocation of loop-unroll will NOT do profile based peeling of
10 ; remained iterations because the total number of peeled iterations exceeds
11 ; threashold specified with -unroll-peel-max-count=7.
12 define void @test2(i32 %k) !prof !4 {
13 ; CHECK: Loop Unroll: F[test2] Loop %for.body
14 ; CHECK: PEELING loop %for.body with iteration count 2!
15 ; CHECK-NOT: llvm.loop.unroll.disable
20 %i.05 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.inc ]
21 %cmp1 = icmp ult i32 %i.05, 2
22 br i1 %cmp1, label %if.then, label %if.else
33 %inc = add nsw i32 %i.05, 1
34 %cmp = icmp slt i32 %inc, %k
35 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !1, !prof !3
42 !3 = !{!"branch_weights", i32 8, i32 1}
43 !4 = !{!"function_entry_count", i64 1}