diff options
Diffstat (limited to 'llvm/lib/IR/BasicBlock.cpp')
-rw-r--r-- | llvm/lib/IR/BasicBlock.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/IR/BasicBlock.cpp b/llvm/lib/IR/BasicBlock.cpp index 4baf368..a9fa7cae 100644 --- a/llvm/lib/IR/BasicBlock.cpp +++ b/llvm/lib/IR/BasicBlock.cpp @@ -368,11 +368,10 @@ void BasicBlock::removePredecessor(BasicBlock *Pred, // If all incoming values to the Phi are the same, we can replace the Phi // with that value. Value* PNV = nullptr; - if (!KeepOneInputPHIs && (PNV = PN->hasConstantValue())) - if (PNV != PN) { - PN->replaceAllUsesWith(PNV); - PN->eraseFromParent(); - } + if (!KeepOneInputPHIs && (PNV = PN->hasConstantValue())) { + PN->replaceAllUsesWith(PNV); + PN->eraseFromParent(); + } } } } |