aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms/DeadStoreElimination
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-11-30 23:43:23 +0000
committerChris Lattner <sabre@nondot.org>2010-11-30 23:43:23 +0000
commit3161ae18670e2b66aa4a7bf4805b32ca6aff1757 (patch)
treecd161ed9059f4da60edc63a0f6f682a33eec8f10 /test/Transforms/DeadStoreElimination
parentd309b413a5a246e006a63f61aa9052effd8b4c7e (diff)
Enhance DSE to handle the variable index case in PR8657.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120498 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/DeadStoreElimination')
-rw-r--r--test/Transforms/DeadStoreElimination/PartialStore.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Transforms/DeadStoreElimination/PartialStore.ll b/test/Transforms/DeadStoreElimination/PartialStore.ll
index 999229885d..7ac1e0844e 100644
--- a/test/Transforms/DeadStoreElimination/PartialStore.ll
+++ b/test/Transforms/DeadStoreElimination/PartialStore.ll
@@ -52,3 +52,20 @@ define void @test4(i8* %P) {
store double 0.0, double* %Q
ret void
}
+
+; PR8657
+declare void @test5a(i32*)
+define void @test5(i32 %i) nounwind ssp {
+ %A = alloca i32
+ %B = bitcast i32* %A to i8*
+ %C = getelementptr i8* %B, i32 %i
+ store i8 10, i8* %C ;; Dead store to variable index.
+ store i32 20, i32* %A
+
+ call void @test5a(i32* %A)
+ ret void
+; CHECK: @test5(
+; CHECK-NEXT: alloca
+; CHECK-NEXT: store i32 20
+; CHECK-NEXT: call void @test5a
+}