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

llvm-svn: 86639
This commit is contained in:
Chris Lattner 2009-11-10 01:19:06 +00:00
parent 612e38026a
commit be11db6894
1 changed files with 5 additions and 4 deletions

View File

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