@@ -58,25 +58,14 @@ bool VirtRegMap::runOnMachineFunction(MachineFunction &mf) {
58
58
TRI = mf.getTarget ().getRegisterInfo ();
59
59
MF = &mf;
60
60
61
- ReMatId = MAX_STACK_SLOT+1 ;
62
61
LowSpillSlot = HighSpillSlot = NO_STACK_SLOT;
63
62
64
63
Virt2PhysMap.clear ();
65
64
Virt2StackSlotMap.clear ();
66
- Virt2ReMatIdMap.clear ();
67
65
Virt2SplitMap.clear ();
68
- Virt2SplitKillMap.clear ();
69
- ReMatMap.clear ();
70
- ImplicitDefed.clear ();
71
66
SpillSlotToUsesMap.clear ();
72
- MI2VirtMap.clear ();
73
- SpillPt2VirtMap.clear ();
74
- RestorePt2VirtMap.clear ();
75
- EmergencySpillMap.clear ();
76
- EmergencySpillSlots.clear ();
77
67
78
68
SpillSlotToUsesMap.resize (8 );
79
- ImplicitDefed.resize (MF->getRegInfo ().getNumVirtRegs ());
80
69
81
70
allocatableRCRegs.clear ();
82
71
for (TargetRegisterInfo::regclass_iterator I = TRI->regclass_begin (),
@@ -93,11 +82,7 @@ void VirtRegMap::grow() {
93
82
unsigned NumRegs = MF->getRegInfo ().getNumVirtRegs ();
94
83
Virt2PhysMap.resize (NumRegs);
95
84
Virt2StackSlotMap.resize (NumRegs);
96
- Virt2ReMatIdMap.resize (NumRegs);
97
85
Virt2SplitMap.resize (NumRegs);
98
- Virt2SplitKillMap.resize (NumRegs);
99
- ReMatMap.resize (NumRegs);
100
- ImplicitDefed.resize (NumRegs);
101
86
}
102
87
103
88
unsigned VirtRegMap::createSpillSlot (const TargetRegisterClass *RC) {
@@ -144,29 +129,6 @@ void VirtRegMap::assignVirt2StackSlot(unsigned virtReg, int SS) {
144
129
Virt2StackSlotMap[virtReg] = SS;
145
130
}
146
131
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
-
170
132
void VirtRegMap::addSpillSlotUse (int FI, MachineInstr *MI) {
171
133
if (!MF->getFrameInfo ()->isFixedObjectIndex (FI)) {
172
134
// If FI < LowSpillSlot, this stack reference was produced by
@@ -180,25 +142,6 @@ void VirtRegMap::addSpillSlotUse(int FI, MachineInstr *MI) {
180
142
}
181
143
}
182
144
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
-
202
145
void VirtRegMap::RemoveMachineInstrFromMaps (MachineInstr *MI) {
203
146
for (unsigned i = 0 , e = MI->getNumOperands (); i != e; ++i) {
204
147
MachineOperand &MO = MI->getOperand (i);
@@ -215,10 +158,6 @@ void VirtRegMap::RemoveMachineInstrFromMaps(MachineInstr *MI) {
215
158
&& " Invalid spill slot" );
216
159
SpillSlotToUsesMap[FI-LowSpillSlot].erase (MI);
217
160
}
218
- MI2VirtMap.erase (MI);
219
- SpillPt2VirtMap.erase (MI);
220
- RestorePt2VirtMap.erase (MI);
221
- EmergencySpillMap.erase (MI);
222
161
}
223
162
224
163
void VirtRegMap::rewrite (SlotIndexes *Indexes) {
0 commit comments