diff options
author | Chris Lattner <sabre@nondot.org> | 2005-08-12 21:58:07 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-08-12 21:58:07 +0000 |
commit | b01bfd49c3353085e9ebb01d7b257f70583ee8c8 (patch) | |
tree | ed897a5850bea9c3cf347986a301ca3e28bfc4de /lib/Transforms/Utils/BreakCriticalEdges.cpp | |
parent | 1f3e808ebf1388c2c5016b9896fd6fbbb03e5666 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22765 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/BreakCriticalEdges.cpp')
-rw-r--r-- | lib/Transforms/Utils/BreakCriticalEdges.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Utils/BreakCriticalEdges.cpp b/lib/Transforms/Utils/BreakCriticalEdges.cpp index acc1e2cd3f..59ec01c7d5 100644 --- a/lib/Transforms/Utils/BreakCriticalEdges.cpp +++ b/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... |