Skip to content

Commit e946b5a

Browse files
committed
[SCEV] Autogenerate more scev analysis check tests
1 parent fb7cc73 commit e946b5a

9 files changed

+204
-33
lines changed

llvm/test/Analysis/ScalarEvolution/2007-07-15-NegativeStride.ll

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1-
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-max-iterations=0 2>&1 | FileCheck %s
1+
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 4
2+
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-max-iterations=0 -scalar-evolution-classify-expressions=0 2>&1 | FileCheck %s
23
; PR1533
34

45
@array = weak global [101 x i32] zeroinitializer, align 32 ; <ptr> [#uses=1]
56

6-
; CHECK: Loop %bb: backedge-taken count is 100
77

88
define void @loop(i32 %x) {
9+
; CHECK-LABEL: 'loop'
10+
; CHECK-NEXT: Determining loop execution counts for: @loop
11+
; CHECK-NEXT: Loop %bb: backedge-taken count is 100
12+
; CHECK-NEXT: Loop %bb: constant max backedge-taken count is i32 100
13+
; CHECK-NEXT: Loop %bb: symbolic max backedge-taken count is 100
14+
; CHECK-NEXT: Loop %bb: Trip multiple is 101
15+
;
916
entry:
1017
br label %bb
1118

llvm/test/Analysis/ScalarEvolution/2007-09-27-LargeStepping.ll

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-max-iterations=0 2>&1 | FileCheck %s
1+
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 4
2+
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-max-iterations=0 -scalar-evolution-classify-expressions=0 2>&1 | FileCheck %s
23
; PR1706
34

4-
; CHECK: backedge-taken count is 13
55

66
define i32 @f() {
7+
; CHECK-LABEL: 'f'
8+
; CHECK-NEXT: Determining loop execution counts for: @f
9+
; CHECK-NEXT: Loop %bb5: backedge-taken count is 13
10+
; CHECK-NEXT: Loop %bb5: constant max backedge-taken count is i32 13
11+
; CHECK-NEXT: Loop %bb5: symbolic max backedge-taken count is 13
12+
; CHECK-NEXT: Loop %bb5: Trip multiple is 14
13+
;
714
entry:
815
br label %bb5
916

llvm/test/Analysis/ScalarEvolution/2008-05-25-NegativeStepToZero.ll

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-max-iterations=0 2>&1 | FileCheck %s
1+
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 4
2+
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-max-iterations=0 -scalar-evolution-classify-expressions=0 2>&1 | FileCheck %s
23
; PR2364
34

4-
; CHECK: backedge-taken count is 61
55

66
define i32 @func_6() nounwind {
7+
; CHECK-LABEL: 'func_6'
8+
; CHECK-NEXT: Determining loop execution counts for: @func_6
9+
; CHECK-NEXT: Loop %bb5: backedge-taken count is 61
10+
; CHECK-NEXT: Loop %bb5: constant max backedge-taken count is i8 61
11+
; CHECK-NEXT: Loop %bb5: symbolic max backedge-taken count is 61
12+
; CHECK-NEXT: Loop %bb5: Trip multiple is 62
13+
;
714
entry:
815
br label %bb5
916

llvm/test/Analysis/ScalarEvolution/2008-07-19-WrappingIV.ll

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-max-iterations=0 2>&1 | FileCheck %s
1+
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 4
2+
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-max-iterations=0 -scalar-evolution-classify-expressions=0 2>&1 | FileCheck %s
23
; PR2088
34

4-
; CHECK: backedge-taken count is 113
55

66
define void @fun() {
7+
; CHECK-LABEL: 'fun'
8+
; CHECK-NEXT: Determining loop execution counts for: @fun
9+
; CHECK-NEXT: Loop %loop: backedge-taken count is 113
10+
; CHECK-NEXT: Loop %loop: constant max backedge-taken count is i8 113
11+
; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is 113
12+
; CHECK-NEXT: Loop %loop: Trip multiple is 114
13+
;
714
entry:
815
br label %loop
916
loop:

llvm/test/Analysis/ScalarEvolution/2008-12-08-FiniteSGE.ll

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck %s
1+
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 4
2+
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-classify-expressions=0 2>&1 | FileCheck %s
23

3-
; CHECK: backedge-taken count is 255
44

55
define i32 @foo(i32 %x, i32 %y, ptr %lam, ptr %alp) nounwind {
6+
; CHECK-LABEL: 'foo'
7+
; CHECK-NEXT: Determining loop execution counts for: @foo
8+
; CHECK-NEXT: Loop %bb1: backedge-taken count is 255
9+
; CHECK-NEXT: Loop %bb1: constant max backedge-taken count is i32 255
10+
; CHECK-NEXT: Loop %bb1: symbolic max backedge-taken count is 255
11+
; CHECK-NEXT: Loop %bb1: Trip multiple is 256
12+
;
613
bb1.thread:
714
br label %bb1
815

llvm/test/Analysis/ScalarEvolution/2009-05-09-PointerEdgeCount.ll

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
1-
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck %s
1+
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 4
2+
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-classify-expressions=0 2>&1 | FileCheck %s
23
; PR3171
34

4-
; CHECK: count is 2
55

66
target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"
77

88
%struct.Foo = type { i32 }
99
%struct.NonPod = type { [2 x %struct.Foo] }
1010

1111
define void @_Z3foov() nounwind {
12+
; CHECK-LABEL: '_Z3foov'
13+
; CHECK-NEXT: Determining loop execution counts for: @_Z3foov
14+
; CHECK-NEXT: Loop %bb1.i: backedge-taken count is 2
15+
; CHECK-NEXT: Loop %bb1.i: constant max backedge-taken count is i64 2
16+
; CHECK-NEXT: Loop %bb1.i: symbolic max backedge-taken count is 2
17+
; CHECK-NEXT: Loop %bb1.i: Trip multiple is 3
18+
;
1219
entry:
1320
%x = alloca %struct.NonPod, align 8 ; <ptr> [#uses=2]
1421
%0 = getelementptr %struct.NonPod, ptr %x, i32 0, i32 0 ; <ptr> [#uses=1]

llvm/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1-
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-max-iterations=0 2>&1 | FileCheck %s
1+
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 4
2+
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-max-iterations=0 -scalar-evolution-classify-expressions=0 2>&1 | FileCheck %s
23

34
; PR1101
45

5-
@A = weak global [1000 x i32] zeroinitializer, align 32
6+
@A = weak global [1000 x i32] zeroinitializer, align 32
67

78
define void @test1(i32 %N) {
9+
; CHECK-LABEL: 'test1'
10+
; CHECK-NEXT: Determining loop execution counts for: @test1
11+
; CHECK-NEXT: Loop %bb3: backedge-taken count is 100
12+
; CHECK-NEXT: Loop %bb3: constant max backedge-taken count is i32 100
13+
; CHECK-NEXT: Loop %bb3: symbolic max backedge-taken count is 100
14+
; CHECK-NEXT: Loop %bb3: Trip multiple is 101
15+
;
816
entry:
917
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
1018
br label %bb3
@@ -29,14 +37,21 @@ bb5: ; preds = %bb3
2937
return: ; preds = %bb5
3038
ret void
3139
}
32-
; CHECK: Determining loop execution counts for: @test1
33-
; CHECK-NEXT: backedge-taken count is 100
3440

3541

3642
; PR10383
3743
; These next two used to crash.
3844

3945
define void @test2(i1 %cmp, i64 %n) {
46+
; CHECK-LABEL: 'test2'
47+
; CHECK-NEXT: Determining loop execution counts for: @test2
48+
; CHECK-NEXT: Loop %for.body2: Unpredictable backedge-taken count.
49+
; CHECK-NEXT: Loop %for.body2: Unpredictable constant max backedge-taken count.
50+
; CHECK-NEXT: Loop %for.body2: Unpredictable symbolic max backedge-taken count.
51+
; CHECK-NEXT: Loop %for.body1: Unpredictable backedge-taken count.
52+
; CHECK-NEXT: Loop %for.body1: Unpredictable constant max backedge-taken count.
53+
; CHECK-NEXT: Loop %for.body1: Unpredictable symbolic max backedge-taken count.
54+
;
4055
entry:
4156
br label %for.body1
4257

@@ -59,9 +74,14 @@ for.body2:
5974
end:
6075
ret void
6176
}
62-
; CHECK: Determining loop execution counts for: @test2
6377

6478
define i32 @test3() {
79+
; CHECK-LABEL: 'test3'
80+
; CHECK-NEXT: Determining loop execution counts for: @test3
81+
; CHECK-NEXT: Loop %for.inc479: Unpredictable backedge-taken count.
82+
; CHECK-NEXT: Loop %for.inc479: Unpredictable constant max backedge-taken count.
83+
; CHECK-NEXT: Loop %for.inc479: Unpredictable symbolic max backedge-taken count.
84+
;
6585
if.then466:
6686
br i1 undef, label %for.cond539.preheader, label %for.inc479
6787

@@ -78,12 +98,17 @@ for.inc479:
7898
for.cond539.preheader:
7999
unreachable
80100
}
81-
; CHECK: Determining loop execution counts for: @test3
82101

83102
; PR13489
84103
; We used to crash on this too.
85104

86105
define void @test4() {
106+
; CHECK-LABEL: 'test4'
107+
; CHECK-NEXT: Determining loop execution counts for: @test4
108+
; CHECK-NEXT: Loop %for.body: Unpredictable backedge-taken count.
109+
; CHECK-NEXT: Loop %for.body: Unpredictable constant max backedge-taken count.
110+
; CHECK-NEXT: Loop %for.body: Unpredictable symbolic max backedge-taken count.
111+
;
87112
entry:
88113
br label %for.body
89114

@@ -99,4 +124,3 @@ for.end: ; preds = %for.body
99124
ret void
100125
}
101126

102-
; CHECK: Determining loop execution counts for: @test4

llvm/test/Analysis/ScalarEvolution/exact_iter_count.ll

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1-
; RUN: opt < %s "-passes=print<scalar-evolution>" -disable-output 2>&1 | FileCheck %s
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
23

34
; One side exit dominating the latch, exact backedge taken count is known.
45
define void @test_01() {
5-
6-
; CHECK-LABEL: Determining loop execution counts for: @test_01
6+
; CHECK-LABEL: 'test_01'
7+
; CHECK-NEXT: Determining loop execution counts for: @test_01
78
; CHECK-NEXT: Loop %loop: <multiple exits> backedge-taken count is 50
8-
9+
; CHECK-NEXT: exit count for loop: 50
10+
; CHECK-NEXT: exit count for backedge: 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 50
13+
; CHECK-NEXT: symbolic max exit count for loop: 50
14+
; CHECK-NEXT: symbolic max exit count for backedge: 100
15+
; CHECK-NEXT: Loop %loop: Trip multiple is 1
16+
;
917
entry:
1018
br label %loop
1119

@@ -27,10 +35,17 @@ side.exit:
2735
}
2836

2937
define void @test_02(i1 %c) {
30-
31-
; CHECK-LABEL: Determining loop execution counts for: @test_02
38+
; CHECK-LABEL: 'test_02'
39+
; CHECK-NEXT: Determining loop execution counts for: @test_02
3240
; CHECK-NEXT: Loop %loop: <multiple exits> backedge-taken count is 50
33-
41+
; CHECK-NEXT: exit count for merge: 50
42+
; CHECK-NEXT: exit count for backedge: 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 50
45+
; CHECK-NEXT: symbolic max exit count for merge: 50
46+
; CHECK-NEXT: symbolic max exit count for backedge: 100
47+
; CHECK-NEXT: Loop %loop: Trip multiple is 1
48+
;
3449
entry:
3550
br label %loop
3651

0 commit comments

Comments
 (0)