summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/CodeGenPrepare.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index 45afaf20c59..aa57748ffa7 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -7221,11 +7221,8 @@ bool CodeGenPrepare::splitBranchCondition(Function &F, bool &ModifiedDT) {
std::swap(TBB, FBB);
// Replace the old BB with the new BB.
- for (PHINode &PN : TBB->phis()) {
- int i;
- while ((i = PN.getBasicBlockIndex(&BB)) >= 0)
- PN.setIncomingBlock(i, TmpBB);
- }
+ for (PHINode &PN : TBB->phis())
+ PN.replaceIncomingBlockWith(&BB, TmpBB);
// Add another incoming edge form the new BB.
for (PHINode &PN : FBB->phis()) {
OpenPOWER on IntegriCloud