[llvm-commits] CVS: llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Aug 12 14:58:23 PDT 2005



Changes in directory llvm/lib/Transforms/Utils:

BreakCriticalEdges.cpp updated: 1.26 -> 1.27
---
Log message:

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.


---
Diffs of the changes:  (+2 -2)

 BreakCriticalEdges.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp
diff -u llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.26 llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.27
--- llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.26	Thu Apr 21 18:45:33 2005
+++ llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp	Fri Aug 12 16:58:07 2005
@@ -124,8 +124,8 @@
     // 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...






More information about the llvm-commits mailing list