merge a test into store.ll
authorChris Lattner <sabre@nondot.org>
Mon, 2 Nov 2009 02:00:18 +0000 (02:00 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 2 Nov 2009 02:00:18 +0000 (02:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85771 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/store-merge.ll [deleted file]
test/Transforms/InstCombine/store.ll

diff --git a/test/Transforms/InstCombine/store-merge.ll b/test/Transforms/InstCombine/store-merge.ll
deleted file mode 100644 (file)
index 06d497d..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-; RUN: opt < %s -instcombine -S | \
-; RUN:    grep {ret i32 %.toremerge} | count 2
-;; Simple sinking tests
-
-; "if then else"
-define i32 @test1(i1 %C) {
-       %A = alloca i32
-        br i1 %C, label %Cond, label %Cond2
-
-Cond:
-        store i32 -987654321, i32* %A
-        br label %Cont
-
-Cond2:
-       store i32 47, i32* %A
-       br label %Cont
-
-Cont:
-       %V = load i32* %A
-       ret i32 %V
-}
-
-; "if then"
-define i32 @test2(i1 %C) {
-       %A = alloca i32
-       store i32 47, i32* %A
-        br i1 %C, label %Cond, label %Cont
-
-Cond:
-        store i32 -987654321, i32* %A
-        br label %Cont
-
-Cont:
-       %V = load i32* %A
-       ret i32 %V
-}
-
index 3b8c0ab3030db268614e91aafd2c09ced5ff104b..54f16213178458043af166c894e87fb0c3c73cc7 100644 (file)
@@ -19,3 +19,48 @@ define void @test2(i32* %P) {
 ; CHECK-NEXT: ret void
 }
 
+;; Simple sinking tests
+
+; "if then else"
+define i32 @test3(i1 %C) {
+       %A = alloca i32
+        br i1 %C, label %Cond, label %Cond2
+
+Cond:
+        store i32 -987654321, i32* %A
+        br label %Cont
+
+Cond2:
+       store i32 47, i32* %A
+       br label %Cont
+
+Cont:
+       %V = load i32* %A
+       ret i32 %V
+; CHECK: @test3
+; CHECK-NOT: alloca
+; CHECK: Cont:
+; CHECK-NEXT:  %storemerge = phi i32 [ 47, %Cond2 ], [ -987654321, %Cond ]
+; CHECK-NEXT:  ret i32 %storemerge
+}
+
+; "if then"
+define i32 @test4(i1 %C) {
+       %A = alloca i32
+       store i32 47, i32* %A
+        br i1 %C, label %Cond, label %Cont
+
+Cond:
+        store i32 -987654321, i32* %A
+        br label %Cont
+
+Cont:
+       %V = load i32* %A
+       ret i32 %V
+; CHECK: @test4
+; CHECK-NOT: alloca
+; CHECK: Cont:
+; CHECK-NEXT:  %storemerge = phi i32 [ -987654321, %Cond ], [ 47, %0 ]
+; CHECK-NEXT:  ret i32 %storemerge
+}
+