mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
Remove MachineRegisterInfo::getLastVirtReg(), it was giving wrong results
when no virtual registers have been allocated. It was only used to resize IndexedMaps, so provide an IndexedMap::resize() method such that Map.grow(MRI.getLastVirtReg()); can be replaced with the simpler Map.resize(MRI.getNumVirtRegs()); This works correctly when no virtuals are allocated, and it bypasses the to/from index conversions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123130 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -88,14 +88,14 @@ bool VirtRegMap::runOnMachineFunction(MachineFunction &mf) {
|
||||
}
|
||||
|
||||
void VirtRegMap::grow() {
|
||||
unsigned LastVirtReg = MF->getRegInfo().getLastVirtReg();
|
||||
Virt2PhysMap.grow(LastVirtReg);
|
||||
Virt2StackSlotMap.grow(LastVirtReg);
|
||||
Virt2ReMatIdMap.grow(LastVirtReg);
|
||||
Virt2SplitMap.grow(LastVirtReg);
|
||||
Virt2SplitKillMap.grow(LastVirtReg);
|
||||
ReMatMap.grow(LastVirtReg);
|
||||
ImplicitDefed.resize(MF->getRegInfo().getNumVirtRegs());
|
||||
unsigned NumRegs = MF->getRegInfo().getNumVirtRegs();
|
||||
Virt2PhysMap.resize(NumRegs);
|
||||
Virt2StackSlotMap.resize(NumRegs);
|
||||
Virt2ReMatIdMap.resize(NumRegs);
|
||||
Virt2SplitMap.resize(NumRegs);
|
||||
Virt2SplitKillMap.resize(NumRegs);
|
||||
ReMatMap.resize(NumRegs);
|
||||
ImplicitDefed.resize(NumRegs);
|
||||
}
|
||||
|
||||
unsigned VirtRegMap::createSpillSlot(const TargetRegisterClass *RC) {
|
||||
|
||||
Reference in New Issue
Block a user