Due to a bug in BasicAA, DSE is incorrectly deleting the first store in
authorChris Lattner <sabre@nondot.org>
Thu, 29 Jul 2004 01:33:05 +0000 (01:33 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 29 Jul 2004 01:33:05 +0000 (01:33 +0000)
this testcase, causing the miscompilation of MallocBench/gs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15315 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/BasicAA/2004-07-28-MustAliasbug.llx [new file with mode: 0644]
test/Transforms/BasicAA/2004-07-28-MustAliasbug.llx [new file with mode: 0644]

diff --git a/test/Analysis/BasicAA/2004-07-28-MustAliasbug.llx b/test/Analysis/BasicAA/2004-07-28-MustAliasbug.llx
new file mode 100644 (file)
index 0000000..d1cf73b
--- /dev/null
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | opt -dse | llvm-dis | grep 'store int 0'
+
+void %test({int,int }* %P) {
+       %Q = getelementptr {int,int}* %P, int 1
+       %X = getelementptr {int,int}* %Q, int 0, uint 1
+       %Y = getelementptr {int,int}* %Q, int 1, uint 1
+       store int 0, int* %X
+       store int 1, int* %Y
+       ret void
+}
diff --git a/test/Transforms/BasicAA/2004-07-28-MustAliasbug.llx b/test/Transforms/BasicAA/2004-07-28-MustAliasbug.llx
new file mode 100644 (file)
index 0000000..d1cf73b
--- /dev/null
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | opt -dse | llvm-dis | grep 'store int 0'
+
+void %test({int,int }* %P) {
+       %Q = getelementptr {int,int}* %P, int 1
+       %X = getelementptr {int,int}* %Q, int 0, uint 1
+       %Y = getelementptr {int,int}* %Q, int 1, uint 1
+       store int 0, int* %X
+       store int 1, int* %Y
+       ret void
+}