mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
* Code Cleanups of IGNode.h
* Removal of getTypeID() methods, and dependence on llvm/Type.h, from IGNode & LiveRange llvm-svn: 1717
This commit is contained in:
parent
164a9ea118
commit
73812e2833
@ -25,7 +25,6 @@
|
|||||||
#ifndef IG_NODE_H
|
#ifndef IG_NODE_H
|
||||||
#define IG_NODE_H
|
#define IG_NODE_H
|
||||||
|
|
||||||
|
|
||||||
#include "llvm/CodeGen/RegAllocCommon.h"
|
#include "llvm/CodeGen/RegAllocCommon.h"
|
||||||
#include "llvm/CodeGen/LiveRange.h"
|
#include "llvm/CodeGen/LiveRange.h"
|
||||||
class LiveRange;
|
class LiveRange;
|
||||||
@ -56,35 +55,25 @@ public:
|
|||||||
|
|
||||||
// constructor
|
// constructor
|
||||||
//
|
//
|
||||||
IGNode(LiveRange *const LR, unsigned int index);
|
IGNode(LiveRange *LR, unsigned index);
|
||||||
|
|
||||||
// an empty destructor
|
inline unsigned int getIndex() const { return Index; }
|
||||||
//
|
|
||||||
~IGNode() { }
|
|
||||||
|
|
||||||
|
|
||||||
inline unsigned int getIndex() const
|
|
||||||
{ return Index; }
|
|
||||||
|
|
||||||
// adjLists must be updated only once. However, the CurDegree can be changed
|
// adjLists must be updated only once. However, the CurDegree can be changed
|
||||||
//
|
//
|
||||||
inline void addAdjIGNode( IGNode *const AdjNode)
|
inline void addAdjIGNode(IGNode *AdjNode) { AdjList.push_back(AdjNode); }
|
||||||
{ AdjList.push_back(AdjNode); }
|
|
||||||
|
|
||||||
inline IGNode * getAdjIGNode(unsigned int ind) const
|
inline IGNode *getAdjIGNode(unsigned ind) const
|
||||||
{ assert ( ind < AdjList.size()); return AdjList[ ind ]; }
|
{ assert ( ind < AdjList.size()); return AdjList[ind]; }
|
||||||
|
|
||||||
// delete a node in AdjList - node must be in the list
|
// delete a node in AdjList - node must be in the list
|
||||||
// should not be called often
|
// should not be called often
|
||||||
//
|
//
|
||||||
void delAdjIGNode(const IGNode *const Node);
|
void delAdjIGNode(const IGNode *Node);
|
||||||
|
|
||||||
inline unsigned int getNumOfNeighbors() const
|
inline unsigned getNumOfNeighbors() const { return AdjList.size(); }
|
||||||
{ return AdjList.size() ; }
|
|
||||||
|
|
||||||
|
inline bool isOnStack() const { return OnStack; }
|
||||||
inline bool isOnStack() const
|
|
||||||
{ return OnStack; }
|
|
||||||
|
|
||||||
// remove form IG and pushes on to stack (reduce the degree of neighbors)
|
// remove form IG and pushes on to stack (reduce the degree of neighbors)
|
||||||
//
|
//
|
||||||
@ -95,16 +84,16 @@ public:
|
|||||||
// after all modifications to the IG are over (i.e., all neighbors are
|
// after all modifications to the IG are over (i.e., all neighbors are
|
||||||
// fixed).
|
// fixed).
|
||||||
//
|
//
|
||||||
inline void setCurDegree()
|
inline void setCurDegree() {
|
||||||
{ assert( CurDegree == -1); CurDegree = AdjList.size(); }
|
assert(CurDegree == -1);
|
||||||
|
CurDegree = AdjList.size();
|
||||||
|
}
|
||||||
|
|
||||||
inline int getCurDegree() const
|
inline int getCurDegree() const { return CurDegree; }
|
||||||
{ return CurDegree; }
|
|
||||||
|
|
||||||
// called when a neigh is pushed on to stack
|
// called when a neigh is pushed on to stack
|
||||||
//
|
//
|
||||||
inline void decCurDegree()
|
inline void decCurDegree() { assert(CurDegree > 0); --CurDegree; }
|
||||||
{ assert( CurDegree > 0 ); --CurDegree; }
|
|
||||||
|
|
||||||
|
|
||||||
// The following methods call the methods in ParentLR
|
// The following methods call the methods in ParentLR
|
||||||
@ -112,39 +101,24 @@ public:
|
|||||||
// If many of these are called within a single scope,
|
// If many of these are called within a single scope,
|
||||||
// consider calling the methods directly on LR
|
// consider calling the methods directly on LR
|
||||||
|
|
||||||
|
inline void setRegClass(RegClass *RC) { ParentLR->setRegClass(RC); }
|
||||||
|
|
||||||
inline void setRegClass(RegClass *const RC)
|
inline RegClass *getRegClass() const { return ParentLR->getRegClass(); }
|
||||||
{ ParentLR->setRegClass(RC); }
|
|
||||||
|
|
||||||
inline RegClass *const getRegClass() const {
|
inline bool hasColor() const { return ParentLR->hasColor(); }
|
||||||
return ParentLR->getRegClass();
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool hasColor() const
|
inline unsigned int getColor() const { return ParentLR->getColor(); }
|
||||||
{ return ParentLR->hasColor(); }
|
|
||||||
|
|
||||||
inline unsigned int getColor() const
|
inline void setColor(unsigned Col) { ParentLR->setColor(Col); }
|
||||||
{ return ParentLR->getColor(); }
|
|
||||||
|
|
||||||
inline void setColor(unsigned int Col)
|
inline void markForSpill() { ParentLR->markForSpill(); }
|
||||||
{ ParentLR->setColor(Col); }
|
|
||||||
|
|
||||||
inline void markForSpill()
|
inline void markForSaveAcrossCalls() { ParentLR->markForSaveAcrossCalls(); }
|
||||||
{ ParentLR->markForSpill(); }
|
|
||||||
|
|
||||||
inline void markForSaveAcrossCalls()
|
|
||||||
{ ParentLR->markForSaveAcrossCalls(); }
|
|
||||||
|
|
||||||
inline unsigned int isCallInterference() const
|
inline unsigned int isCallInterference() const
|
||||||
{ return ParentLR->isCallInterference(); }
|
{ return ParentLR->isCallInterference(); }
|
||||||
|
|
||||||
inline LiveRange *getParentLR() const
|
inline LiveRange *getParentLR() const { return ParentLR; }
|
||||||
{ return ParentLR; }
|
|
||||||
|
|
||||||
inline Type::PrimitiveID getTypeID() const
|
|
||||||
{ return ParentLR->getTypeID(); }
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -12,11 +12,12 @@
|
|||||||
#define LIVE_RANGE_H
|
#define LIVE_RANGE_H
|
||||||
|
|
||||||
#include "llvm/Analysis/LiveVar/ValueSet.h"
|
#include "llvm/Analysis/LiveVar/ValueSet.h"
|
||||||
#include "llvm/Type.h"
|
#include "llvm/Value.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class RegClass;
|
class RegClass;
|
||||||
class IGNode;
|
class IGNode;
|
||||||
|
class Type;
|
||||||
|
|
||||||
class LiveRange : public ValueSet {
|
class LiveRange : public ValueSet {
|
||||||
RegClass *MyRegClass; // register classs (e.g., int, FP) for this LR
|
RegClass *MyRegClass; // register classs (e.g., int, FP) for this LR
|
||||||
@ -134,10 +135,6 @@ public:
|
|||||||
return (*begin())->getType(); // set's don't have a front
|
return (*begin())->getType(); // set's don't have a front
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Type::PrimitiveID getTypeID() const {
|
|
||||||
return getType()->getPrimitiveID();
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void setSuggestedColor(int Col) {
|
inline void setSuggestedColor(int Col) {
|
||||||
if (SuggestedColor == -1)
|
if (SuggestedColor == -1)
|
||||||
SuggestedColor = Col;
|
SuggestedColor = Col;
|
||||||
|
Loading…
Reference in New Issue
Block a user