Skip to content

Commit 0b624fe

Browse files
committed
* Order #includes as per style guide
* Doxygen-ify comments * Make code layout more consistent llvm-svn: 9431
1 parent 28ba80e commit 0b624fe

File tree

3 files changed

+45
-46
lines changed

3 files changed

+45
-46
lines changed

llvm/lib/CodeGen/RegAlloc/LiveRange.h

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,58 +18,58 @@
1818
#ifndef LIVERANGE_H
1919
#define LIVERANGE_H
2020

21-
#include "llvm/CodeGen/ValueSet.h"
2221
#include "llvm/Value.h"
22+
#include "llvm/CodeGen/ValueSet.h"
2323

2424
class RegClass;
2525
class IGNode;
2626

2727
class LiveRange : public ValueSet {
28-
RegClass *MyRegClass; // register classs (e.g., int, FP) for this LR
28+
RegClass *MyRegClass; // register class (e.g., int, FP) for this LR
2929

30-
// doesSpanAcrossCalls - Does this live range span across calls?
31-
// This information is used by graph
32-
// coloring algo to avoid allocating volatile colors to live ranges
33-
// that span across calls (since they have to be saved/restored)
34-
//
30+
/// doesSpanAcrossCalls - Does this live range span across calls?
31+
/// This information is used by graph coloring algo to avoid allocating
32+
/// volatile colors to live ranges that span across calls (since they have to
33+
/// be saved/restored)
34+
///
3535
bool doesSpanAcrossCalls;
3636

3737
IGNode *UserIGNode; // IGNode which uses this LR
3838
int Color; // color assigned to this live range
3939
bool mustSpill; // whether this LR must be spilt
4040

41-
// mustSaveAcrossCalls - whether this LR must be saved accross calls
42-
// ***TODO REMOVE this
43-
//
41+
/// mustSaveAcrossCalls - whether this LR must be saved accross calls
42+
/// ***TODO REMOVE this
43+
///
4444
bool mustSaveAcrossCalls;
4545

46-
// SuggestedColor - if this LR has a suggested color, can it be
47-
// really alloated? A suggested color cannot be allocated when the
48-
// suggested color is volatile and when there are call
49-
// interferences.
50-
//
46+
/// SuggestedColor - if this LR has a suggested color, can it be
47+
/// really alloated? A suggested color cannot be allocated when the
48+
/// suggested color is volatile and when there are call
49+
/// interferences.
50+
///
5151
int SuggestedColor; // The suggested color for this LR
5252

53-
// CanUseSuggestedCol - It is possible that a suggested color for
54-
// this live range is not available before graph coloring (e.g., it
55-
// can be allocated to another live range which interferes with
56-
// this)
57-
//
53+
/// CanUseSuggestedCol - It is possible that a suggested color for
54+
/// this live range is not available before graph coloring (e.g., it
55+
/// can be allocated to another live range which interferes with
56+
/// this)
57+
///
5858
bool CanUseSuggestedCol;
5959

60-
// SpilledStackOffsetFromFP - If this LR is spilled, its stack
61-
// offset from *FP*. The spilled offsets must always be relative to
62-
// the FP.
63-
//
60+
/// SpilledStackOffsetFromFP - If this LR is spilled, its stack
61+
/// offset from *FP*. The spilled offsets must always be relative to
62+
/// the FP.
63+
///
6464
int SpilledStackOffsetFromFP;
6565

66-
// HasSpillOffset 0 Whether this live range has a spill offset
67-
//
66+
/// HasSpillOffset 0 Whether this live range has a spill offset
67+
///
6868
bool HasSpillOffset;
6969

70-
// The spill cost of this live range. Calculated using loop depth of
71-
// each reference to each Value in the live range
72-
//
70+
/// The spill cost of this live range. Calculated using loop depth of
71+
/// each reference to each Value in the live range
72+
///
7373
unsigned SpillCost;
7474

7575
public:

llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111
//
1212
//===----------------------------------------------------------------------===//
1313

14+
#include "IGNode.h"
1415
#include "LiveRangeInfo.h"
1516
#include "RegAllocCommon.h"
1617
#include "RegClass.h"
17-
#include "IGNode.h"
18+
#include "llvm/Function.h"
1819
#include "llvm/CodeGen/MachineInstr.h"
1920
#include "llvm/CodeGen/MachineFunction.h"
2021
#include "llvm/Target/TargetMachine.h"
2122
#include "llvm/Target/TargetInstrInfo.h"
2223
#include "llvm/Target/TargetRegInfo.h"
23-
#include "llvm/Function.h"
2424
#include "Support/SetOperations.h"
2525

2626
unsigned LiveRange::getRegClassID() const { return getRegClass()->getID(); }
@@ -217,7 +217,6 @@ void LiveRangeInfo::constructLiveRanges() {
217217
}
218218

219219
} // for all machine instructions in the BB
220-
221220
} // for all BBs in function
222221

