aboutsummaryrefslogtreecommitdiff
path: root/unittests/Transforms
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-02-20 18:05:56 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-02-20 18:05:56 +0000
commiteff5e69c82096812acec0c5c6f135c755a1632d2 (patch)
treead9208ed21083a5f3b7987a2982a1771322da387 /unittests/Transforms
parentcd6c93ec48937ab4f76dfd3bf5dc7e68ed781508 (diff)
Make RecursivelyDeleteDeadPHINode delete a phi node that has no users and add a
test for that. With this change, test/CodeGen/X86/codegen-dce.ll no longer finds any instructions to DCE, so delete the test. Also renamed J and JP to I and IP in RecursivelyDeleteDeadPHINode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126088 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Transforms')
-rw-r--r--unittests/Transforms/Utils/Local.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/unittests/Transforms/Utils/Local.cpp b/unittests/Transforms/Utils/Local.cpp
index e969e958a7..2de09ada27 100644
--- a/unittests/Transforms/Utils/Local.cpp
+++ b/unittests/Transforms/Utils/Local.cpp
@@ -42,6 +42,11 @@ TEST(Local, RecursivelyDeleteDeadPHINodes) {
EXPECT_EQ(&bb0->front(), br0);
EXPECT_EQ(&bb1->front(), br1);
+ builder.SetInsertPoint(bb0);
+ phi = builder.CreatePHI(Type::getInt32Ty(C));
+
+ EXPECT_TRUE(RecursivelyDeleteDeadPHINode(phi));
+
bb0->dropAllReferences();
bb1->dropAllReferences();
delete bb0;