summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Transforms/Utils
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
commit183c24c51b9afb3fb3607142a7a1fce88719ec8e (patch)
treeaba2a1eaa63f7ff001ef4418bfe2c5b9c2126aa5 /llvm/unittests/Transforms/Utils
parentbd466d404a4f8390bfcbd1cd7eb04952223d1599 (diff)
downloadbcm5719-llvm-183c24c51b9afb3fb3607142a7a1fce88719ec8e.tar.gz
bcm5719-llvm-183c24c51b9afb3fb3607142a7a1fce88719ec8e.zip
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. llvm-svn: 126088
Diffstat (limited to 'llvm/unittests/Transforms/Utils')
-rw-r--r--llvm/unittests/Transforms/Utils/Local.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/unittests/Transforms/Utils/Local.cpp b/llvm/unittests/Transforms/Utils/Local.cpp
index e969e958a74..2de09ada27a 100644
--- a/llvm/unittests/Transforms/Utils/Local.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud