summaryrefslogtreecommitdiffstats
path: root/test/Transforms/ADCE/2002-05-23-ZeroArgPHITest.ll
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-05-23 16:51:25 +0000
committerChris Lattner <sabre@nondot.org>2002-05-23 16:51:25 +0000
commit37dc78d0d3bcbcef070d0f6c445fa249e95bd89a (patch)
tree72e51b979857089e80548e51ebef3da59105a407 /test/Transforms/ADCE/2002-05-23-ZeroArgPHITest.ll
parent85c5465e072b3bbebb1f5e112fb2db46f7fba148 (diff)
downloadexternal_llvm-37dc78d0d3bcbcef070d0f6c445fa249e95bd89a.zip
external_llvm-37dc78d0d3bcbcef070d0f6c445fa249e95bd89a.tar.gz
external_llvm-37dc78d0d3bcbcef070d0f6c445fa249e95bd89a.tar.bz2
New testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2732 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/ADCE/2002-05-23-ZeroArgPHITest.ll')
-rw-r--r--test/Transforms/ADCE/2002-05-23-ZeroArgPHITest.ll33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/Transforms/ADCE/2002-05-23-ZeroArgPHITest.ll b/test/Transforms/ADCE/2002-05-23-ZeroArgPHITest.ll
new file mode 100644
index 0000000..4ddb3f1
--- /dev/null
+++ b/test/Transforms/ADCE/2002-05-23-ZeroArgPHITest.ll
@@ -0,0 +1,33 @@
+; This testcase contains a entire loop that should be removed. The only thing
+; left is the store instruction in BB0. The problem this testcase was running
+; into was that when the reg109 PHI was getting zero predecessors, it was
+; removed even though there were uses still around. Now the uses are filled
+; in with a dummy value before the PHI is deleted.
+;
+; RUN: as < %s | opt -adce
+
+%node_t = type { double*, %node_t*, %node_t**, double**, double*, int, int }
+
+implementation ; Functions:
+
+void %localize_local(%node_t* %nodelist) {
+bb0: ;[#uses=0]
+ %nodelist = alloca %node_t* ; <%node_t**> [#uses=2]
+ store %node_t* %nodelist, %node_t** %nodelist
+ br label %bb1
+
+bb1: ;[#uses=2]
+ %reg107 = load %node_t** %nodelist, uint 0 ; <%node_t*> [#uses=2]
+ %cond211 = seteq %node_t* %reg107, null ; <bool> [#uses=1]
+ br bool %cond211, label %bb3, label %bb2
+
+bb2: ;[#uses=3]
+ %reg109 = phi %node_t* [ %reg110, %bb2 ], [ %reg107, %bb1 ] ; <%node_t*> [#uses=1]
+ %reg212 = getelementptr %node_t* %reg109, uint 0, ubyte 1 ; <%node_t**> [#uses=1]
+ %reg110 = load %node_t** %reg212 ; <%node_t*> [#uses=2]
+ %cond213 = setne %node_t* %reg110, null ; <bool> [#uses=1]
+ br bool %cond213, label %bb2, label %bb3
+
+bb3: ;[#uses=2]
+ ret void
+}