1 ; RUN: opt -irce-skip-profitability-checks -S -verify-loop-info -irce < %s | FileCheck %s
2 ; RUN: opt -irce-skip-profitability-checks -S -verify-loop-info -passes='require<branch-prob>,loop(irce)' < %s | FileCheck %s
4 define void @single_access_no_preloop_no_offset(i32 *%arr, i32 *%a_len_ptr, i32 %n) {
5 ; CHECK-LABEL: @single_access_no_preloop_no_offset(
6 ; CHECK: main.exit.selector:
8 %len = load i32, i32* %a_len_ptr, !range !0
9 %first.itr.check = icmp sgt i32 %n, 0
10 br i1 %first.itr.check, label %loop, label %exit
13 %idx = phi i32 [ 0, %entry ] , [ %idx.next, %in.bounds ]
14 %idx.next = add i32 %idx, 1
15 %abc = icmp slt i32 %idx, %len
16 br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1
19 %addr = getelementptr i32, i32* %arr, i32 %idx
20 store i32 0, i32* %addr
21 %next = icmp slt i32 %idx.next, %n
22 br i1 %next, label %loop, label %exit
31 !0 = !{i32 0, i32 2147483647}
32 !1 = !{!"branch_weights", i32 1, i32 64}