[llvm-commits] CVS: llvm/lib/CodeGen/RegAlloc/LiveRange.h LiveRangeInfo.cpp LiveRangeInfo.h

Misha Brukman brukman at cs.uiuc.edu
Thu Oct 23 13:05:05 PDT 2003


Changes in directory llvm/lib/CodeGen/RegAlloc:

LiveRange.h updated: 1.23 -> 1.24
LiveRangeInfo.cpp updated: 1.45 -> 1.46
LiveRangeInfo.h updated: 1.21 -> 1.22

---
Log message:

* Order #includes as per style guide
* Doxygen-ify comments
* Make code layout more consistent


---
Diffs of the changes:  (+45 -46)

Index: llvm/lib/CodeGen/RegAlloc/LiveRange.h
diff -u llvm/lib/CodeGen/RegAlloc/LiveRange.h:1.23 llvm/lib/CodeGen/RegAlloc/LiveRange.h:1.24
--- llvm/lib/CodeGen/RegAlloc/LiveRange.h:1.23	Tue Oct 21 10:17:13 2003
+++ llvm/lib/CodeGen/RegAlloc/LiveRange.h	Thu Oct 23 13:03:49 2003
@@ -18,58 +18,58 @@
 #ifndef LIVERANGE_H
 #define LIVERANGE_H
 
-#include "llvm/CodeGen/ValueSet.h"
 #include "llvm/Value.h"
+#include "llvm/CodeGen/ValueSet.h"
 
 class RegClass;
 class IGNode;
 
 class LiveRange : public ValueSet {
-  RegClass *MyRegClass;       // register classs (e.g., int, FP) for this LR
+  RegClass *MyRegClass;       // register class (e.g., int, FP) for this LR
 
-  // doesSpanAcrossCalls - Does this live range span across calls? 
-  // This information is used by graph
-  // coloring algo to avoid allocating volatile colors to live ranges
-  // that span across calls (since they have to be saved/restored)
-  //
+  /// doesSpanAcrossCalls - Does this live range span across calls? 
+  /// This information is used by graph coloring algo to avoid allocating
+  /// volatile colors to live ranges that span across calls (since they have to
+  /// be saved/restored)
+  ///
   bool doesSpanAcrossCalls;
 
   IGNode *UserIGNode;         // IGNode which uses this LR
   int Color;                  // color assigned to this live range
   bool mustSpill;             // whether this LR must be spilt
 
-  // mustSaveAcrossCalls - whether this LR must be saved accross calls
-  // ***TODO REMOVE this
-  //
+  /// mustSaveAcrossCalls - whether this LR must be saved accross calls
+  /// ***TODO REMOVE this
+  ///
   bool mustSaveAcrossCalls;        
   
-  // SuggestedColor - if this LR has a suggested color, can it be
-  // really alloated?  A suggested color cannot be allocated when the
-  // suggested color is volatile and when there are call
-  // interferences.
-  //
+  /// SuggestedColor - if this LR has a suggested color, can it be
+  /// really alloated?  A suggested color cannot be allocated when the
+  /// suggested color is volatile and when there are call
+  /// interferences.
+  ///
   int SuggestedColor;        // The suggested color for this LR
 
-  // CanUseSuggestedCol - It is possible that a suggested color for
-  // this live range is not available before graph coloring (e.g., it
-  // can be allocated to another live range which interferes with
-  // this)
-  // 
+  /// CanUseSuggestedCol - It is possible that a suggested color for
+  /// this live range is not available before graph coloring (e.g., it
+  /// can be allocated to another live range which interferes with
+  /// this)
+  /// 
   bool CanUseSuggestedCol;
 
-  // SpilledStackOffsetFromFP - If this LR is spilled, its stack
-  // offset from *FP*. The spilled offsets must always be relative to
-  // the FP.
-  //
+  /// SpilledStackOffsetFromFP - If this LR is spilled, its stack
+  /// offset from *FP*. The spilled offsets must always be relative to
+  /// the FP.
+  ///
   int SpilledStackOffsetFromFP;
 
-  // HasSpillOffset 0 Whether this live range has a spill offset
-  //
+  /// HasSpillOffset 0 Whether this live range has a spill offset
+  ///
   bool HasSpillOffset;
 
-  // The spill cost of this live range. Calculated using loop depth of
-  // each reference to each Value in the live range
-  //
+  /// The spill cost of this live range. Calculated using loop depth of
+  /// each reference to each Value in the live range
+  ///
   unsigned SpillCost;
 
 public:


Index: llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp
diff -u llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp:1.45 llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp:1.46
--- llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp:1.45	Mon Oct 20 14:43:16 2003
+++ llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp	Thu Oct 23 13:03:50 2003
@@ -11,16 +11,16 @@
 // 
 //===----------------------------------------------------------------------===//
 
+#include "IGNode.h"
 #include "LiveRangeInfo.h"
 #include "RegAllocCommon.h"
 #include "RegClass.h"
-#include "IGNode.h"
+#include "llvm/Function.h"
 #include "llvm/CodeGen/MachineInstr.h"
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Target/TargetInstrInfo.h"
 #include "llvm/Target/TargetRegInfo.h"
-#include "llvm/Function.h"
 #include "Support/SetOperations.h"
 
 unsigned LiveRange::getRegClassID() const { return getRegClass()->getID(); }
@@ -217,7 +217,6 @@
 	}
 
     } // for all machine instructions in the BB
