1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 4
2 ; RUN: opt -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-classify-expressions=0 < %s 2>&1 | FileCheck %s
4 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
5 target triple = "x86_64-unknown-linux-gnu"
10 ; CHECK-NEXT: Determining loop execution counts for: @hoge1
11 ; CHECK-NEXT: Loop %bb13: backedge-taken count is (-2 + (2 * undef) + %tmp7 + %tmp6)
12 ; CHECK-NEXT: Loop %bb13: constant max backedge-taken count is i32 -1
13 ; CHECK-NEXT: Loop %bb13: symbolic max backedge-taken count is (-2 + (2 * undef) + %tmp7 + %tmp6)
14 ; CHECK-NEXT: Loop %bb13: Trip multiple is 1
15 ; CHECK-NEXT: Loop %bb4: backedge-taken count is i64 20
16 ; CHECK-NEXT: Loop %bb4: constant max backedge-taken count is i64 20
17 ; CHECK-NEXT: Loop %bb4: symbolic max backedge-taken count is i64 20
18 ; CHECK-NEXT: Loop %bb4: Trip multiple is 21
19 ; CHECK-NEXT: Loop %bb2: Unpredictable backedge-taken count.
20 ; CHECK-NEXT: Loop %bb2: Unpredictable constant max backedge-taken count.
21 ; CHECK-NEXT: Loop %bb2: Unpredictable symbolic max backedge-taken count.
24 br i1 undef, label %bb4, label %bb2
26 bb2: ; preds = %bb2, %bb
27 br i1 false, label %bb4, label %bb2
30 %tmp = add i32 %tmp10, -1
33 bb4: ; preds = %bb4, %bb2, %bb
34 %tmp5 = phi i64 [ %tmp11, %bb4 ], [ 1, %bb2 ], [ 1, %bb ]
35 %tmp6 = phi i32 [ %tmp10, %bb4 ], [ 0, %bb2 ], [ 0, %bb ]
36 %tmp7 = load i32, ptr undef, align 4
37 %tmp8 = add i32 %tmp7, %tmp6
38 %tmp9 = add i32 undef, %tmp8
39 %tmp10 = add i32 undef, %tmp9
40 %tmp11 = add nsw i64 %tmp5, 3
41 %tmp12 = icmp eq i64 %tmp11, 64
42 br i1 %tmp12, label %bb3, label %bb4
45 bb13: ; preds = %bb13, %bb3
46 %tmp14 = phi i64 [ 0, %bb3 ], [ %tmp15, %bb13 ]
47 %tmp15 = add nuw nsw i64 %tmp14, 1
48 %tmp16 = trunc i64 %tmp15 to i32
49 %tmp17 = icmp eq i32 %tmp16, %tmp
50 br i1 %tmp17, label %bb18, label %bb13
56 define void @hoge2() {
58 ; CHECK-LABEL: 'hoge2'
59 ; CHECK-NEXT: Determining loop execution counts for: @hoge2
60 ; CHECK-NEXT: Loop %bb13: backedge-taken count is (-2 + (2 * undef) + %tmp7 + %tmp6)
61 ; CHECK-NEXT: Loop %bb13: constant max backedge-taken count is i32 -1
62 ; CHECK-NEXT: Loop %bb13: symbolic max backedge-taken count is (-2 + (2 * undef) + %tmp7 + %tmp6)
63 ; CHECK-NEXT: Loop %bb13: Trip multiple is 1
64 ; CHECK-NEXT: Loop %bb4: Unpredictable backedge-taken count.
65 ; CHECK-NEXT: Loop %bb4: Unpredictable constant max backedge-taken count.
66 ; CHECK-NEXT: Loop %bb4: Unpredictable symbolic max backedge-taken count.
67 ; CHECK-NEXT: Loop %bb2: Unpredictable backedge-taken count.
68 ; CHECK-NEXT: Loop %bb2: Unpredictable constant max backedge-taken count.
69 ; CHECK-NEXT: Loop %bb2: Unpredictable symbolic max backedge-taken count.
72 br i1 undef, label %bb4, label %bb2
74 bb2: ; preds = %bb2, %bb
75 br i1 false, label %bb4, label %bb2
78 %tmp = add i32 %tmp10, -1
81 bb4: ; preds = %bb4, %bb2, %bb
82 %tmp5 = phi i64 [ %tmp11, %bb4 ], [ 1, %bb2 ], [ 3, %bb ]
83 %tmp6 = phi i32 [ %tmp10, %bb4 ], [ 0, %bb2 ], [ 0, %bb ]
84 %tmp7 = load i32, ptr undef, align 4
85 %tmp8 = add i32 %tmp7, %tmp6
86 %tmp9 = add i32 undef, %tmp8
87 %tmp10 = add i32 undef, %tmp9
88 %tmp11 = add nsw i64 %tmp5, 3
89 %tmp12 = icmp eq i64 %tmp11, 64
90 br i1 %tmp12, label %bb3, label %bb4
93 bb13: ; preds = %bb13, %bb3
94 %tmp14 = phi i64 [ 0, %bb3 ], [ %tmp15, %bb13 ]
95 %tmp15 = add nuw nsw i64 %tmp14, 1
96 %tmp16 = trunc i64 %tmp15 to i32
97 %tmp17 = icmp eq i32 %tmp16, %tmp
98 br i1 %tmp17, label %bb18, label %bb13
100 bb18: ; preds = %bb13