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

Chris Lattner lattner at cs.uiuc.edu
Thu Aug 31 23:10:32 PDT 2006



Changes in directory llvm/lib/CodeGen:

LiveIntervalAnalysis.cpp updated: 1.177 -> 1.178
---
Log message:

Reserve space in the ValueNumberInfo vector.  This speeds up live interval
analysis 16% on crafty.

Wrap long lines.


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

 LiveIntervalAnalysis.cpp |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)


Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.177 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.178
--- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.177	Thu Aug 31 23:02:42 2006
+++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp	Fri Sep  1 01:10:18 2006
@@ -879,7 +879,6 @@
   return ThisValNoAssignments[VN] = UltimateVN;
 }
 
-
 /// JoinIntervals - Attempt to join these two intervals.  On failure, this
 /// returns false.  Otherwise, if one of the intervals being joined is a
 /// physreg, this method always canonicalizes LHS to be it.  The output
@@ -893,7 +892,8 @@
   SmallVector<std::pair<unsigned,unsigned>, 16> ValueNumberInfo;
   LHSValNoAssignments.resize(LHS.getNumValNums(), -1);
   RHSValNoAssignments.resize(RHS.getNumValNums(), -1);
-  
+  ValueNumberInfo.reserve(LHS.getNumValNums() + RHS.getNumValNums());
+                          
   // Compute ultimate value numbers for the LHS and RHS values.
   if (RHS.containsOneValue()) {
     // Copies from a liveinterval with a single value are simple to handle and
@@ -950,8 +950,8 @@
     RHSValNoAssignments[0] = RHSValID;
     
   } else {
-    // Loop over the value numbers of the LHS, seeing if any are defined from the
-    // RHS.
+    // Loop over the value numbers of the LHS, seeing if any are defined from
+    // the RHS.
     SmallVector<int, 16> LHSValsDefinedFromRHS;
     LHSValsDefinedFromRHS.resize(LHS.getNumValNums(), -1);
     for (unsigned VN = 0, e = LHS.getNumValNums(); VN != e; ++VN) {
@@ -959,8 +959,8 @@
       if (ValSrcReg == 0)  // Src not defined by a copy?
         continue;
       
-      // DstReg is known to be a register in the LHS interval.  If the src is from
-      // the RHS interval, we can use its value #.
+      // DstReg is known to be a register in the LHS interval.  If the src is
+      // from the RHS interval, we can use its value #.
       if (rep(ValSrcReg) != RHS.reg)
         continue;
       
@@ -969,8 +969,8 @@
       LHSValsDefinedFromRHS[VN] = RHS.getLiveRangeContaining(ValInst-1)->ValId;
     }
     
-    // Loop over the value numbers of the RHS, seeing if any are defined from the
-    // LHS.
+    // Loop over the value numbers of the RHS, seeing if any are defined from
+    // the LHS.
     SmallVector<int, 16> RHSValsDefinedFromLHS;
     RHSValsDefinedFromLHS.resize(RHS.getNumValNums(), -1);
     for (unsigned VN = 0, e = RHS.getNumValNums(); VN != e; ++VN) {
@@ -978,8 +978,8 @@
       if (ValSrcReg == 0)  // Src not defined by a copy?
         continue;
       
-      // DstReg is known to be a register in the RHS interval.  If the src is from
-      // the LHS interval, we can use its value #.
+      // DstReg is known to be a register in the RHS interval.  If the src is
+      // from the LHS interval, we can use its value #.
       if (rep(ValSrcReg) != LHS.reg)
         continue;
       






More information about the llvm-commits mailing list