diff options
-rw-r--r-- | llvm/lib/VMCore/BasicBlock.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/BasicBlock.cpp b/llvm/lib/VMCore/BasicBlock.cpp index 18a90d6..1b7100c6 100644 --- a/llvm/lib/VMCore/BasicBlock.cpp +++ b/llvm/lib/VMCore/BasicBlock.cpp @@ -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(); } |