llvm.org GIT mirror llvm / fee0a9c
Bunch of tests to check loop passes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40629 91177308-0d34-0410-b5e6-96231b3b80d8 Devang Patel 12 years ago
10 changed file(s) with 225 addition(s) and 21 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: llvm-as < %s | opt -loop-rotate -loop-unswitch -disable-output
1
2 define i32 @stringSearch_Clib(i32 %count) {
3 entry:
4 br i1 false, label %bb36, label %bb44
5
6 cond_true20: ; preds = %bb36
7 %tmp33 = add i32 0, 0 ; [#uses=1]
8 br label %bb36
9
10 bb36: ; preds = %cond_true20, %entry
11 %c.2 = phi i32 [ %tmp33, %cond_true20 ], [ 0, %entry ] ; [#uses=1]
12 br i1 false, label %cond_true20, label %bb41
13
14 bb41: ; preds = %bb36
15 %c.2.lcssa = phi i32 [ %c.2, %bb36 ] ; [#uses=0]
16 ret i32 0
17
18 bb44: ; preds = %entry
19 ret i32 0
20 }
0 ; RUN: llvm-as < %s | opt -loop-rotate -licm -loop-unswitch -disable-output
1
2 define i32 @main(i32 %argc, i8** %argv) {
3 entry:
4 br label %bb7
5
6 bb7: ; preds = %bb7, %entry
7 %tmp54 = icmp slt i32 0, 2000000 ; [#uses=1]
8 br i1 %tmp54, label %bb7, label %bb56
9
10 bb56: ; preds = %bb7
11 ret i32 0
12 }
0 ; RUN: llvm-as < %s | opt -loop-rotate -licm -loop-unswitch -disable-output
1 define i32 @main(i32 %argc, i8** %argv) {
2 entry:
3 br label %bb7
4
5 bb7: ; preds = %bb7, %entry
6 %tmp39 = load <4 x float>* null ; <<4 x float>> [#uses=1]
7 %tmp40 = add <4 x float> %tmp39, < float 2.000000e+00, float 3.000000e+00, float 1.000000e+00, float 0.000000e+00 > ; <<4 x float>> [#uses=1]
8 %tmp43 = add <4 x float> %tmp40, < float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 2.000000e+00 > ; <<4 x float>> [#uses=1]
9 %tmp46 = add <4 x float> %tmp43, < float 3.000000e+00, float 0.000000e+00, float 2.000000e+00, float 4.000000e+00 > ; <<4 x float>> [#uses=1]
10 %tmp49 = add <4 x float> %tmp46, < float 0.000000e+00, float 4.000000e+00, float 6.000000e+00, float 1.000000e+00 > ; <<4 x float>> [#uses=1]
11 store <4 x float> %tmp49, <4 x float>* null
12 br i1 false, label %bb7, label %bb56
13
14 bb56: ; preds = %bb7
15 ret i32 0
16 }
0 ; RUN: llvm-as < %s | opt -loop-rotate -licm -loop-unswitch -disable-output
1
2 define i32 @main(i32 %argc, i8** %argv) {
3 entry:
4 br label %bb
5
6 bb: ; preds = %bb56, %entry
7 br label %bb7
8
9 bb7: ; preds = %bb7, %bb
10 %tmp39 = load <4 x float>* null ; <<4 x float>> [#uses=1]
11 %tmp40 = add <4 x float> %tmp39, < float 2.000000e+00, float 3.000000e+00, float 1.000000e+00, float 0.000000e+00 > ; <<4 x float>> [#uses=1]
12 %tmp43 = add <4 x float> %tmp40, < float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 2.000000e+00 > ; <<4 x float>> [#uses=1]
13 %tmp46 = add <4 x float> %tmp43, < float 3.000000e+00, float 0.000000e+00, float 2.000000e+00, float 4.000000e+00 > ; <<4 x float>> [#uses=1]
14 %tmp49 = add <4 x float> %tmp46, < float 0.000000e+00, float 4.000000e+00, float 6.000000e+00, float 1.000000e+00 > ; <<4 x float>> [#uses=1]
15 store <4 x float> %tmp49, <4 x float>* null
16 br i1 false, label %bb7, label %bb56
17
18 bb56: ; preds = %bb7
19 br i1 false, label %bb, label %bb64
20
21 bb64: ; preds = %bb56
22 ret i32 0
23 }
0 ; RUN: llvm-as < %s | opt -loop-rotate -licm -loop-unswitch -disable-output
1 define i32 @main(i32 %argc, i8** %argv) {
2 entry:
3 br label %bb7
4
5 bb7: ; preds = %bb7, %entry
6 %tmp39 = load <4 x float>* null ; <<4 x float>> [#uses=1]
7 %tmp40 = add <4 x float> %tmp39, < float 2.000000e+00, float 3.000000e+00, float 1.000000e+00, float 0.000000e+00 > ; <<4 x float>> [#uses=0]
8 store <4 x float> zeroinitializer, <4 x float>* null
9 br i1 false, label %bb7, label %bb56
10
11 bb56: ; preds = %bb7
12 ret i32 0
13 }
0 ; RUN: llvm-as < %s | opt -licm -loop-unswitch -disable-output
1 %struct.III_scalefac_t = type { [22 x i32], [13 x [3 x i32]] }
2 %struct.gr_info = type { i32, i32, i32, i32, i32, i32, i32, i32, [3 x i32], [3 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32*, [4 x i32] }
3
4 define i32 @scale_bitcount_lsf(%struct.III_scalefac_t* %scalefac, %struct.gr_info* %cod_info) {
5 entry:
6 br i1 false, label %bb28, label %bb133.preheader
7
8 bb133.preheader: ; preds = %entry
9 ret i32 0
10
11 bb28: ; preds = %entry
12 br i1 false, label %bb63.outer, label %bb79
13
14 bb63.outer: ; preds = %bb73, %bb28
15 br i1 false, label %bb35, label %bb73
16
17 bb35: ; preds = %cond_next60, %bb63.outer
18 %window.34 = phi i32 [ %tmp62, %cond_next60 ], [ 0, %bb63.outer ] ; [#uses=1]
19 %tmp44 = getelementptr [4 x i32]* null, i32 0, i32 0 ; [#uses=1]
20 %tmp46 = load i32* %tmp44, align 4 ; [#uses=0]
21 br i1 false, label %cond_true50, label %cond_next60
22
23 cond_true50: ; preds = %bb35
24 %tmp59 = getelementptr [4 x i32]* null, i32 0, i32 0 ; [#uses=1]
25 store i32 0, i32* %tmp59, align 4
26 br label %cond_next60
27
28 cond_next60: ; preds = %cond_true50, %bb35
29 %tmp62 = add i32 %window.34, 1 ; [#uses=1]
30 br i1 false, label %bb35, label %bb73
31
32 bb73: ; preds = %cond_next60, %bb63.outer
33 %tmp76 = icmp slt i32 0, 0 ; [#uses=1]
34 br i1 %tmp76, label %bb63.outer, label %bb79
35
36 bb79: ; preds = %bb73, %bb28
37 ret i32 0
38 }
0 ; RUN: llvm-as < %s | opt -loop-rotate -licm -loop-unswitch -disable-output
1
2 define i32 @stringSearch_Clib(i32 %count) {
3 entry:
4 br i1 false, label %bb36, label %bb44
5
6 bb4: ; preds = %bb36
7 br i1 false, label %cond_next, label %cond_true
8
9 cond_true: ; preds = %bb4
10 ret i32 0
11
12 cond_next: ; preds = %bb4
13 ret i32 0
14
15 bb36: ; preds = %bb41, %entry
16 br i1 false, label %bb4, label %bb41
17
18 bb41: ; preds = %bb36
19 %ttmp2 = icmp slt i32 0, %count ; [#uses=1]
20 br i1 %ttmp2, label %bb36, label %bb44
21
22 bb44: ; preds = %bb41, %entry
23 ret i32 0
24 }
+0
-21
test/Transforms/LoopRotate/LRAnalysis.ll less more
None ; RUN: llvm-as < %s | opt -loop-rotate -loop-unswitch -disable-output
1
2 define i32 @stringSearch_Clib(i32 %count) {
3 entry:
4 br i1 false, label %bb36, label %bb44
5
6 cond_true20: ; preds = %bb36
7 %tmp33 = add i32 0, 0 ; [#uses=1]
8 br label %bb36
9
10 bb36: ; preds = %cond_true20, %entry
11 %c.2 = phi i32 [ %tmp33, %cond_true20 ], [ 0, %entry ] ; [#uses=1]
12 br i1 false, label %cond_true20, label %bb41
13
14 bb41: ; preds = %bb36
15 %c.2.lcssa = phi i32 [ %c.2, %bb36 ] ; [#uses=0]
16 ret i32 0
17
18 bb44: ; preds = %entry
19 ret i32 0
20 }
0 ; RUN: llvm-as < %s | opt -loop-unswitch -instcombine -disable-output
1
2 @str3 = external constant [3 x i8] ; <[3 x i8]*> [#uses=1]
3
4 define i32 @stringSearch_Clib(i32 %count) {
5 entry:
6 %ttmp25 = icmp sgt i32 %count, 0 ; [#uses=1]
7 br i1 %ttmp25, label %bb36.preheader, label %bb44
8
9 bb36.preheader: ; preds = %entry
10 %ttmp33 = icmp slt i32 0, 250 ; [#uses=1]
11 br label %bb36.outer
12
13 bb36.outer: ; preds = %bb41, %bb36.preheader
14 br i1 %ttmp33, label %bb.nph, label %bb41
15
16 bb.nph: ; preds = %bb36.outer
17 %ttmp8 = icmp eq i8* null, null ; [#uses=1]
18 %ttmp6 = icmp eq i8* null, null ; [#uses=1]
19 %tmp31 = call i32 @strcspn( i8* null, i8* getelementptr ([3 x i8]* @str3, i64 0, i64 0) ) ; [#uses=1]
20 br i1 %ttmp8, label %cond_next, label %cond_true
21
22 cond_true: ; preds = %bb.nph
23 ret i32 0
24
25 cond_next: ; preds = %bb.nph
26 br i1 %ttmp6, label %cond_next28, label %cond_true20
27
28 cond_true20: ; preds = %cond_next
29 ret i32 0
30
31 cond_next28: ; preds = %cond_next
32 %tmp33 = add i32 %tmp31, 0 ; [#uses=1]
33 br label %bb41
34
35 bb41: ; preds = %cond_next28, %bb36.outer
36 %c.2.lcssa = phi i32 [ 0, %bb36.outer ], [ %tmp33, %cond_next28 ] ; [#uses=1]
37 br i1 false, label %bb36.outer, label %bb44
38
39 bb44: ; preds = %bb41, %entry
40 %c.01.1 = phi i32 [ 0, %entry ], [ %c.2.lcssa, %bb41 ] ; [#uses=1]
41 ret i32 %c.01.1
42 }
43
44 declare i32 @strcspn(i8*, i8*)
0 ; RUN: llvm-as < %s | opt -loop-unswitch -disable-output
1
2 define i32 @main(i32 %argc, i8** %argv) {
3 entry:
4 %tmp1785365 = icmp ult i32 0, 100 ; [#uses=1]
5 br label %bb
6
7 bb: ; preds = %cond_true, %entry
8 br i1 false, label %cond_true, label %cond_next
9
10 cond_true: ; preds = %bb
11 br i1 %tmp1785365, label %bb, label %bb1788
12
13 cond_next: ; preds = %bb
14 %iftmp.1.0 = select i1 false, i32 0, i32 0 ; [#uses=1]
15 br i1 false, label %cond_true47, label %cond_next74
16
17 cond_true47: ; preds = %cond_next
18 %tmp53 = urem i32 %iftmp.1.0, 0 ; [#uses=0]
19 ret i32 0
20
21 cond_next74: ; preds = %cond_next
22 ret i32 0
23
24 bb1788: ; preds = %cond_true
25 ret i32 0
26 }