mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 21:32:39 +00:00
If a split live interval is spilled again, remove the kill marker on its last use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44611 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f38d14f03e
commit
adf8590690
@ -1165,6 +1165,7 @@ addIntervalsForSpills(const LiveInterval &li,
|
|||||||
// it's also guaranteed to be a single val# / range interval.
|
// it's also guaranteed to be a single val# / range interval.
|
||||||
if (vrm.getPreSplitReg(li.reg)) {
|
if (vrm.getPreSplitReg(li.reg)) {
|
||||||
vrm.setIsSplitFromReg(li.reg, 0);
|
vrm.setIsSplitFromReg(li.reg, 0);
|
||||||
|
vrm.removeKillPoint(li.reg);
|
||||||
bool DefIsReMat = vrm.isReMaterialized(li.reg);
|
bool DefIsReMat = vrm.isReMaterialized(li.reg);
|
||||||
Slot = vrm.getStackSlot(li.reg);
|
Slot = vrm.getStackSlot(li.reg);
|
||||||
assert(Slot != VirtRegMap::MAX_STACK_SLOT);
|
assert(Slot != VirtRegMap::MAX_STACK_SLOT);
|
||||||
@ -1398,8 +1399,10 @@ addIntervalsForSpills(const LiveInterval &li,
|
|||||||
int UseIdx = LastUse->findRegisterUseOperandIdx(LI->reg);
|
int UseIdx = LastUse->findRegisterUseOperandIdx(LI->reg);
|
||||||
assert(UseIdx != -1);
|
assert(UseIdx != -1);
|
||||||
if (LastUse->getInstrDescriptor()->
|
if (LastUse->getInstrDescriptor()->
|
||||||
getOperandConstraint(UseIdx, TOI::TIED_TO) == -1)
|
getOperandConstraint(UseIdx, TOI::TIED_TO) == -1) {
|
||||||
LastUse->getOperand(UseIdx).setIsKill();
|
LastUse->getOperand(UseIdx).setIsKill();
|
||||||
|
vrm.addKillPoint(LI->reg, &LastUse->getOperand(UseIdx));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
RetNewLIs.push_back(LI);
|
RetNewLIs.push_back(LI);
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ VirtRegMap::VirtRegMap(MachineFunction &mf)
|
|||||||
: TII(*mf.getTarget().getInstrInfo()), MF(mf),
|
: TII(*mf.getTarget().getInstrInfo()), MF(mf),
|
||||||
Virt2PhysMap(NO_PHYS_REG), Virt2StackSlotMap(NO_STACK_SLOT),
|
Virt2PhysMap(NO_PHYS_REG), Virt2StackSlotMap(NO_STACK_SLOT),
|
||||||
Virt2ReMatIdMap(NO_STACK_SLOT), Virt2SplitMap(0),
|
Virt2ReMatIdMap(NO_STACK_SLOT), Virt2SplitMap(0),
|
||||||
ReMatMap(NULL), ReMatId(MAX_STACK_SLOT+1) {
|
Virt2SplitKillMap(NULL), ReMatMap(NULL), ReMatId(MAX_STACK_SLOT+1) {
|
||||||
grow();
|
grow();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,6 +74,7 @@ void VirtRegMap::grow() {
|
|||||||
Virt2StackSlotMap.grow(LastVirtReg);
|
Virt2StackSlotMap.grow(LastVirtReg);
|
||||||
Virt2ReMatIdMap.grow(LastVirtReg);
|
Virt2ReMatIdMap.grow(LastVirtReg);
|
||||||
Virt2SplitMap.grow(LastVirtReg);
|
Virt2SplitMap.grow(LastVirtReg);
|
||||||
|
Virt2SplitKillMap.grow(LastVirtReg);
|
||||||
ReMatMap.grow(LastVirtReg);
|
ReMatMap.grow(LastVirtReg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,6 +66,10 @@ namespace llvm {
|
|||||||
/// mapping.
|
/// mapping.
|
||||||
IndexedMap<unsigned, VirtReg2IndexFunctor> Virt2SplitMap;
|
IndexedMap<unsigned, VirtReg2IndexFunctor> Virt2SplitMap;
|
||||||
|
|
||||||
|
/// Virt2SplitKillMap - This is splitted virtual register to its last use
|
||||||
|
/// (kill) mapping.
|
||||||
|
IndexedMap<MachineOperand*> Virt2SplitKillMap;
|
||||||
|
|
||||||
/// ReMatMap - This is virtual register to re-materialized instruction
|
/// ReMatMap - This is virtual register to re-materialized instruction
|
||||||
/// mapping. Each virtual register whose definition is going to be
|
/// mapping. Each virtual register whose definition is going to be
|
||||||
/// re-materialized has an entry in it.
|
/// re-materialized has an entry in it.
|
||||||
@ -210,6 +214,21 @@ namespace llvm {
|
|||||||
ReMatMap[virtReg] = def;
|
ReMatMap[virtReg] = def;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// @brief record the last use (kill) of a split virtual register.
|
||||||
|
void addKillPoint(unsigned virtReg, MachineOperand *Op) {
|
||||||
|
Virt2SplitKillMap[virtReg] = Op;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @brief reset and remove the last use (kill) of a split virtual register.
|
||||||
|
void removeKillPoint(unsigned virtReg) {
|
||||||
|
MachineOperand *MO = Virt2SplitKillMap[virtReg];
|
||||||
|
if (MO) {
|
||||||
|
assert(MO->isKill() && "Split last use is not marked kill?");
|
||||||
|
MO->unsetIsKill();
|
||||||
|
Virt2SplitKillMap[virtReg] = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// @brief returns true if the specified MachineInstr is a spill point.
|
/// @brief returns true if the specified MachineInstr is a spill point.
|
||||||
bool isSpillPt(MachineInstr *Pt) const {
|
bool isSpillPt(MachineInstr *Pt) const {
|
||||||
return SpillPt2VirtMap.find(Pt) != SpillPt2VirtMap.end();
|
return SpillPt2VirtMap.find(Pt) != SpillPt2VirtMap.end();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user