Skip to content

Commit 92255f2

Browse files
committed
Remove dead code and data from VirtRegMap.
Most of this stuff was supporting the old deferred spill code insertion mechanism. Modern spillers just edit machine code in place. llvm-svn: 144484
1 parent fcc764d commit 92255f2

File tree

2 files changed

+2
-324
lines changed

2 files changed

+2
-324
lines changed

llvm/lib/CodeGen/VirtRegMap.cpp

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -58,25 +58,14 @@ bool VirtRegMap::runOnMachineFunction(MachineFunction &mf) {
5858
TRI = mf.getTarget().getRegisterInfo();
5959
MF = &mf;
6060

61-
ReMatId = MAX_STACK_SLOT+1;
6261
LowSpillSlot = HighSpillSlot = NO_STACK_SLOT;
6362

6463
Virt2PhysMap.clear();
6564
Virt2StackSlotMap.clear();
66-
Virt2ReMatIdMap.clear();
6765
Virt2SplitMap.clear();
68-
Virt2SplitKillMap.clear();
69-
ReMatMap.clear();
70-
ImplicitDefed.clear();
7166
SpillSlotToUsesMap.clear();
72-
MI2VirtMap.clear();
73-
SpillPt2VirtMap.clear();
74-
RestorePt2VirtMap.clear();
75-
EmergencySpillMap.clear();
76-
EmergencySpillSlots.clear();
7767

7868
SpillSlotToUsesMap.resize(8);
79-
ImplicitDefed.resize(MF->getRegInfo().getNumVirtRegs());
8069

8170
allocatableRCRegs.clear();
8271
for (TargetRegisterInfo::regclass_iterator I = TRI->regclass_begin(),
@@ -93,11 +82,7 @@ void VirtRegMap::grow() {
9382
unsigned NumRegs = MF->getRegInfo().getNumVirtRegs();
9483
Virt2PhysMap.resize(NumRegs);
9584
Virt2StackSlotMap.resize(NumRegs);
96-
Virt2ReMatIdMap.resize(NumRegs);
9785
Virt2SplitMap.resize(NumRegs);
98-
Virt2SplitKillMap.resize(NumRegs);
99-
ReMatMap.resize(NumRegs);
100-
ImplicitDefed.resize(NumRegs);
10186
}
10287

10388
unsigned VirtRegMap::createSpillSlot(const TargetRegisterClass *RC) {
@@ -144,29 +129,6 @@ void VirtRegMap::assignVirt2StackSlot(unsigned virtReg, int SS) {
144129
Virt2StackSlotMap[virtReg] = SS;
145130
}
146131

147-
int VirtRegMap::assignVirtReMatId(unsigned virtReg) {
148-
assert(TargetRegisterInfo::isVirtualRegister(virtReg));
149-
assert(Virt2ReMatIdMap[virtReg] == NO_STACK_SLOT &&
150-
"attempt to assign re-mat id to already spilled register");
151-
Virt2ReMatIdMap[virtReg] = ReMatId;
152-
return ReMatId++;
153-
}
154-
155-
void VirtRegMap::assignVirtReMatId(unsigned virtReg, int id) {
156-
assert(TargetRegisterInfo::isVirtualRegister(virtReg));
157-
assert(Virt2ReMatIdMap[virtReg] == NO_STACK_SLOT &&
158-
"attempt to assign re-mat id to already spilled register");
159-
Virt2ReMatIdMap[virtReg] = id;
160-
}
161-
162-
int VirtRegMap::getEmergencySpillSlot(const TargetRegisterClass *RC) {
163-
std::map<const TargetRegisterClass*, int>::iterator I =
164-
EmergencySpillSlots.find(RC);
165-
if (I != EmergencySpillSlots.end())
166-
return I->second;
167-
return EmergencySpillSlots[RC] = createSpillSlot(RC);
168-
}
169-
170132
void VirtRegMap::addSpillSlotUse(int FI, MachineInstr *MI) {
171133
if (!MF->getFrameInfo()->isFixedObjectIndex(FI)) {
172134
// If FI < LowSpillSlot, this stack reference was produced by
@@ -180,25 +142,6 @@ void VirtRegMap::addSpillSlotUse(int FI, MachineInstr *MI) {
180142
}
181143
}
182144

183-
void VirtRegMap::virtFolded(unsigned VirtReg, MachineInstr *OldMI,
184-
MachineInstr *NewMI, ModRef MRInfo) {
185-
// Move previous memory references folded to new instruction.
186-
MI2VirtMapTy::iterator IP = MI2VirtMap.lower_bound(NewMI);
187-
for (MI2VirtMapTy::iterator I = MI2VirtMap.lower_bound(OldMI),
188-
E = MI2VirtMap.end(); I != E && I->first == OldMI; ) {
189-
MI2VirtMap.insert(IP, std::make_pair(NewMI, I->second));
190-
MI2VirtMap.erase(I++);
191-
}
192-
193-
// add new memory reference
194-
MI2VirtMap.insert(IP, std::make_pair(NewMI, std::make_pair(VirtReg, MRInfo)));
195-
}
196-
197-
void VirtRegMap::virtFolded(unsigned VirtReg, MachineInstr *MI, ModRef MRInfo) {
198-
MI2VirtMapTy::iterator IP = MI2VirtMap.lower_bound(MI);
199-
MI2VirtMap.insert(IP, std::make_pair(MI, std::make_pair(VirtReg, MRInfo)));
200-
}
201-
202145
void VirtRegMap::RemoveMachineInstrFromMaps(MachineInstr *MI) {
203146
for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
204147
MachineOperand &MO = MI->getOperand(i);
@@ -215,10 +158,6 @@ void VirtRegMap::RemoveMachineInstrFromMaps(MachineInstr *MI) {
215158
&& "Invalid spill slot");
216159
SpillSlotToUsesMap[FI-LowSpillSlot].erase(MI);
217160
}
218-
MI2VirtMap.erase(MI);
219-
SpillPt2VirtMap.erase(MI);
220-
RestorePt2VirtMap.erase(MI);
221-
EmergencySpillMap.erase(MI);
222161
}
223162

224163
void VirtRegMap::rewrite(SlotIndexes *Indexes) {

0 commit comments

Comments
 (0)