mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-05 12:31:46 +00:00
Changed Call interference info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@917 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
958faf3f5a
commit
36f7707d2a
@ -122,8 +122,8 @@ class IGNode
|
|||||||
// { ParentLR->markForLoadFromStack(); }
|
// { ParentLR->markForLoadFromStack(); }
|
||||||
|
|
||||||
|
|
||||||
inline unsigned int getNumOfCallInterferences() const
|
inline unsigned int isCallInterference() const
|
||||||
{ return ParentLR->getNumOfCallInterferences(); }
|
{ return ParentLR->isCallInterference(); }
|
||||||
|
|
||||||
inline LiveRange *getParentLR() const
|
inline LiveRange *getParentLR() const
|
||||||
{ return ParentLR; }
|
{ return ParentLR; }
|
||||||
|
@ -28,13 +28,20 @@ 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
|
||||||
|
|
||||||
// a list of call instructions that interferes with this live range
|
// a list of call instructions that interferes with this live range
|
||||||
vector<const Instruction *> CallInterferenceList;
|
//vector<const Instruction *> CallInterferenceList;
|
||||||
|
|
||||||
|
// 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
|
IGNode *UserIGNode; // IGNode which uses this LR
|
||||||
int Color; // color assigned to this live range
|
int Color; // color assigned to this live range
|
||||||
bool mustSpill; // whether this LR must be spilt
|
bool mustSpill; // whether this LR must be spilt
|
||||||
|
|
||||||
// whether this LR must be saved accross calls
|
// whether this LR must be saved accross calls ***TODO REMOVE this
|
||||||
bool mustSaveAcrossCalls;
|
bool mustSaveAcrossCalls;
|
||||||
|
|
||||||
// bool mustLoadFromStack; // must load from stack at start of method
|
// bool mustLoadFromStack; // must load from stack at start of method
|
||||||
@ -63,16 +70,22 @@ class LiveRange : public ValueSet
|
|||||||
{ Color = (int) Col ; }
|
{ Color = (int) Col ; }
|
||||||
|
|
||||||
|
|
||||||
inline void addCallInterference(const Instruction *const Inst)
|
inline void setCallInterference()
|
||||||
{ CallInterferenceList.push_back( Inst ); }
|
{ doesSpanAcrossCalls = 1;
|
||||||
|
//CallInterferenceList.push_back( Inst );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
inline const Instruction *const getCallInterference(const unsigned i) const {
|
inline const Instruction *const getCallInterference(const unsigned i) const {
|
||||||
assert( i < CallInterferenceList.size() );
|
assert( i < CallInterferenceList.size() );
|
||||||
return CallInterferenceList[i];
|
return CallInterferenceList[i];
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
inline unsigned int getNumOfCallInterferences() const
|
inline bool isCallInterference() const
|
||||||
{ return CallInterferenceList.size(); }
|
{ return (doesSpanAcrossCalls == 1); }
|
||||||
|
|
||||||
|
|
||||||
inline void markForSpill() { mustSpill = true; }
|
inline void markForSpill() { mustSpill = true; }
|
||||||
@ -113,12 +126,14 @@ class LiveRange : public ValueSet
|
|||||||
return ( SuggestedColor > -1);
|
return ( SuggestedColor > -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline LiveRange() : ValueSet() , CallInterferenceList()
|
inline LiveRange() : ValueSet() /* , CallInterferenceList() */
|
||||||
{
|
{
|
||||||
Color = SuggestedColor = -1; // not yet colored
|
Color = SuggestedColor = -1; // not yet colored
|
||||||
mustSpill = mustSaveAcrossCalls = false;
|
mustSpill = mustSaveAcrossCalls = false;
|
||||||
MyRegClass = NULL;
|
MyRegClass = NULL;
|
||||||
UserIGNode = NULL;
|
UserIGNode = NULL;
|
||||||
|
doesSpanAcrossCalls = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -84,6 +84,8 @@ class PhyRegAlloc
|
|||||||
void insertCallerSavingCode(const MachineInstr *MInst,
|
void insertCallerSavingCode(const MachineInstr *MInst,
|
||||||
const BasicBlock *BB );
|
const BasicBlock *BB );
|
||||||
|
|
||||||
|
void setCallInterferences(const MachineInstr *MInst,
|
||||||
|
const LiveVarSet *const LVSetAft );
|
||||||
|
|
||||||
inline void constructLiveRanges()
|
inline void constructLiveRanges()
|
||||||
{ LRI.constructLiveRanges(); }
|
{ LRI.constructLiveRanges(); }
|
||||||
|
@ -122,8 +122,8 @@ class IGNode
|
|||||||
// { ParentLR->markForLoadFromStack(); }
|
// { ParentLR->markForLoadFromStack(); }
|
||||||
|
|
||||||
|
|
||||||
inline unsigned int getNumOfCallInterferences() const
|
inline unsigned int isCallInterference() const
|
||||||
{ return ParentLR->getNumOfCallInterferences(); }
|
{ return ParentLR->isCallInterference(); }
|
||||||
|
|
||||||
inline LiveRange *getParentLR() const
|
inline LiveRange *getParentLR() const
|
||||||
{ return ParentLR; }
|
{ return ParentLR; }
|
||||||
|
@ -28,13 +28,20 @@ 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
|
||||||
|
|
||||||
// a list of call instructions that interferes with this live range
|
// a list of call instructions that interferes with this live range
|
||||||
vector<const Instruction *> CallInterferenceList;
|
//vector<const Instruction *> CallInterferenceList;
|
||||||
|
|
||||||
|
// 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
|
IGNode *UserIGNode; // IGNode which uses this LR
|
||||||
int Color; // color assigned to this live range
|
int Color; // color assigned to this live range
|
||||||
bool mustSpill; // whether this LR must be spilt
|
bool mustSpill; // whether this LR must be spilt
|
||||||
|
|
||||||
// whether this LR must be saved accross calls
|
// whether this LR must be saved accross calls ***TODO REMOVE this
|
||||||
bool mustSaveAcrossCalls;
|
bool mustSaveAcrossCalls;
|
||||||
|
|
||||||
// bool mustLoadFromStack; // must load from stack at start of method
|
// bool mustLoadFromStack; // must load from stack at start of method
|
||||||
@ -63,16 +70,22 @@ class LiveRange : public ValueSet
|
|||||||
{ Color = (int) Col ; }
|
{ Color = (int) Col ; }
|
||||||
|
|
||||||
|
|
||||||
inline void addCallInterference(const Instruction *const Inst)
|
inline void setCallInterference()
|
||||||
{ CallInterferenceList.push_back( Inst ); }
|
{ doesSpanAcrossCalls = 1;
|
||||||
|
//CallInterferenceList.push_back( Inst );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
inline const Instruction *const getCallInterference(const unsigned i) const {
|
inline const Instruction *const getCallInterference(const unsigned i) const {
|
||||||
assert( i < CallInterferenceList.size() );
|
assert( i < CallInterferenceList.size() );
|
||||||
return CallInterferenceList[i];
|
return CallInterferenceList[i];
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
inline unsigned int getNumOfCallInterferences() const
|
inline bool isCallInterference() const
|
||||||
{ return CallInterferenceList.size(); }
|
{ return (doesSpanAcrossCalls == 1); }
|
||||||
|
|
||||||
|
|
||||||
inline void markForSpill() { mustSpill = true; }
|
inline void markForSpill() { mustSpill = true; }
|
||||||
@ -113,12 +126,14 @@ class LiveRange : public ValueSet
|
|||||||
return ( SuggestedColor > -1);
|
return ( SuggestedColor > -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline LiveRange() : ValueSet() , CallInterferenceList()
|
inline LiveRange() : ValueSet() /* , CallInterferenceList() */
|
||||||
{
|
{
|
||||||
Color = SuggestedColor = -1; // not yet colored
|
Color = SuggestedColor = -1; // not yet colored
|
||||||
mustSpill = mustSaveAcrossCalls = false;
|
mustSpill = mustSaveAcrossCalls = false;
|
||||||
MyRegClass = NULL;
|
MyRegClass = NULL;
|
||||||
UserIGNode = NULL;
|
UserIGNode = NULL;
|
||||||
|
doesSpanAcrossCalls = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -84,6 +84,8 @@ class PhyRegAlloc
|
|||||||
void insertCallerSavingCode(const MachineInstr *MInst,
|
void insertCallerSavingCode(const MachineInstr *MInst,
|
||||||
const BasicBlock *BB );
|
const BasicBlock *BB );
|
||||||
|
|
||||||
|
void setCallInterferences(const MachineInstr *MInst,
|
||||||
|
const LiveVarSet *const LVSetAft );
|
||||||
|
|
||||||
inline void constructLiveRanges()
|
inline void constructLiveRanges()
|
||||||
{ LRI.constructLiveRanges(); }
|
{ LRI.constructLiveRanges(); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user