1 ; RUN: opt < %s "-passes=print<scalar-evolution>" -disable-output 2>&1 | FileCheck %s
3 ; One side exit dominating the latch, exact backedge taken count is known.
4 define void @test_01() {
6 ; CHECK-LABEL: Determining loop execution counts for: @test_01
7 ; CHECK-NEXT: Loop %loop: <multiple exits> backedge-taken count is 50
13 %iv = phi i32 [ 0, %entry ], [ %iv.next, %backedge ]
14 %side.cond = icmp slt i32 %iv, 50
15 br i1 %side.cond, label %backedge, label %side.exit
18 %iv.next = add i32 %iv, 1
19 %loop.cond = icmp slt i32 %iv, 100
20 br i1 %loop.cond, label %loop, label %exit
29 define void @test_02(i1 %c) {
31 ; CHECK-LABEL: Determining loop execution counts for: @test_02
32 ; CHECK-NEXT: Loop %loop: <multiple exits> backedge-taken count is 50
38 %iv = phi i32 [ 0, %entry ], [ %iv.next, %backedge ]
39 br i1 %c, label %if.true, label %if.false
48 %side.cond = icmp slt i32 %iv, 50
49 br i1 %side.cond, label %backedge, label %side.exit
52 %iv.next = add i32 %iv, 1
53 %loop.cond = icmp slt i32 %iv, 100
54 br i1 %loop.cond, label %loop, label %exit