@@ -105,8 +105,7 @@ class LiveVariables : public MachineFunctionPass {
105
105
// / isLiveIn - Is Reg live in to MBB? This means that Reg is live through
106
106
// / MBB, or it is killed in MBB. If Reg is only used by PHI instructions in
107
107
// / MBB, it is not considered live in.
108
- bool isLiveIn (const MachineBasicBlock &MBB,
109
- unsigned Reg,
108
+ bool isLiveIn (const MachineBasicBlock &MBB, Register Reg,
110
109
MachineRegisterInfo &MRI);
111
110
112
111
void dump () const ;
@@ -149,25 +148,25 @@ class LiveVariables : public MachineFunctionPass {
149
148
// / HandlePhysRegKill - Add kills of Reg and its sub-registers to the
150
149
// / uses. Pay special attention to the sub-register uses which may come below
151
150
// / the last use of the whole register.
152
- bool HandlePhysRegKill (unsigned Reg, MachineInstr *MI);
151
+ bool HandlePhysRegKill (Register Reg, MachineInstr *MI);
153
152
154
153
// / HandleRegMask - Call HandlePhysRegKill for all registers clobbered by Mask.
155
154
void HandleRegMask (const MachineOperand&);
156
155
157
- void HandlePhysRegUse (unsigned Reg, MachineInstr &MI);
158
- void HandlePhysRegDef (unsigned Reg, MachineInstr *MI,
156
+ void HandlePhysRegUse (Register Reg, MachineInstr &MI);
157
+ void HandlePhysRegDef (Register Reg, MachineInstr *MI,
159
158
SmallVectorImpl<unsigned > &Defs);
160
159
void UpdatePhysRegDefs (MachineInstr &MI, SmallVectorImpl<unsigned > &Defs);
161
160
162
161
// / FindLastRefOrPartRef - Return the last reference or partial reference of
163
162
// / the specified register.
164
- MachineInstr *FindLastRefOrPartRef (unsigned Reg);
163
+ MachineInstr *FindLastRefOrPartRef (Register Reg);
165
164
166
165
// / FindLastPartialDef - Return the last partial def of the specified
167
166
// / register. Also returns the sub-registers that're defined by the
168
167
// / instruction.
169
- MachineInstr *FindLastPartialDef (unsigned Reg,
170
- SmallSet<unsigned ,4 > &PartDefRegs);
168
+ MachineInstr *FindLastPartialDef (Register Reg,
169
+ SmallSet<unsigned , 4 > &PartDefRegs);
171
170
172
171
// / analyzePHINodes - Gather information about the PHI nodes in here. In
173
172
// / particular, we want to map the variable information of a virtual
@@ -184,21 +183,21 @@ class LiveVariables : public MachineFunctionPass {
184
183
185
184
// / RegisterDefIsDead - Return true if the specified instruction defines the
186
185
// / specified register, but that definition is dead.
187
- bool RegisterDefIsDead (MachineInstr &MI, unsigned Reg) const ;
186
+ bool RegisterDefIsDead (MachineInstr &MI, Register Reg) const ;
188
187
189
188
// ===--------------------------------------------------------------------===//
190
189
// API to update live variable information
191
190
192
191
// / replaceKillInstruction - Update register kill info by replacing a kill
193
192
// / instruction with a new one.
194
- void replaceKillInstruction (unsigned Reg, MachineInstr &OldMI,
193
+ void replaceKillInstruction (Register Reg, MachineInstr &OldMI,
195
194
MachineInstr &NewMI);
196
195
197
196
// / addVirtualRegisterKilled - Add information about the fact that the
198
197
// / specified register is killed after being used by the specified
199
198
// / instruction. If AddIfNotFound is true, add a implicit operand if it's
200
199
// / not found.
201
- void addVirtualRegisterKilled (unsigned IncomingReg, MachineInstr &MI,
200
+ void addVirtualRegisterKilled (Register IncomingReg, MachineInstr &MI,
202
201
bool AddIfNotFound = false ) {
203
202
if (MI.addRegisterKilled (IncomingReg, TRI, AddIfNotFound))
204
203
getVarInfo (IncomingReg).Kills .push_back (&MI);
@@ -208,14 +207,14 @@ class LiveVariables : public MachineFunctionPass {
208
207
// / register from the live variable information. Returns true if the
209
208
// / variable was marked as killed by the specified instruction,
210
209
// / false otherwise.
211
- bool removeVirtualRegisterKilled (unsigned reg , MachineInstr &MI) {
212
- if (!getVarInfo (reg ).removeKill (MI))
210
+ bool removeVirtualRegisterKilled (Register Reg , MachineInstr &MI) {
211
+ if (!getVarInfo (Reg ).removeKill (MI))
213
212
return false ;
214
213
215
214
bool Removed = false ;
216
215
for (unsigned i = 0 , e = MI.getNumOperands (); i != e; ++i) {
217
216
MachineOperand &MO = MI.getOperand (i);
218
- if (MO.isReg () && MO.isKill () && MO.getReg () == reg ) {
217
+ if (MO.isReg () && MO.isKill () && MO.getReg () == Reg ) {
219
218
MO.setIsKill (false );
220
219
Removed = true ;
221
220
break ;
@@ -234,7 +233,7 @@ class LiveVariables : public MachineFunctionPass {
234
233
// / addVirtualRegisterDead - Add information about the fact that the specified
235
234
// / register is dead after being used by the specified instruction. If
236
235
// / AddIfNotFound is true, add a implicit operand if it's not found.
237
- void addVirtualRegisterDead (unsigned IncomingReg, MachineInstr &MI,
236
+ void addVirtualRegisterDead (Register IncomingReg, MachineInstr &MI,
238
237
bool AddIfNotFound = false ) {
239
238
if (MI.addRegisterDead (IncomingReg, TRI, AddIfNotFound))
240
239
getVarInfo (IncomingReg).Kills .push_back (&MI);
@@ -244,14 +243,14 @@ class LiveVariables : public MachineFunctionPass {
244
243
// / register from the live variable information. Returns true if the
245
244
// / variable was marked dead at the specified instruction, false
246
245
// / otherwise.
247
- bool removeVirtualRegisterDead (unsigned reg , MachineInstr &MI) {
248
- if (!getVarInfo (reg ).removeKill (MI))
246
+ bool removeVirtualRegisterDead (Register Reg , MachineInstr &MI) {
247
+ if (!getVarInfo (Reg ).removeKill (MI))
249
248
return false ;
250
249
251
250
bool Removed = false ;
252
251
for (unsigned i = 0 , e = MI.getNumOperands (); i != e; ++i) {
253
252
MachineOperand &MO = MI.getOperand (i);
254
- if (MO.isReg () && MO.isDef () && MO.getReg () == reg ) {
253
+ if (MO.isReg () && MO.isDef () && MO.getReg () == Reg ) {
255
254
MO.setIsDead (false );
256
255
Removed = true ;
257
256
break ;
@@ -270,25 +269,25 @@ class LiveVariables : public MachineFunctionPass {
270
269
271
270
// / getVarInfo - Return the VarInfo structure for the specified VIRTUAL
272
271
// / register.
273
- VarInfo &getVarInfo (unsigned RegIdx );
272
+ VarInfo &getVarInfo (Register Reg );
274
273
275
274
void MarkVirtRegAliveInBlock (VarInfo& VRInfo, MachineBasicBlock* DefBlock,
276
275
MachineBasicBlock *BB);
277
276
void MarkVirtRegAliveInBlock (VarInfo &VRInfo, MachineBasicBlock *DefBlock,
278
277
MachineBasicBlock *BB,
279
278
SmallVectorImpl<MachineBasicBlock *> &WorkList);
280
279
281
- void HandleVirtRegDef (unsigned reg, MachineInstr &MI);
282
- void HandleVirtRegUse (unsigned reg, MachineBasicBlock *MBB, MachineInstr &MI);
280
+ void HandleVirtRegDef (Register reg, MachineInstr &MI);
281
+ void HandleVirtRegUse (Register reg, MachineBasicBlock *MBB, MachineInstr &MI);
283
282
284
- bool isLiveIn (unsigned Reg, const MachineBasicBlock &MBB) {
283
+ bool isLiveIn (Register Reg, const MachineBasicBlock &MBB) {
285
284
return getVarInfo (Reg).isLiveIn (MBB, Reg, *MRI);
286
285
}
287
286
288
287
// / isLiveOut - Determine if Reg is live out from MBB, when not considering
289
288
// / PHI nodes. This means that Reg is either killed by a successor block or
290
289
// / passed through one.
291
- bool isLiveOut (unsigned Reg, const MachineBasicBlock &MBB);
290
+ bool isLiveOut (Register Reg, const MachineBasicBlock &MBB);
292
291
293
292
// / addNewBlock - Add a new basic block BB between DomBB and SuccBB. All
294
293
// / variables that are live out of DomBB and live into SuccBB will be marked
@@ -304,10 +303,10 @@ class LiveVariables : public MachineFunctionPass {
304
303
std::vector<SparseBitVector<>> &LiveInSets);
305
304
306
305
// / isPHIJoin - Return true if Reg is a phi join register.
307
- bool isPHIJoin (unsigned Reg) { return PHIJoins.test (Reg); }
306
+ bool isPHIJoin (Register Reg) { return PHIJoins.test (Reg. id () ); }
308
307
309
308
// / setPHIJoin - Mark Reg as a phi join register.
310
- void setPHIJoin (unsigned Reg) { PHIJoins.set (Reg); }
309
+ void setPHIJoin (Register Reg) { PHIJoins.set (Reg. id () ); }
311
310
};
312
311
313
312
} // End llvm namespace
0 commit comments