1 ; RUN: opt -analyze -enable-new-pm=0 -scalar-evolution < %s | FileCheck %s
2 ; RUN: opt -disable-output "-passes=print<scalar-evolution>" < %s 2>&1 | FileCheck %s
4 define i32 @slt_trip_count_with_range(i32 *%ptr0, i32 *%ptr1) {
5 ; CHECK-LABEL: slt_trip_count_with_range
7 %limit = load i32, i32* %ptr0, !range !0
11 ; CHECK: Loop %loop: max backedge-taken count is 98
12 %index = phi i32 [ 0, %entry ], [ %index.inc, %loop ]
13 %index.inc = add i32 %index, 1
14 %continue = icmp slt i32 %index.inc, %limit
15 br i1 %continue, label %loop, label %loop.exit
21 define i32 @ult_trip_count_with_range(i32 *%ptr0, i32 *%ptr1) {
22 ; CHECK-LABEL: ult_trip_count_with_range
24 %limit = load i32, i32* %ptr0, !range !0
28 ; CHECK: Loop %loop: max backedge-taken count is 98
29 %index = phi i32 [ 0, %entry ], [ %index.inc, %loop ]
30 %index.inc = add i32 %index, 1
31 %continue = icmp ult i32 %index.inc, %limit
32 br i1 %continue, label %loop, label %loop.exit
38 !0 = !{i32 1, i32 100}