When asked not to delete useless PHIs, really don't delete them, no matter how

redundant they are.

llvm-svn: 28777
This commit is contained in:
Owen Anderson 2006-06-14 04:43:14 +00:00
parent 1b42069db1
commit 8a0a40c7ac

View File

@ -213,7 +213,8 @@ void BasicBlock::removePredecessor(BasicBlock *Pred,
PN->removeIncomingValue(Pred, false);
// If all incoming values to the Phi are the same, we can replace the Phi
// with that value.
if (Value *PNV = PN->hasConstantValue()) {
Value* PNV = 0;
if (!DontDeleteUselessPHIs && (PNV = PN->hasConstantValue())) {
PN->replaceAllUsesWith(PNV);
PN->eraseFromParent();
}