add a simple case where instcombine can detect and remove a dead alloca
authorChris Lattner <sabre@nondot.org>
Mon, 15 Jan 2007 06:51:25 +0000 (06:51 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 15 Jan 2007 06:51:25 +0000 (06:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33230 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/alloca.ll

index c5d7818229799370bb2c9ed99c7e9187722d3fef..8ce7b65b0c07fa3115a13e27bf14efc0f53e58c1 100644 (file)
@@ -12,3 +12,16 @@ void %test() {
        call void(...)* %use({}* %Z)
        ret void
 }
+
+void %test2() {
+       %A = alloca int    ;; dead.
+       store int 123, int* %A
+       ret void
+}
+
+void %test3() {
+       %A = alloca {int}    ;; dead.
+       %B = getelementptr {int}* %A, int 0, uint 0
+       store int 123, int* %B
+       ret void
+}