aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/DeadStoreElimination
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-11-30 23:05:20 +0000
committerChris Lattner <sabre@nondot.org>2010-11-30 23:05:20 +0000
commita04096580a65b6cfbe12dabf6d695f7303750c0d (patch)
tree0dd3f641c599ed0675c9579f72c70fa4c010f872 /test/Transforms/DeadStoreElimination
parent1fd374e9c1c074c1681336bef31e65f0170b0f7e (diff)
downloadexternal_llvm-a04096580a65b6cfbe12dabf6d695f7303750c0d.zip
external_llvm-a04096580a65b6cfbe12dabf6d695f7303750c0d.tar.gz
external_llvm-a04096580a65b6cfbe12dabf6d695f7303750c0d.tar.bz2
teach DSE to use GetPointerBaseWithConstantOffset to analyze
may-aliasing stores that partially overlap with different base pointers. This implements PR6043 and the non-variable part of PR8657 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120485 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/DeadStoreElimination')
-rw-r--r--test/Transforms/DeadStoreElimination/PartialStore.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Transforms/DeadStoreElimination/PartialStore.ll b/test/Transforms/DeadStoreElimination/PartialStore.ll
index a563d8f..9992298 100644
--- a/test/Transforms/DeadStoreElimination/PartialStore.ll
+++ b/test/Transforms/DeadStoreElimination/PartialStore.ll
@@ -36,3 +36,19 @@ define i32 @test3(double %__x) {
%tmp.7 = zext i1 %tmp.6 to i32
ret i32 %tmp.7
}
+
+; PR6043
+define void @test4(i8* %P) {
+; CHECK: @test4
+; CHECK-NEXT: bitcast
+; CHECK-NEXT: store double
+
+ store i8 19, i8* %P ;; dead
+ %A = getelementptr i8* %P, i32 3
+
+ store i8 42, i8* %A ;; dead
+
+ %Q = bitcast i8* %P to double*
+ store double 0.0, double* %Q
+ ret void
+}