don't invalidate PN, rewrite of this code is in progress anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86639 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2009-11-10 01:19:06 +00:00
parent e34537856a
commit e7c90967b1

View File

@@ -223,10 +223,11 @@ static void RemovePredecessorAndSimplify(BasicBlock *BB, BasicBlock *Pred,
U = PNV; U = PNV;
// See if we can simplify it. // See if we can simplify it.
if (Value *V = SimplifyInstruction(User, TD)) { if (User != PN)
User->replaceAllUsesWith(V); if (Value *V = SimplifyInstruction(User, TD)) {
User->eraseFromParent(); User->replaceAllUsesWith(V);
} User->eraseFromParent();
}
} }
PN->replaceAllUsesWith(PNV); PN->replaceAllUsesWith(PNV);