mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-02 19:24:25 +00:00
Represent RegUnit liveness with LiveRange instance
Previously LiveInterval has been used, but having a spill weight and register number is unnecessary for a register unit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192397 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -147,7 +147,7 @@ void RegionPressure::openBottom(MachineBasicBlock::const_iterator PrevBottom) {
|
||||
LiveInRegs.clear();
|
||||
}
|
||||
|
||||
const LiveInterval *RegPressureTracker::getInterval(unsigned Reg) const {
|
||||
const LiveRange *RegPressureTracker::getLiveRange(unsigned Reg) const {
|
||||
if (TargetRegisterInfo::isVirtualRegister(Reg))
|
||||
return &LIS->getInterval(Reg);
|
||||
return LIS->getCachedRegUnit(Reg);
|
||||
@ -510,10 +510,9 @@ bool RegPressureTracker::recede(SmallVectorImpl<unsigned> *LiveUses,
|
||||
if (!LiveRegs.contains(Reg)) {
|
||||
// Adjust liveouts if LiveIntervals are available.
|
||||
if (RequireIntervals) {
|
||||
const LiveInterval *LI = getInterval(Reg);
|
||||
// Check if this LR is killed and not redefined here.
|
||||
if (LI) {
|
||||
LiveQueryResult LRQ = LI->Query(SlotIdx);
|
||||
const LiveRange *LR = getLiveRange(Reg);
|
||||
if (LR) {
|
||||
LiveQueryResult LRQ = LR->Query(SlotIdx);
|
||||
if (!LRQ.isKill() && !LRQ.valueDefined())
|
||||
discoverLiveOut(Reg);
|
||||
}
|
||||
@ -570,8 +569,8 @@ bool RegPressureTracker::advance() {
|
||||
// Kill liveness at last uses.
|
||||
bool lastUse = false;
|
||||
if (RequireIntervals) {
|
||||
const LiveInterval *LI = getInterval(Reg);
|
||||
lastUse = LI && LI->Query(SlotIdx).isKill();
|
||||
const LiveRange *LR = getLiveRange(Reg);
|
||||
lastUse = LR && LR->Query(SlotIdx).isKill();
|
||||
}
|
||||
else {
|
||||
// Allocatable physregs are always single-use before register rewriting.
|
||||
@ -894,11 +893,12 @@ void RegPressureTracker::bumpDownwardPressure(const MachineInstr *MI) {
|
||||
// FIXME: allow the caller to pass in the list of vreg uses that remain
|
||||
// to be bottom-scheduled to avoid searching uses at each query.
|
||||
SlotIndex CurrIdx = getCurrSlot();
|
||||
const LiveInterval *LI = getInterval(Reg);
|
||||
if (LI) {
|
||||
LiveQueryResult LRQ = LI->Query(SlotIdx);
|
||||
if (LRQ.isKill() && !findUseBetween(Reg, CurrIdx, SlotIdx, MRI, LIS))
|
||||
const LiveRange *LR = getLiveRange(Reg);
|
||||
if (LR) {
|
||||
LiveQueryResult LRQ = LR->Query(SlotIdx);
|
||||
if (LRQ.isKill() && !findUseBetween(Reg, CurrIdx, SlotIdx, MRI, LIS)) {
|
||||
decreaseRegPressure(Reg);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!TargetRegisterInfo::isVirtualRegister(Reg)) {
|
||||
|
Reference in New Issue
Block a user