mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-03 13:31:05 +00:00
Add a helper for constructing new live ranges that ended from an instruction to the end of its MBB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52012 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4e16d4000b
commit
c4dc132c8a
@ -220,6 +220,11 @@ namespace llvm {
|
||||
I = r2iMap_.insert(I, std::make_pair(reg, createInterval(reg)));
|
||||
return I->second;
|
||||
}
|
||||
|
||||
/// addLiveRangeToEndOfBlock - Given a register and an instruction,
|
||||
/// adds a live range from that instruction to the end of its MBB.
|
||||
LiveRange addLiveRangeToEndOfBlock(unsigned reg,
|
||||
MachineInstr* startInst);
|
||||
|
||||
// Interval removal
|
||||
|
||||
|
@ -1830,3 +1830,18 @@ void LiveIntervals::spillPhysRegAroundRegDefsUses(const LiveInterval &li,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LiveRange LiveIntervals::addLiveRangeToEndOfBlock(unsigned reg,
|
||||
MachineInstr* startInst) {
|
||||
LiveInterval& Interval = getOrCreateInterval(reg);
|
||||
VNInfo* VN = Interval.getNextValue(
|
||||
getInstructionIndex(startInst) + InstrSlots::DEF,
|
||||
startInst, getVNInfoAllocator());
|
||||
VN->hasPHIKill = true;
|
||||
VN->kills.push_back(getMBBEndIdx(startInst->getParent()));
|
||||
LiveRange LR(getInstructionIndex(startInst) + InstrSlots::DEF,
|
||||
getMBBEndIdx(startInst->getParent()) + 1, VN);
|
||||
Interval.addRange(LR);
|
||||
|
||||
return LR;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user