summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-11-02 02:06:37 +0000
committerChris Lattner <sabre@nondot.org>2009-11-02 02:06:37 +0000
commit3cd6a61b275f49df4f2aaa273efbf4cf8e0a6511 (patch)
treea6bff97c438ca9104eda68fc619c77a138e0ecc4 /llvm/test/Transforms/InstCombine
parentdb3311edc7ed4e6171f268a1f1967f0f65aac457 (diff)
downloadbcm5719-llvm-3cd6a61b275f49df4f2aaa273efbf4cf8e0a6511.tar.gz
bcm5719-llvm-3cd6a61b275f49df4f2aaa273efbf4cf8e0a6511.zip
fix instcombine to only do store sinking when the alignments
of the two loads agree. Propagate that onto the new store. llvm-svn: 85772
Diffstat (limited to 'llvm/test/Transforms/InstCombine')
-rw-r--r--llvm/test/Transforms/InstCombine/store.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/store.ll b/llvm/test/Transforms/InstCombine/store.ll
index 54f16213178..314441eb865 100644
--- a/llvm/test/Transforms/InstCombine/store.ll
+++ b/llvm/test/Transforms/InstCombine/store.ll
@@ -64,3 +64,21 @@ Cont:
; CHECK-NEXT: ret i32 %storemerge
}
+; "if then"
+define void @test5(i1 %C, i32* %P) {
+ store i32 47, i32* %P, align 1
+ br i1 %C, label %Cond, label %Cont
+
+Cond:
+ store i32 -987654321, i32* %P, align 1
+ br label %Cont
+
+Cont:
+ ret void
+; CHECK: @test5
+; CHECK: Cont:
+; CHECK-NEXT: %storemerge = phi i32
+; CHECK-NEXT: store i32 %storemerge, i32* %P, align 1
+; CHECK-NEXT: ret void
+}
+
OpenPOWER on IntegriCloud