mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-05 17:39:16 +00:00
Transfer physical register spill info when load / store folding happens.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48246 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9736028d84
commit
c1f53c7426
@ -779,6 +779,7 @@ bool LiveIntervals::tryFoldMemoryOperand(MachineInstr* &MI,
|
||||
vrm.virtFolded(Reg, MI, fmi, (VirtRegMap::ModRef)MRInfo);
|
||||
vrm.transferSpillPts(MI, fmi);
|
||||
vrm.transferRestorePts(MI, fmi);
|
||||
vrm.transferEmergencySpills(MI, fmi);
|
||||
mi2iMap_.erase(MI);
|
||||
i2miMap_[InstrIdx /InstrSlots::NUM] = fmi;
|
||||
mi2iMap_[fmi] = InstrIdx;
|
||||
|
@ -35,6 +35,7 @@
|
||||
using namespace llvm;
|
||||
|
||||
STATISTIC(NumSpills, "Number of register spills");
|
||||
STATISTIC(NumPSpills,"Number of physical register spills");
|
||||
STATISTIC(NumReMats, "Number of re-materialization");
|
||||
STATISTIC(NumDRM , "Number of re-materializable defs elided");
|
||||
STATISTIC(NumStores, "Number of stores added");
|
||||
@ -1079,7 +1080,7 @@ void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, VirtRegMap &VRM) {
|
||||
TII->loadRegFromStackSlot(MBB, next(MII), PhysReg, SS, RC);
|
||||
MachineInstr *LoadMI = next(MII);
|
||||
VRM.addSpillSlotUse(SS, LoadMI);
|
||||
++NumSpills;
|
||||
++NumPSpills;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -268,6 +268,8 @@ namespace llvm {
|
||||
}
|
||||
}
|
||||
|
||||
/// @brief - transfer spill point information from one instruction to
|
||||
/// another.
|
||||
void transferSpillPts(MachineInstr *Old, MachineInstr *New) {
|
||||
std::map<MachineInstr*,std::vector<std::pair<unsigned,bool> > >::iterator
|
||||
I = SpillPt2VirtMap.find(Old);
|
||||
@ -343,6 +345,21 @@ namespace llvm {
|
||||
return EmergencySpillMap[MI];
|
||||
}
|
||||
|
||||
/// @brief - transfer emergency spill information from one instruction to
|
||||
/// another.
|
||||
void transferEmergencySpills(MachineInstr *Old, MachineInstr *New) {
|
||||
std::map<MachineInstr*,std::vector<unsigned> >::iterator I =
|
||||
EmergencySpillMap.find(Old);
|
||||
if (I == EmergencySpillMap.end())
|
||||
return;
|
||||
while (!I->second.empty()) {
|
||||
unsigned virtReg = I->second.back();
|
||||
I->second.pop_back();
|
||||
addEmergencySpill(virtReg, New);
|
||||
}
|
||||
EmergencySpillMap.erase(I);
|
||||
}
|
||||
|
||||
/// @brief return or get a emergency spill slot for the register class.
|
||||
int getEmergencySpillSlot(const TargetRegisterClass *RC);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user