1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 4
2 ; RUN: opt < %s "-passes=print<scalar-evolution>" -scalar-evolution-classify-expressions=0 -disable-output 2>&1 | FileCheck %s
4 ; One side exit dominating the latch, exact backedge taken count is known.
5 define void @test_01() {
6 ; CHECK-LABEL: 'test_01'
7 ; CHECK-NEXT: Determining loop execution counts for: @test_01
8 ; CHECK-NEXT: Loop %loop: <multiple exits> backedge-taken count is i32 50
9 ; CHECK-NEXT: exit count for loop: i32 50
10 ; CHECK-NEXT: exit count for backedge: i32 100
11 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is i32 50
12 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is i32 50
13 ; CHECK-NEXT: symbolic max exit count for loop: i32 50
14 ; CHECK-NEXT: symbolic max exit count for backedge: i32 100
15 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
21 %iv = phi i32 [ 0, %entry ], [ %iv.next, %backedge ]
22 %side.cond = icmp slt i32 %iv, 50
23 br i1 %side.cond, label %backedge, label %side.exit
26 %iv.next = add i32 %iv, 1
27 %loop.cond = icmp slt i32 %iv, 100
28 br i1 %loop.cond, label %loop, label %exit
37 define void @test_02(i1 %c) {
38 ; CHECK-LABEL: 'test_02'
39 ; CHECK-NEXT: Determining loop execution counts for: @test_02
40 ; CHECK-NEXT: Loop %loop: <multiple exits> backedge-taken count is i32 50
41 ; CHECK-NEXT: exit count for merge: i32 50
42 ; CHECK-NEXT: exit count for backedge: i32 100
43 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is i32 50
44 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is i32 50
45 ; CHECK-NEXT: symbolic max exit count for merge: i32 50
46 ; CHECK-NEXT: symbolic max exit count for backedge: i32 100
47 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
53 %iv = phi i32 [ 0, %entry ], [ %iv.next, %backedge ]
54 br i1 %c, label %if.true, label %if.false
63 %side.cond = icmp slt i32 %iv, 50
64 br i1 %side.cond, label %backedge, label %side.exit
67 %iv.next = add i32 %iv, 1
68 %loop.cond = icmp slt i32 %iv, 100
69 br i1 %loop.cond, label %loop, label %exit