diff options
author | Craig Topper <craig.topper@gmail.com> | 2012-08-14 07:32:05 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2012-08-14 07:32:05 +0000 |
commit | 750d7616c6d9ed5a40de1ac8f74fb40afd82ebc6 (patch) | |
tree | 2854a51748462571c5128d2872c0a77071ebf284 /test | |
parent | bb57febe3cbc2e968abee728b615918fc734ff7a (diff) | |
download | external_llvm-750d7616c6d9ed5a40de1ac8f74fb40afd82ebc6.zip external_llvm-750d7616c6d9ed5a40de1ac8f74fb40afd82ebc6.tar.gz external_llvm-750d7616c6d9ed5a40de1ac8f74fb40afd82ebc6.tar.bz2 |
Change greater than to greater than or equal so that an identical sized store to the same offset is treated as completing overwriting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161857 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/DeadStoreElimination/simple.ll | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Transforms/DeadStoreElimination/simple.ll b/test/Transforms/DeadStoreElimination/simple.ll index ed53ab7..7a8cdd5 100644 --- a/test/Transforms/DeadStoreElimination/simple.ll +++ b/test/Transforms/DeadStoreElimination/simple.ll @@ -291,3 +291,22 @@ define noalias i8* @test23() nounwind uwtable ssp { %call = call i8* @strdup(i8* %arrayidx) nounwind ret i8* %call } + +; Make sure same sized store to later element is deleted +; CHECK: @test24 +; CHECK-NOT: store i32 0 +; CHECK-NOT: store i32 0 +; CHECK: store i32 %b +; CHECK: store i32 %c +; CHECK: ret void +define void @test24([2 x i32]* %a, i32 %b, i32 %c) nounwind { + %1 = getelementptr inbounds [2 x i32]* %a, i64 0, i64 0 + store i32 0, i32* %1, align 4 + %2 = getelementptr inbounds [2 x i32]* %a, i64 0, i64 1 + store i32 0, i32* %2, align 4 + %3 = getelementptr inbounds [2 x i32]* %a, i64 0, i64 0 + store i32 %b, i32* %3, align 4 + %4 = getelementptr inbounds [2 x i32]* %a, i64 0, i64 1 + store i32 %c, i32* %4, align 4 + ret void +} |