llvm.org GIT mirror llvm / fc24a72
Add two test cases to cover apintification change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36476 91177308-0d34-0410-b5e6-96231b3b80d8 Zhou Sheng 13 years ago
2 changed file(s) with 67 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: llvm-as < %s | opt -analyze -scalar-evolution |& \
1 ; RUN: grep {100 iterations}
2 ; PR1101
3
4 @A = weak global [1000 x i32] zeroinitializer, align 32
5
6
7 define void @test(i32 %N) {
8 entry:
9 "alloca point" = bitcast i32 0 to i32 ; [#uses=0]
10 br label %bb3
11
12 bb: ; preds = %bb3
13 %tmp = getelementptr [1000 x i32]* @A, i32 0, i32 %i.0 ; [#uses=1]
14 store i32 123, i32* %tmp
15 %tmp2 = add i32 %i.0, 1 ; [#uses=1]
16 br label %bb3
17
18 bb3: ; preds = %bb, %entry
19 %i.0 = phi i32 [ 2, %entry ], [ %tmp2, %bb ] ; [#uses=3]
20 %SQ = mul i32 %i.0, %i.0
21 %tmp4 = mul i32 %i.0, 2
22 %tmp5 = sub i32 %SQ, %tmp4
23 %tmp3 = icmp sle i32 %tmp5, 9999 ; [#uses=1]
24 br i1 %tmp3, label %bb, label %bb5
25
26 bb5: ; preds = %bb3
27 br label %return
28
29 return: ; preds = %bb5
30 ret void
31 }
0 ; RUN: llvm-as < %s | opt -analyze -scalar-evolution |& \
1 ; RUN: grep {4 iterations}
2 ; PR1101
3
4 @A = weak global [1000 x i32] zeroinitializer, align 32
5
6
7 define void @test(i32 %N) {
8 entry:
9 "alloca point" = bitcast i32 0 to i32 ; [#uses=0]
10 br label %bb3
11
12 bb: ; preds = %bb3
13 %tmp = getelementptr [1000 x i32]* @A, i32 0, i32 %i.0 ; [#uses=1]
14 store i32 123, i32* %tmp
15 %tmp4 = mul i32 %i.0, 4 ; [#uses=1]
16 %tmp5 = or i32 %tmp4, 1
17 %tmp61 = xor i32 %tmp5, -2147483648
18 %tmp6 = trunc i32 %tmp61 to i16
19 %tmp71 = shl i16 %tmp6, 2
20 %tmp7 = zext i16 %tmp71 to i32
21 %tmp2 = add i32 %tmp7, %i.0
22 br label %bb3
23
24 bb3: ; preds = %bb, %entry
25 %i.0 = phi i32 [ 0, %entry ], [ %tmp2, %bb ] ; [#uses=3]
26 %tmp3 = icmp sle i32 %i.0, 9999 ; [#uses=1]
27 br i1 %tmp3, label %bb, label %bb5
28
29 bb5: ; preds = %bb3
30 br label %return
31
32 return: ; preds = %bb5
33 ret void
34 }