[llvm-commits] CVS: llvm/lib/CodeGen/LiveInterval.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Jul 23 20:42:00 PDT 2004



Changes in directory llvm/lib/CodeGen:

LiveInterval.cpp updated: 1.5 -> 1.6

---
Log message:

In the joiner, merge the small interval into the large interval.  This restores
us back to taking about 10.5s on gcc, instead of taking 15.6s!  The net result
is that my big patches have hand no significant effect on compile time or code
quality.  heh.



---
Diffs of the changes:  (+9 -0)

Index: llvm/lib/CodeGen/LiveInterval.cpp
diff -u llvm/lib/CodeGen/LiveInterval.cpp:1.5 llvm/lib/CodeGen/LiveInterval.cpp:1.6
--- llvm/lib/CodeGen/LiveInterval.cpp:1.5	Fri Jul 23 21:52:23 2004
+++ llvm/lib/CodeGen/LiveInterval.cpp	Fri Jul 23 22:41:50 2004
@@ -260,6 +260,15 @@
   unsigned MergedSrcValIdx = SourceLR->ValId;
   unsigned MergedDstValIdx = DestLR->ValId;
 
+  // Try to do the least amount of work possible.  In particular, if there are
+  // more liverange chunks in the other set than there are in the 'this' set,
+  // swap sets to merge the fewest chunks in possible.
+  if (Other.ranges.size() > ranges.size()) {
+    std::swap(MergedSrcValIdx, MergedDstValIdx);
+    std::swap(ranges, Other.ranges);
+    std::swap(NumValues, Other.NumValues);
+  }
+
   // Join the ranges of other into the ranges of this interval.
   Ranges::iterator InsertPos = ranges.begin();
   std::map<unsigned, unsigned> Dst2SrcIdxMap;





More information about the llvm-commits mailing list