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
This commit is contained in:
Nick Lewycky
2011-02-20 18:05:56 +00:00
parent cd6c93ec48
commit eff5e69c82
3 changed files with 17 additions and 50 deletions

View File

@@ -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;