mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
Simplify RecursivelyDeleteDeadPHINode. The only functionality change
should be that if the phi is used by a side-effect free instruction with no uses then the phi and the instruction now get zapped (checked by the unittest). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126124 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -47,6 +47,12 @@ TEST(Local, RecursivelyDeleteDeadPHINodes) {
|
||||
|
||||
EXPECT_TRUE(RecursivelyDeleteDeadPHINode(phi));
|
||||
|
||||
builder.SetInsertPoint(bb0);
|
||||
phi = builder.CreatePHI(Type::getInt32Ty(C));
|
||||
builder.CreateAdd(phi, phi);
|
||||
|
||||
EXPECT_TRUE(RecursivelyDeleteDeadPHINode(phi));
|
||||
|
||||
bb0->dropAllReferences();
|
||||
bb1->dropAllReferences();
|
||||
delete bb0;
|
||||
|
Reference in New Issue
Block a user