mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-23 14:25:07 +00:00
Minor spiller tweak to unfavor reload into load/store instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52477 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -121,8 +121,12 @@ namespace llvm {
|
||||
return getBaseIndex(index) + InstrSlots::STORE;
|
||||
}
|
||||
|
||||
static float getSpillWeight(bool isDef, bool isUse, unsigned loopDepth) {
|
||||
return (isDef + isUse) * powf(10.0F, (float)loopDepth);
|
||||
static float getSpillWeight(bool isDef, bool isUse, bool isMem,
|
||||
unsigned loopDepth) {
|
||||
float Weight = isDef;
|
||||
if (isUse)
|
||||
Weight += isMem ? 1.2f : 1.0f;
|
||||
return Weight * powf(10.0F, (float)loopDepth);
|
||||
}
|
||||
|
||||
typedef Reg2IntervalMap::iterator iterator;
|
||||
|
@@ -135,6 +135,13 @@ public:
|
||||
assert(Reg < VRegInfo.size() && "Invalid vreg!");
|
||||
return VRegInfo[Reg].first;
|
||||
}
|
||||
|
||||
/// setRegClass - Set the register class of the specified virtual register.
|
||||
void setRegClass(unsigned Reg, const TargetRegisterClass *RC) {
|
||||
Reg -= TargetRegisterInfo::FirstVirtualRegister;
|
||||
assert(Reg < VRegInfo.size() && "Invalid vreg!");
|
||||
VRegInfo[Reg].first = RC;
|
||||
}
|
||||
|
||||
/// createVirtualRegister - Create and return a new virtual register in the
|
||||
/// function with the specified register class.
|
||||
|
Reference in New Issue
Block a user