From 183c24c51b9afb3fb3607142a7a1fce88719ec8e Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Sun, 20 Feb 2011 18:05:56 +0000 Subject: 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 --- llvm/unittests/Transforms/Utils/Local.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'llvm/unittests/Transforms/Utils/Local.cpp') 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; -- cgit v1.2.3