summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-12 21:58:07 +0000
committerChris Lattner <sabre@nondot.org>2005-08-12 21:58:07 +0000
commitb7ebe65c561630310d580d1df7692fddff10b9c8 (patch)
tree236e1a4166fd7517fd0e7c6365d30e15e0b791fb /llvm/lib/Transforms/Utils
parent8c6701be6eb078626ad802aae299dcfe2cc60efe (diff)
downloadbcm5719-llvm-b7ebe65c561630310d580d1df7692fddff10b9c8.tar.gz
bcm5719-llvm-b7ebe65c561630310d580d1df7692fddff10b9c8.zip
Change break critical edges to not remove, then insert, PHI node entries.
Instead, just update the BB in-place. This is both faster, and it prevents split-critical-edges from shuffling the PHI argument list unneccesarily. llvm-svn: 22765
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r--llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp b/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp
index acc1e2cd3f7..59ec01c7d58 100644
--- a/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp
+++ b/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp
@@ -124,8 +124,8 @@ bool llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P) {
// 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...
OpenPOWER on IntegriCloud