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

Chris Lattner sabre at nondot.org
Tue Nov 7 10:05:13 PST 2006



Changes in directory llvm/lib/CodeGen:

LiveIntervalAnalysis.cpp updated: 1.191 -> 1.192
---
Log message:

Enable improved spilling costs by default.  This speeds up viterbi on x86
by 40%, FreeBench/fourinarow by 20%, and many other programs 10-25%.

On PPC, this speeds up fourinarow by 18%, and probably other things as well.



---
Diffs of the changes:  (+7 -12)

 LiveIntervalAnalysis.cpp |   19 +++++++------------
 1 files changed, 7 insertions(+), 12 deletions(-)


Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.191 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.192
--- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.191	Tue Nov  7 06:25:45 2006
+++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp	Tue Nov  7 12:04:58 2006
@@ -59,9 +59,6 @@
   EnableJoining("join-liveintervals",
                 cl::desc("Coallesce copies (default=true)"),
                 cl::init(true));
-  static cl::opt<bool>
-  EnableReweight("enable-majik-f00");
-  
 }
 
 void LiveIntervals::getAnalysisUsage(AnalysisUsage &AU) const {
@@ -221,16 +218,14 @@
       if (isZeroLengthInterval(&LI))
         LI.weight = HUGE_VALF;
       
-      if (EnableReweight) {
-        // Divide the weight of the interval by its size.  This encourages 
-        // spilling of intervals that are large and have few uses, and
-        // discourages spilling of small intervals with many uses.
-        unsigned Size = 0;
-        for (LiveInterval::iterator II = LI.begin(), E = LI.end(); II != E;++II)
-          Size += II->end - II->start;
+      // Divide the weight of the interval by its size.  This encourages 
+      // spilling of intervals that are large and have few uses, and
+      // discourages spilling of small intervals with many uses.
+      unsigned Size = 0;
+      for (LiveInterval::iterator II = LI.begin(), E = LI.end(); II != E;++II)
+        Size += II->end - II->start;
       
-        LI.weight /= Size;
-      }
+      LI.weight /= Size;
     }
   }
 






More information about the llvm-commits mailing list