xref: /llvm-project/llvm/test/Analysis/ScalarEvolution/2007-08-06-Unsigned.ll (revision cf2e828925dc8c9656e800387820b49be03109d6)
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 5
2; RUN: opt < %s -passes="print<scalar-evolution>" -disable-output \
3; RUN:   -scalar-evolution-classify-expressions=0 2>&1 | FileCheck %s
4; PR1597
5
6define i32 @f(i32 %x, i32 %y) {
7; CHECK-LABEL: 'f'
8; CHECK-NEXT:  Determining loop execution counts for: @f
9; CHECK-NEXT:  Loop %bb: backedge-taken count is (-1 + (-1 * %x) + %y)
10; CHECK-NEXT:  Loop %bb: constant max backedge-taken count is i32 -1
11; CHECK-NEXT:  Loop %bb: symbolic max backedge-taken count is (-1 + (-1 * %x) + %y)
12; CHECK-NEXT:  Loop %bb: Trip multiple is 1
13;
14entry:
15  %tmp63 = icmp ult i32 %x, %y            ; <i1> [#uses=1]
16  br i1 %tmp63, label %bb.preheader, label %bb8
17
18bb.preheader:           ; preds = %entry
19  br label %bb
20
21bb:             ; preds = %bb3, %bb.preheader
22  %x_addr.0 = phi i32 [ %tmp2, %bb3 ], [ %x, %bb.preheader ]              ; <i32> [#uses=1]
23  %tmp2 = add i32 %x_addr.0, 1            ; <i32> [#uses=3]
24  br label %bb3
25
26bb3:            ; preds = %bb
27  %tmp6 = icmp ult i32 %tmp2, %y          ; <i1> [#uses=1]
28  br i1 %tmp6, label %bb, label %bb8.loopexit
29
30bb8.loopexit:           ; preds = %bb3
31  br label %bb8
32
33bb8:            ; preds = %bb8.loopexit, %entry
34  %x_addr.1 = phi i32 [ %x, %entry ], [ %tmp2, %bb8.loopexit ]            ; <i32> [#uses=1]
35  br label %return
36
37return:         ; preds = %bb8
38  ret i32 %x_addr.1
39}
40