223222
// Now we have to suggest clors for call and return arg live ranges.
@@ -278,8 +277,7 @@ void LiveRangeInfo::suggestRegs4CallRets() {
278277
// Checks if live range LR interferes with any node assigned or suggested to
279278
// be assigned the specified color
280279
//
281-
inline bool InterferesWithColor(const LiveRange& LR, unsigned color)
282-
{
280+
inline bool InterferesWithColor(const LiveRange& LR, unsigned color) {
283281
IGNode* lrNode = LR.getUserIGNode();
284282
for (unsigned n=0, NN = lrNode->getNumOfNeighbors(); n < NN; n++) {
285283
LiveRange *neighLR = lrNode->getAdjIGNode(n)->getParentLR();
@@ -299,8 +297,7 @@ inline bool InterferesWithColor(const LiveRange& LR, unsigned color)
299297
// (4) LR2 has color and LR1 interferes with any LR that has the same color
300298
//
301299
inline bool InterfsPreventCoalescing(const LiveRange& LROfDef,
302-
const LiveRange& LROfUse)
303-
{
300+
const LiveRange& LROfUse) {
304301
// (4) if they have different suggested colors, cannot coalesce
305302
if (LROfDef.hasSuggestedColor() && LROfUse.hasSuggestedColor())
306303
return true;

llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.h

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,20 +87,22 @@ class LiveRangeInfo {
8787
std::vector<RegClass *> & RCList);
8888

8989

90-
// Destructor to destroy all LiveRanges in the LiveRange Map
90+
/// Destructor to destroy all LiveRanges in the LiveRange Map
91+
///
9192
~LiveRangeInfo();
9293

9394
// Main entry point for live range construction
9495
//
9596
void constructLiveRanges();
9697

97-
// return the common live range map for this method
98-
//
98+
/// return the common live range map for this method
99+
///
99100
inline const LiveRangeMapType *getLiveRangeMap() const
100101
{ return &LiveRangeMap; }
101102

102-
// Method used to get the live range containing a Value.
103-
// This may return NULL if no live range exists for a Value (eg, some consts)
103+
/// Method used to get the live range containing a Value.
104+
/// This may return NULL if no live range exists for a Value (eg, some consts)
105+
///
104106
inline LiveRange *getLiveRangeForValue(const Value *Val) {
105107
return LiveRangeMap[Val];
106108
}
@@ -109,13 +111,13 @@ class LiveRangeInfo {
109111
return I->second;
110112
}
111113

112-
// Method for coalescing live ranges. Called only after interference info
113-
// is calculated.
114-
//
114+
/// Method for coalescing live ranges. Called only after interference info
115+
/// is calculated.
116+
///
115117
void coalesceLRs();
116118

117-
// debugging method to print the live ranges
118-
//
119+
/// debugging method to print the live ranges
120+
///
119121
void printLiveRanges();
120122
};
121123

0 commit comments

Comments
 (0)