summaryrefslogtreecommitdiff
path: root/test/Analysis
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-01-23 20:06:05 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-01-23 20:06:05 +0000
commit76167af9b1968b2824fcb76db0bc571f422035b4 (patch)
treeb69ffb3b11535d0aeae64c1c52ff5313ff2cb8ea /test/Analysis
parentdd0dfdf8beea667769fe00cd5a7126404922dbab (diff)
downloadllvm-76167af9b1968b2824fcb76db0bc571f422035b4.tar.gz
llvm-76167af9b1968b2824fcb76db0bc571f422035b4.tar.bz2
llvm-76167af9b1968b2824fcb76db0bc571f422035b4.tar.xz
Simplify some code with no functionality change. Make the test a lot more
robust against smarter optimizations, using the power of FileCheck. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124081 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis')
-rw-r--r--test/Analysis/ScalarEvolution/fold.ll34
1 files changed, 19 insertions, 15 deletions
diff --git a/test/Analysis/ScalarEvolution/fold.ll b/test/Analysis/ScalarEvolution/fold.ll
index 90012a38ac..4e2adf187e 100644
--- a/test/Analysis/ScalarEvolution/fold.ll
+++ b/test/Analysis/ScalarEvolution/fold.ll
@@ -23,36 +23,40 @@ define i8 @test3(i8 %x) {
ret i8 %C
}
-define void @test4(i32 %x) {
+define void @test4(i32 %x, i32 %y) {
entry:
- %0 = icmp sge i32 %x, 0
- br i1 %0, label %loop, label %exit
+ %Y = and i32 %y, 3
+ br label %loop
loop:
%A = phi i32 [0, %entry], [%I, %loop]
- %rand = icmp sgt i32 %A, 10
- %Z = select i1 %rand, i32 %A, i32 10
- %B = trunc i32 %Z to i16
+ %rand1 = icmp sgt i32 %A, %Y
+ %Z1 = select i1 %rand1, i32 %A, i32 %Y
+ %rand2 = icmp ugt i32 %A, %Z1
+ %Z2 = select i1 %rand2, i32 %A, i32 %Z1
+; CHECK: %Z2 =
+; CHECK-NEXT: --> ([[EXPR:.*]]){{ +}}Exits: 20
+ %B = trunc i32 %Z2 to i16
%C = sext i16 %B to i30
; CHECK: %C =
-; CHECK-NEXT: (trunc i32 (10 smax {0,+,1}<%loop>) to i30)
+; CHECK-NEXT: (trunc i32 ([[EXPR]]) to i30)
%D = sext i16 %B to i32
; CHECK: %D =
-; CHECK-NEXT: (10 smax {0,+,1}<%loop>)
+; CHECK-NEXT: ([[EXPR]])
%E = sext i16 %B to i34
; CHECK: %E =
-; CHECK-NEXT: (zext i32 (10 smax {0,+,1}<%loop>) to i34)
+; CHECK-NEXT: (zext i32 ([[EXPR]]) to i34)
%F = zext i16 %B to i30
; CHECK: %F =
-; CHECK-NEXT: (trunc i32 (10 smax {0,+,1}<%loop>) to i30
+; CHECK-NEXT: (trunc i32 ([[EXPR]]) to i30
%G = zext i16 %B to i32
; CHECK: %G =
-; CHECK-NEXT: (10 smax {0,+,1}<%loop>)
+; CHECK-NEXT: ([[EXPR]])
%H = zext i16 %B to i34
; CHECK: %H =
-; CHECK-NEXT: (zext i32 (10 smax {0,+,1}<%loop>) to i34)
+; CHECK-NEXT: (zext i32 ([[EXPR]]) to i34)
%I = add i32 %A, 1
- %1 = icmp ne i32 %A, 20
- br i1 %1, label %loop, label %exit
+ %0 = icmp ne i32 %A, 20
+ br i1 %0, label %loop, label %exit
exit:
ret void
-} \ No newline at end of file
+}