1 ; RUN: opt -S -verify-loop-info -irce-print-changed-loops -passes=irce -irce-min-eliminated-checks=51 < %s 2>&1 | FileCheck %s --check-prefixes=CHECK-NO
2 ; RUN: opt -S -verify-loop-info -irce-print-changed-loops -passes=irce -irce-min-eliminated-checks=50 < %s 2>&1 | FileCheck %s --check-prefixes=CHECK-YES
4 ; CHECK-YES: constrained Loop
5 ; CHECK-NO-NOT: constrained Loop
9 define i32 @foo(ptr %arr_a, ptr %a_len_ptr, i32 %n) {
11 %len.a = load i32, ptr %a_len_ptr, !range !0
12 %first.itr.check = icmp sgt i32 %n, 0
13 br i1 %first.itr.check, label %loop, label %exit, !prof !1
16 %idx = phi i32 [ 0, %entry ] , [ %idx.next, %backedge ]
17 %abc.a = icmp slt i32 %idx, %len.a
18 br i1 %abc.a, label %in.bounds.a, label %backedge, !prof !2
21 %addr.a = getelementptr i32, ptr %arr_a, i32 %idx
22 %val = load i32, ptr %addr.a
23 call void @bar(i32 %val)
27 %idx.next = add i32 %idx, 1
28 %next = icmp slt i32 %idx.next, %n
29 br i1 %next, label %loop, label %exit, !prof !3
35 !0 = !{i32 0, i32 2147483647}
36 !1 = !{!"branch_weights", i32 1024, i32 1}
37 !2 = !{!"branch_weights", i32 1, i32 1}
38 !3 = !{!"branch_weights", i32 99, i32 1}