diff options
author | Owen Anderson <resistor@mac.com> | 2006-06-14 04:43:14 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2006-06-14 04:43:14 +0000 |
commit | 90245d4cbb7816ef21f038ec5ef7e01971283436 (patch) | |
tree | 7a1b924e80d19ae8b3759a3b68e08ed0af89df0b /lib/VMCore/BasicBlock.cpp | |
parent | 13a68e425767b164802e62269633ae71f60692d2 (diff) |
When asked not to delete useless PHIs, really don't delete them, no matter how
redundant they are.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28777 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/BasicBlock.cpp')
-rw-r--r-- | lib/VMCore/BasicBlock.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/VMCore/BasicBlock.cpp b/lib/VMCore/BasicBlock.cpp index 18a90d6b44..1b7100c68b 100644 --- a/lib/VMCore/BasicBlock.cpp +++ b/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(); } |