-
   } // for all BBs in function
 
   // Now we have to suggest clors for call and return arg live ranges.
@@ -278,8 +277,7 @@
 // Checks if live range LR interferes with any node assigned or suggested to
 // be assigned the specified color
 // 
-inline bool InterferesWithColor(const LiveRange& LR, unsigned color)
-{
+inline bool InterferesWithColor(const LiveRange& LR, unsigned color) {
   IGNode* lrNode = LR.getUserIGNode();
   for (unsigned n=0, NN = lrNode->getNumOfNeighbors(); n < NN; n++) {
     LiveRange *neighLR = lrNode->getAdjIGNode(n)->getParentLR();
@@ -299,8 +297,7 @@
 // (4) LR2 has color and LR1 interferes with any LR that has the same color
 // 
 inline bool InterfsPreventCoalescing(const LiveRange& LROfDef,
-                                     const LiveRange& LROfUse)
-{
+                                     const LiveRange& LROfUse) {
   // (4) if they have different suggested colors, cannot coalesce
   if (LROfDef.hasSuggestedColor() && LROfUse.hasSuggestedColor())
     return true;


Index: llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.h
diff -u llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.h:1.21 llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.h:1.22
--- llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.h:1.21	Tue Oct 21 10:17:13 2003
+++ llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.h	Thu Oct 23 13:03:50 2003
@@ -87,20 +87,22 @@
 		std::vector<RegClass *> & RCList);
 
 
-  // Destructor to destroy all LiveRanges in the LiveRange Map
+  /// Destructor to destroy all LiveRanges in the LiveRange Map
+  ///
   ~LiveRangeInfo();
 
   // Main entry point for live range construction
   //
   void constructLiveRanges();
   
-  // return the common live range map for this method
-  //
+  /// return the common live range map for this method
+  ///
   inline const LiveRangeMapType *getLiveRangeMap() const 
     { return &LiveRangeMap; }
 
-  // Method used to get the live range containing a Value.
-  // This may return NULL if no live range exists for a Value (eg, some consts)
+  /// Method used to get the live range containing a Value.
+  /// This may return NULL if no live range exists for a Value (eg, some consts)
+  ///
   inline LiveRange *getLiveRangeForValue(const Value *Val) {
     return LiveRangeMap[Val];
   }
@@ -109,13 +111,13 @@
     return I->second;
   }
 
-  // Method for coalescing live ranges. Called only after interference info
-  // is calculated.
-  //
+  /// Method for coalescing live ranges. Called only after interference info
+  /// is calculated.
+  ///
   void coalesceLRs();  
 
-  // debugging method to print the live ranges
-  //
+  /// debugging method to print the live ranges
+  ///
   void printLiveRanges();
 };
 





More information about the llvm-commits mailing list