Clean up sub-register implementation by moving subReg information back to

MachineOperand auxInfo. Previous clunky implementation uses an external map
to track sub-register uses. That works because register allocator uses
a new virtual register for each spilled use. With interval splitting (coming
soon), we may have multiple uses of the same register some of which are
of using different sub-registers from others. It's too fragile to constantly
update the information.

llvm-svn: 44104
This commit is contained in:
Evan Cheng
2007-11-14 07:59:08 +00:00
parent 9c30fc234c
commit 7f02cfa599
9 changed files with 53 additions and 63 deletions

View File

@@ -670,12 +670,8 @@ rewriteInstructionForSpills(const LiveInterval &li,
unsigned RegI = Reg;
if (Reg == 0 || MRegisterInfo::isPhysicalRegister(Reg))
continue;
bool isSubReg = RegMap->isSubRegister(Reg);
unsigned SubIdx = 0;
if (isSubReg) {
SubIdx = RegMap->getSubRegisterIndex(Reg);
Reg = RegMap->getSuperRegister(Reg);
}
unsigned SubIdx = mop.getSubReg();
bool isSubReg = SubIdx != 0;
if (Reg != li.reg)
continue;
@@ -710,8 +706,6 @@ rewriteInstructionForSpills(const LiveInterval &li,
// Create a new virtual register for the spill interval.
unsigned NewVReg = RegMap->createVirtualRegister(rc);
vrm.grow();
if (isSubReg)
RegMap->setIsSubRegister(NewVReg, NewVReg, SubIdx);
// Scan all of the operands of this instruction rewriting operands
// to use NewVReg instead of li.reg as appropriate. We do this for