1 ; RUN: opt -disable-output "-passes=print<scalar-evolution>" < %s 2>&1 | FileCheck %s
3 define i32 @slt_trip_count_with_range(ptr %ptr0, ptr %ptr1) {
4 ; CHECK-LABEL: slt_trip_count_with_range
6 %limit = load i32, ptr %ptr0, !range !0
10 ; CHECK: Loop %loop: constant max backedge-taken count is 98
11 %index = phi i32 [ 0, %entry ], [ %index.inc, %loop ]
12 %index.inc = add i32 %index, 1
13 %continue = icmp slt i32 %index.inc, %limit
14 br i1 %continue, label %loop, label %loop.exit
20 define i32 @ult_trip_count_with_range(ptr %ptr0, ptr %ptr1) {
21 ; CHECK-LABEL: ult_trip_count_with_range
23 %limit = load i32, ptr %ptr0, !range !0
27 ; CHECK: Loop %loop: constant max backedge-taken count is 98
28 %index = phi i32 [ 0, %entry ], [ %index.inc, %loop ]
29 %index.inc = add i32 %index, 1
30 %continue = icmp ult i32 %index.inc, %limit
31 br i1 %continue, label %loop, label %loop.exit
37 !0 = !{i32 1, i32 100}