mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Publicize the type of FnAllocState.
Prototype option to save state in a global instead of as a Constant in the Module. (Turned off, for now, with the on/off switch welded in the off position. You get the idea.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9500 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3e43026095
commit
8fc493430c
@ -48,6 +48,12 @@
|
|||||||
|
|
||||||
RegAllocDebugLevel_t DEBUG_RA;
|
RegAllocDebugLevel_t DEBUG_RA;
|
||||||
|
|
||||||
|
/// The reoptimizer wants to be able to grovel through the register
|
||||||
|
/// allocator's state after it has done its job. This is a hack.
|
||||||
|
///
|
||||||
|
PhyRegAlloc::SavedStateMapTy ExportedFnAllocState;
|
||||||
|
const bool SaveStateToModule = false;
|
||||||
|
|
||||||
static cl::opt<RegAllocDebugLevel_t, true>
|
static cl::opt<RegAllocDebugLevel_t, true>
|
||||||
DRA_opt("dregalloc", cl::Hidden, cl::location(DEBUG_RA),
|
DRA_opt("dregalloc", cl::Hidden, cl::location(DEBUG_RA),
|
||||||
cl::desc("enable register allocation debugging information"),
|
cl::desc("enable register allocation debugging information"),
|
||||||
@ -1184,6 +1190,11 @@ bool PhyRegAlloc::doFinalization (Module &M) {
|
|||||||
if (!SaveRegAllocState)
|
if (!SaveRegAllocState)
|
||||||
return false; // Nothing to do here, unless we're saving state.
|
return false; // Nothing to do here, unless we're saving state.
|
||||||
|
|
||||||
|
if (!SaveStateToModule) {
|
||||||
|
ExportedFnAllocState = FnAllocState;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Convert FnAllocState to a single Constant array and add it
|
// Convert FnAllocState to a single Constant array and add it
|
||||||
// to the Module.
|
// to the Module.
|
||||||
ArrayType *AT = ArrayType::get (AllocInfo::getConstantType (), 0);
|
ArrayType *AT = ArrayType::get (AllocInfo::getConstantType (), 0);
|
||||||
|
@ -85,11 +85,11 @@ class PhyRegAlloc : public FunctionPass {
|
|||||||
AddedInstrns AddedInstrAtEntry; // to store instrns added at entry
|
AddedInstrns AddedInstrAtEntry; // to store instrns added at entry
|
||||||
const LoopInfo *LoopDepthCalc; // to calculate loop depths
|
const LoopInfo *LoopDepthCalc; // to calculate loop depths
|
||||||
|
|
||||||
std::map<const Function *, std::vector<AllocInfo> > FnAllocState;
|
|
||||||
|
|
||||||
PhyRegAlloc(const PhyRegAlloc&); // DO NOT IMPLEMENT
|
PhyRegAlloc(const PhyRegAlloc&); // DO NOT IMPLEMENT
|
||||||
void operator=(const PhyRegAlloc&); // DO NOT IMPLEMENT
|
void operator=(const PhyRegAlloc&); // DO NOT IMPLEMENT
|
||||||
public:
|
public:
|
||||||
|
typedef std::map<const Function *, std::vector<AllocInfo> > SavedStateMapTy;
|
||||||
|
|
||||||
inline PhyRegAlloc (const TargetMachine &TM_) :
|
inline PhyRegAlloc (const TargetMachine &TM_) :
|
||||||
TM (TM_), MRI (TM.getRegInfo ()),
|
TM (TM_), MRI (TM.getRegInfo ()),
|
||||||
NumOfRegClasses (MRI.getNumOfRegClasses ()) { }
|
NumOfRegClasses (MRI.getNumOfRegClasses ()) { }
|
||||||
@ -113,6 +113,8 @@ public:
|
|||||||
inline RegClass *getRegClassByID(unsigned id) { return RegClassList[id]; }
|
inline RegClass *getRegClassByID(unsigned id) { return RegClassList[id]; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
SavedStateMapTy FnAllocState;
|
||||||
|
|
||||||
void addInterference(const Value *Def, const ValueSet *LVSet,
|
void addInterference(const Value *Def, const ValueSet *LVSet,
|
||||||
bool isCallInst);
|
bool isCallInst);
|
||||||
bool markAllocatedRegs(MachineInstr* MInst);
|
bool markAllocatedRegs(MachineInstr* MInst);
|
||||||
|
@ -48,6 +48,12 @@
|
|||||||
|
|
||||||
RegAllocDebugLevel_t DEBUG_RA;
|
RegAllocDebugLevel_t DEBUG_RA;
|
||||||
|
|
||||||
|
/// The reoptimizer wants to be able to grovel through the register
|
||||||
|
/// allocator's state after it has done its job. This is a hack.
|
||||||
|
///
|
||||||
|
PhyRegAlloc::SavedStateMapTy ExportedFnAllocState;
|
||||||
|
const bool SaveStateToModule = false;
|
||||||
|
|
||||||
static cl::opt<RegAllocDebugLevel_t, true>
|
static cl::opt<RegAllocDebugLevel_t, true>
|
||||||
DRA_opt("dregalloc", cl::Hidden, cl::location(DEBUG_RA),
|
DRA_opt("dregalloc", cl::Hidden, cl::location(DEBUG_RA),
|
||||||
cl::desc("enable register allocation debugging information"),
|
cl::desc("enable register allocation debugging information"),
|
||||||
@ -1184,6 +1190,11 @@ bool PhyRegAlloc::doFinalization (Module &M) {
|
|||||||
if (!SaveRegAllocState)
|
if (!SaveRegAllocState)
|
||||||
return false; // Nothing to do here, unless we're saving state.
|
return false; // Nothing to do here, unless we're saving state.
|
||||||
|
|
||||||
|
if (!SaveStateToModule) {
|
||||||
|
ExportedFnAllocState = FnAllocState;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Convert FnAllocState to a single Constant array and add it
|
// Convert FnAllocState to a single Constant array and add it
|
||||||
// to the Module.
|
// to the Module.
|
||||||
ArrayType *AT = ArrayType::get (AllocInfo::getConstantType (), 0);
|
ArrayType *AT = ArrayType::get (AllocInfo::getConstantType (), 0);
|
||||||
|
@ -85,11 +85,11 @@ class PhyRegAlloc : public FunctionPass {
|
|||||||
AddedInstrns AddedInstrAtEntry; // to store instrns added at entry
|
AddedInstrns AddedInstrAtEntry; // to store instrns added at entry
|
||||||
const LoopInfo *LoopDepthCalc; // to calculate loop depths
|
const LoopInfo *LoopDepthCalc; // to calculate loop depths
|
||||||
|
|
||||||
std::map<const Function *, std::vector<AllocInfo> > FnAllocState;
|
|
||||||
|
|
||||||
PhyRegAlloc(const PhyRegAlloc&); // DO NOT IMPLEMENT
|
PhyRegAlloc(const PhyRegAlloc&); // DO NOT IMPLEMENT
|
||||||
void operator=(const PhyRegAlloc&); // DO NOT IMPLEMENT
|
void operator=(const PhyRegAlloc&); // DO NOT IMPLEMENT
|
||||||
public:
|
public:
|
||||||
|
typedef std::map<const Function *, std::vector<AllocInfo> > SavedStateMapTy;
|
||||||
|
|
||||||
inline PhyRegAlloc (const TargetMachine &TM_) :
|
inline PhyRegAlloc (const TargetMachine &TM_) :
|
||||||
TM (TM_), MRI (TM.getRegInfo ()),
|
TM (TM_), MRI (TM.getRegInfo ()),
|
||||||
NumOfRegClasses (MRI.getNumOfRegClasses ()) { }
|
NumOfRegClasses (MRI.getNumOfRegClasses ()) { }
|
||||||
@ -113,6 +113,8 @@ public:
|
|||||||
inline RegClass *getRegClassByID(unsigned id) { return RegClassList[id]; }
|
inline RegClass *getRegClassByID(unsigned id) { return RegClassList[id]; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
SavedStateMapTy FnAllocState;
|
||||||
|
|
||||||
void addInterference(const Value *Def, const ValueSet *LVSet,
|
void addInterference(const Value *Def, const ValueSet *LVSet,
|
||||||
bool isCallInst);
|
bool isCallInst);
|
||||||
bool markAllocatedRegs(MachineInstr* MInst);
|
bool markAllocatedRegs(MachineInstr* MInst);
|
||||||
|
Loading…
Reference in New Issue
Block a user