aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/DeadStoreElimination
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-28 22:51:08 +0000
committerChris Lattner <sabre@nondot.org>2008-11-28 22:51:08 +0000
commitd3d12ecadd1eb859c4b30b6582e31901a45d6626 (patch)
tree7cb165beafc0381624551d998b2fee25b6c25c09 /test/Transforms/DeadStoreElimination
parent5425f22fa3f8cbbcbc1a76fc7df2fa251cdc132d (diff)
downloadexternal_llvm-d3d12ecadd1eb859c4b30b6582e31901a45d6626.zip
external_llvm-d3d12ecadd1eb859c4b30b6582e31901a45d6626.tar.gz
external_llvm-d3d12ecadd1eb859c4b30b6582e31901a45d6626.tar.bz2
Fix PR3141 by ensuring that MemoryDependenceAnalysis::removeInstruction
properly updates the reverse dependency map when it installs updated dependencies for instructions that depend on the removed instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60222 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/DeadStoreElimination')
-rw-r--r--test/Transforms/DeadStoreElimination/2008-11-28-MemDepUpdate.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Transforms/DeadStoreElimination/2008-11-28-MemDepUpdate.ll b/test/Transforms/DeadStoreElimination/2008-11-28-MemDepUpdate.ll
new file mode 100644
index 0000000..0f3350d
--- /dev/null
+++ b/test/Transforms/DeadStoreElimination/2008-11-28-MemDepUpdate.ll
@@ -0,0 +1,16 @@
+; RUN: llvm-as < %s | opt -dse | llvm-dis
+; PR3141
+ %struct.ada__tags__dispatch_table = type { [1 x i32] }
+ %struct.f393a00_1__object = type { %struct.ada__tags__dispatch_table*, i8 }
+ %struct.f393a00_2__windmill = type { %struct.f393a00_1__object, i16 }
+
+define void @f393a00_2__swap(%struct.f393a00_2__windmill* %a, %struct.f393a00_2__windmill* %b) {
+entry:
+ %t = alloca %struct.f393a00_2__windmill ; <%struct.f393a00_2__windmill*> [#uses=1]
+ %0 = getelementptr %struct.f393a00_2__windmill* %t, i32 0, i32 0, i32 0 ; <%struct.ada__tags__dispatch_table**> [#uses=1]
+ %1 = load %struct.ada__tags__dispatch_table** null, align 4 ; <%struct.ada__tags__dispatch_table*> [#uses=1]
+ %2 = load %struct.ada__tags__dispatch_table** %0, align 8 ; <%struct.ada__tags__dispatch_table*> [#uses=1]
+ store %struct.ada__tags__dispatch_table* %2, %struct.ada__tags__dispatch_table** null, align 4
+ store %struct.ada__tags__dispatch_table* %1, %struct.ada__tags__dispatch_table** null, align 4
+ ret void
+}