@@ -143,7 +143,7 @@ namespace {
143
143
// / To avoid repeatedly merging sets of DbgValueLocs, instead record
144
144
// / which vregs have been coalesced, and where to. This map is from
145
145
// / vreg => {set of vregs merged in}.
146
- DenseMap<Register, SmallVector<unsigned , 4 >> DbgMergedVRegNums;
146
+ DenseMap<Register, SmallVector<Register , 4 >> DbgMergedVRegNums;
147
147
148
148
// / A LaneMask to remember on which subregister live ranges we need to call
149
149
// / shrinkToUses() later.
@@ -178,11 +178,11 @@ namespace {
178
178
// / The collection of live intervals which should have been updated
179
179
// / immediately after rematerialiation but delayed until
180
180
// / lateLiveIntervalUpdate is called.
181
- DenseSet<unsigned > ToBeUpdated;
181
+ DenseSet<Register > ToBeUpdated;
182
182
183
183
// / Record how many times the large live interval with many valnos
184
184
// / has been tried to join with other live interval.
185
- DenseMap<unsigned , unsigned long > LargeLIVisitCounter;
185
+ DenseMap<Register , unsigned long > LargeLIVisitCounter;
186
186
187
187
// / Recursively eliminate dead defs in DeadDefs.
188
188
void eliminateDeadDefs ();
@@ -424,7 +424,7 @@ static bool isSplitEdge(const MachineBasicBlock *MBB) {
424
424
}
425
425
426
426
bool CoalescerPair::setRegisters (const MachineInstr *MI) {
427
- SrcReg = DstReg = 0 ;
427
+ SrcReg = DstReg = Register () ;
428
428
SrcIdx = DstIdx = 0 ;
429
429
NewRC = nullptr ;
430
430
Flipped = CrossClass = false ;
@@ -1231,8 +1231,8 @@ bool RegisterCoalescer::removePartialRedundancy(const CoalescerPair &CP,
1231
1231
// / Returns true if @p MI defines the full vreg @p Reg, as opposed to just
1232
1232
// / defining a subregister.
1233
1233
static bool definesFullReg (const MachineInstr &MI, Register Reg) {
1234
- assert (!Register::isPhysicalRegister ( Reg) &&
1235
- " This code cannot handle physreg aliasing " );
1234
+ assert (!Reg. isPhysical ( ) && " This code cannot handle physreg aliasing " );
1235
+
1236
1236
for (const MachineOperand &Op : MI.operands ()) {
1237
1237
if (!Op.isReg () || !Op.isDef () || Op.getReg () != Reg)
1238
1238
continue ;
@@ -1297,7 +1297,7 @@ bool RegisterCoalescer::reMaterializeTrivialDef(const CoalescerPair &CP,
1297
1297
1298
1298
const TargetRegisterClass *DefRC = TII->getRegClass (MCID, 0 , TRI, *MF);
1299
1299
if (!DefMI->isImplicitDef ()) {
1300
- if (Register::isPhysicalRegister ( DstReg)) {
1300
+ if (DstReg. isPhysical ( )) {
1301
1301
Register NewDstReg = DstReg;
1302
1302
1303
1303
unsigned NewDstIdx = TRI->composeSubRegIndices (CP.getSrcIdx (),
@@ -1384,7 +1384,7 @@ bool RegisterCoalescer::reMaterializeTrivialDef(const CoalescerPair &CP,
1384
1384
}
1385
1385
}
1386
1386
1387
- if (Register::isVirtualRegister ( DstReg)) {
1387
+ if (DstReg. isVirtual ( )) {
1388
1388
unsigned NewIdx = NewMI.getOperand (0 ).getSubReg ();
1389
1389
1390
1390
if (DefRC != nullptr ) {
@@ -2481,7 +2481,7 @@ JoinVals::followCopyChain(const VNInfo *VNI) const {
2481
2481
if (!MI->isFullCopy ())
2482
2482
return std::make_pair (VNI, TrackReg);
2483
2483
Register SrcReg = MI->getOperand (1 ).getReg ();
2484
- if (!Register::isVirtualRegister ( SrcReg))
2484
+ if (!SrcReg. isVirtual ( ))
2485
2485
return std::make_pair (VNI, TrackReg);
2486
2486
2487
2487
const LiveInterval &LI = LIS->getInterval (SrcReg);
@@ -3537,7 +3537,7 @@ void RegisterCoalescer::checkMergingChangesDbgValues(CoalescerPair &CP,
3537
3537
3538
3538
// Scan for potentially unsound DBG_VALUEs: examine first the register number
3539
3539
// Reg, and then any other vregs that may have been merged into it.
3540
- auto PerformScan = [this ](Register Reg, std::function<void (unsigned )> Func) {
3540
+ auto PerformScan = [this ](Register Reg, std::function<void (Register )> Func) {
3541
3541
Func (Reg);
3542
3542
if (DbgMergedVRegNums.count (Reg))
3543
3543
for (Register X : DbgMergedVRegNums[Reg])
@@ -3675,7 +3675,7 @@ static bool isLocalCopy(MachineInstr *Copy, const LiveIntervals *LIS) {
3675
3675
}
3676
3676
3677
3677
void RegisterCoalescer::lateLiveIntervalUpdate () {
3678
- for (unsigned reg : ToBeUpdated) {
3678
+ for (Register reg : ToBeUpdated) {
3679
3679
if (!LIS->hasInterval (reg))
3680
3680
continue ;
3681
3681
LiveInterval &LI = LIS->getInterval (reg);
@@ -3728,11 +3728,11 @@ bool RegisterCoalescer::applyTerminalRule(const MachineInstr &Copy) const {
3728
3728
if (!isMoveInstr (*TRI, &Copy, SrcReg, DstReg, SrcSubReg, DstSubReg))
3729
3729
return false ;
3730
3730
// Check if the destination of this copy has any other affinity.
3731
- if (Register::isPhysicalRegister ( DstReg) ||
3731
+ if (DstReg. isPhysical ( ) ||
3732
3732
// If SrcReg is a physical register, the copy won't be coalesced.
3733
3733
// Ignoring it may have other side effect (like missing
3734
3734
// rematerialization). So keep it.
3735
- Register::isPhysicalRegister ( SrcReg) || !isTerminalReg (DstReg, Copy, MRI))
3735
+ SrcReg. isPhysical ( ) || !isTerminalReg (DstReg, Copy, MRI))
3736
3736
return false ;
3737
3737
3738
3738
// DstReg is a terminal node. Check if it interferes with any other
0 commit comments