mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 04:24:00 +00:00
Track new virtual registers by register number.
Track new virtual registers by register number, rather than by the live interval created for them. This is the first step in separating the creation of new virtual registers and new live intervals. Eventually live intervals will be created and populated on demand after the virtual registers have been created and used in instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188434 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -131,7 +131,8 @@ class UserValue {
|
||||
|
||||
/// splitLocation - Replace OldLocNo ranges with NewRegs ranges where NewRegs
|
||||
/// is live. Returns true if any changes were made.
|
||||
bool splitLocation(unsigned OldLocNo, ArrayRef<LiveInterval*> NewRegs);
|
||||
bool splitLocation(unsigned OldLocNo, ArrayRef<unsigned> NewRegs,
|
||||
LiveIntervals &LIS);
|
||||
|
||||
public:
|
||||
/// UserValue - Create a new UserValue.
|
||||
@ -251,7 +252,8 @@ public:
|
||||
|
||||
/// splitRegister - Replace OldReg ranges with NewRegs ranges where NewRegs is
|
||||
/// live. Returns true if any changes were made.
|
||||
bool splitRegister(unsigned OldLocNo, ArrayRef<LiveInterval*> NewRegs);
|
||||
bool splitRegister(unsigned OldLocNo, ArrayRef<unsigned> NewRegs,
|
||||
LiveIntervals &LIS);
|
||||
|
||||
/// rewriteLocations - Rewrite virtual register locations according to the
|
||||
/// provided virtual register map.
|
||||
@ -345,7 +347,7 @@ public:
|
||||
void mapVirtReg(unsigned VirtReg, UserValue *EC);
|
||||
|
||||
/// splitRegister - Replace all references to OldReg with NewRegs.
|
||||
void splitRegister(unsigned OldReg, ArrayRef<LiveInterval*> NewRegs);
|
||||
void splitRegister(unsigned OldReg, ArrayRef<unsigned> NewRegs);
|
||||
|
||||
/// emitDebugValues - Recreate DBG_VALUE instruction from data structures.
|
||||
void emitDebugValues(VirtRegMap *VRM);
|
||||
@ -729,7 +731,8 @@ LiveDebugVariables::~LiveDebugVariables() {
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
bool
|
||||
UserValue::splitLocation(unsigned OldLocNo, ArrayRef<LiveInterval*> NewRegs) {
|
||||
UserValue::splitLocation(unsigned OldLocNo, ArrayRef<unsigned> NewRegs,
|
||||
LiveIntervals& LIS) {
|
||||
DEBUG({
|
||||
dbgs() << "Splitting Loc" << OldLocNo << '\t';
|
||||
print(dbgs(), 0);
|
||||
@ -738,7 +741,7 @@ UserValue::splitLocation(unsigned OldLocNo, ArrayRef<LiveInterval*> NewRegs) {
|
||||
LocMap::iterator LocMapI;
|
||||
LocMapI.setMap(locInts);
|
||||
for (unsigned i = 0; i != NewRegs.size(); ++i) {
|
||||
LiveInterval *LI = NewRegs[i];
|
||||
LiveInterval *LI = &LIS.getInterval(NewRegs[i]);
|
||||
if (LI->empty())
|
||||
continue;
|
||||
|
||||
@ -827,7 +830,8 @@ UserValue::splitLocation(unsigned OldLocNo, ArrayRef<LiveInterval*> NewRegs) {
|
||||
}
|
||||
|
||||
bool
|
||||
UserValue::splitRegister(unsigned OldReg, ArrayRef<LiveInterval*> NewRegs) {
|
||||
UserValue::splitRegister(unsigned OldReg, ArrayRef<unsigned> NewRegs,
|
||||
LiveIntervals &LIS) {
|
||||
bool DidChange = false;
|
||||
// Split locations referring to OldReg. Iterate backwards so splitLocation can
|
||||
// safely erase unused locations.
|
||||
@ -836,15 +840,15 @@ UserValue::splitRegister(unsigned OldReg, ArrayRef<LiveInterval*> NewRegs) {
|
||||
const MachineOperand *Loc = &locations[LocNo];
|
||||
if (!Loc->isReg() || Loc->getReg() != OldReg)
|
||||
continue;
|
||||
DidChange |= splitLocation(LocNo, NewRegs);
|
||||
DidChange |= splitLocation(LocNo, NewRegs, LIS);
|
||||
}
|
||||
return DidChange;
|
||||
}
|
||||
|
||||
void LDVImpl::splitRegister(unsigned OldReg, ArrayRef<LiveInterval*> NewRegs) {
|
||||
void LDVImpl::splitRegister(unsigned OldReg, ArrayRef<unsigned> NewRegs) {
|
||||
bool DidChange = false;
|
||||
for (UserValue *UV = lookupVirtReg(OldReg); UV; UV = UV->getNext())
|
||||
DidChange |= UV->splitRegister(OldReg, NewRegs);
|
||||
DidChange |= UV->splitRegister(OldReg, NewRegs, *LIS);
|
||||
|
||||
if (!DidChange)
|
||||
return;
|
||||
@ -852,11 +856,11 @@ void LDVImpl::splitRegister(unsigned OldReg, ArrayRef<LiveInterval*> NewRegs) {
|
||||
// Map all of the new virtual registers.
|
||||
UserValue *UV = lookupVirtReg(OldReg);
|
||||
for (unsigned i = 0; i != NewRegs.size(); ++i)
|
||||
mapVirtReg(NewRegs[i]->reg, UV);
|
||||
mapVirtReg(NewRegs[i], UV);
|
||||
}
|
||||
|
||||
void LiveDebugVariables::
|
||||
splitRegister(unsigned OldReg, ArrayRef<LiveInterval*> NewRegs) {
|
||||
splitRegister(unsigned OldReg, ArrayRef<unsigned> NewRegs, LiveIntervals &LIS) {
|
||||
if (pImpl)
|
||||
static_cast<LDVImpl*>(pImpl)->splitRegister(OldReg, NewRegs);
|
||||
}
|
||||
|
Reference in New Issue
Block a user