Instead, just update the BB in-place. This is both faster, and it prevents
split-critical-edges from shuffling the PHI argument list unneccesarily.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22765
91177308-0d34-0410-b5e6-
96231b3b80d8
// We no longer enter through TIBB, now we come in through NewBB. Revector
// exactly one entry in the PHI node that used to come from TIBB to come
// from NewBB.
- Value *InVal = PN->removeIncomingValue(TIBB, false);
- PN->addIncoming(InVal, NewBB);
+ int BBIdx = PN->getBasicBlockIndex(TIBB);
+ PN->setIncomingBlock(BBIdx, NewBB);
}
// If we don't have a pass object, we can't update anything...