aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2003-10-23 18:03:50 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2003-10-23 18:03:50 +0000
commit0b624fefb7e05f7dcb627e038ecb2946ce79bac1 (patch)
tree5dc7653a2330d7eeb8a3058bfe051cc465118166
parent28ba80e648610adf7ab114de5b087d8c1de61d3e (diff)
downloadllvm-0b624fefb7e05f7dcb627e038ecb2946ce79bac1.zip
llvm-0b624fefb7e05f7dcb627e038ecb2946ce79bac1.tar.gz
llvm-0b624fefb7e05f7dcb627e038ecb2946ce79bac1.tar.bz2
* Order #includes as per style guide
* Doxygen-ify comments * Make code layout more consistent llvm-svn: 9431
-rw-r--r--llvm/lib/CodeGen/RegAlloc/LiveRange.h58
-rw-r--r--llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp11
-rw-r--r--llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.h22
3 files changed, 45 insertions, 46 deletions
diff --git a/llvm/lib/CodeGen/RegAlloc/LiveRange.h b/llvm/lib/CodeGen/RegAlloc/LiveRange.h
index c06cfdc9..aa409c6 100644
--- a/llvm/lib/CodeGen/RegAlloc/LiveRange.h
+++ b/llvm/lib/CodeGen/RegAlloc/LiveRange.h
@@ -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:
diff --git a/llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp b/llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp
index 0f7958c..b9fcda7 100644
--- a/llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp
+++ b/llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp
@@ -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 @@ void LiveRangeInfo::constructLiveRanges() {
}
} // 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 @@ void LiveRangeInfo::suggestRegs4CallRets() {
// 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 @@ inline bool InterferesWithColor(const LiveRange& LR, unsigned color)
// (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;
diff --git a/llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.h b/llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.h
index a9cb349..5c5244b 100644
--- a/llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.h
+++ b/llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.h
@@ -87,20 +87,22 @@ public:
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 @@ public:
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();
};