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 | 4e744af80c583ee92f0bcff3fdb082bcd8e7386b (patch) | |
tree | be4cc1269a54e1f1878414acea4cdb1dac6e2e83 /llvm/lib | |
parent | e3abb14503d2ea1375002adafc75e615d691384d (diff) | |
download | llvm-4e744af80c583ee92f0bcff3fdb082bcd8e7386b.zip llvm-4e744af80c583ee92f0bcff3fdb082bcd8e7386b.tar.gz llvm-4e744af80c583ee92f0bcff3fdb082bcd8e7386b.tar.bz2 |
When asked not to delete useless PHIs, really don't delete them, no matter how
redundant they are.
llvm-svn: 28777
Diffstat (limited to 'llvm/lib')
-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(); } |