@@ -207,9 +207,7 @@ class RegAllocFastImpl {
207207
208208 explicit LiveReg (Register VirtReg) : VirtReg(VirtReg) {}
209209
210- unsigned getSparseSetIndex () const {
211- return Register::virtReg2Index (VirtReg);
212- }
210+ unsigned getSparseSetIndex () const { return VirtReg.virtRegIndex (); }
213211 };
214212
215213 using LiveRegMap = SparseSet<LiveReg, identity<unsigned >, uint16_t >;
@@ -349,11 +347,11 @@ class RegAllocFastImpl {
349347 unsigned calcSpillCost (MCPhysReg PhysReg) const ;
350348
351349 LiveRegMap::iterator findLiveVirtReg (Register VirtReg) {
352- return LiveVirtRegs.find (Register::virtReg2Index ( VirtReg));
350+ return LiveVirtRegs.find (VirtReg. virtRegIndex ( ));
353351 }
354352
355353 LiveRegMap::const_iterator findLiveVirtReg (Register VirtReg) const {
356- return LiveVirtRegs.find (Register::virtReg2Index ( VirtReg));
354+ return LiveVirtRegs.find (VirtReg. virtRegIndex ( ));
357355 }
358356
359357 void assignVirtToPhysReg (MachineInstr &MI, LiveReg &, MCPhysReg PhysReg);
@@ -493,7 +491,7 @@ static bool dominates(InstrPosIndexes &PosIndexes, const MachineInstr &A,
493491
494492// / Returns false if \p VirtReg is known to not live out of the current block.
495493bool RegAllocFastImpl::mayLiveOut (Register VirtReg) {
496- if (MayLiveAcrossBlocks.test (Register::virtReg2Index ( VirtReg))) {
494+ if (MayLiveAcrossBlocks.test (VirtReg. virtRegIndex ( ))) {
497495 // Cannot be live-out if there are no successors.
498496 return !MBB->succ_empty ();
499497 }
@@ -506,15 +504,15 @@ bool RegAllocFastImpl::mayLiveOut(Register VirtReg) {
506504 // Find the first def in the self loop MBB.
507505 for (const MachineInstr &DefInst : MRI->def_instructions (VirtReg)) {
508506 if (DefInst.getParent () != MBB) {
509- MayLiveAcrossBlocks.set (Register::virtReg2Index ( VirtReg));
507+ MayLiveAcrossBlocks.set (VirtReg. virtRegIndex ( ));
510508 return true ;
511509 } else {
512510 if (!SelfLoopDef || dominates (PosIndexes, DefInst, *SelfLoopDef))
513511 SelfLoopDef = &DefInst;
514512 }
515513 }
516514 if (!SelfLoopDef) {
517- MayLiveAcrossBlocks.set (Register::virtReg2Index ( VirtReg));
515+ MayLiveAcrossBlocks.set (VirtReg. virtRegIndex ( ));
518516 return true ;
519517 }
520518 }
@@ -525,7 +523,7 @@ bool RegAllocFastImpl::mayLiveOut(Register VirtReg) {
525523 unsigned C = 0 ;
526524 for (const MachineInstr &UseInst : MRI->use_nodbg_instructions (VirtReg)) {
527525 if (UseInst.getParent () != MBB || ++C >= Limit) {
528- MayLiveAcrossBlocks.set (Register::virtReg2Index ( VirtReg));
526+ MayLiveAcrossBlocks.set (VirtReg. virtRegIndex ( ));
529527 // Cannot be live-out if there are no successors.
530528 return !MBB->succ_empty ();
531529 }
@@ -535,7 +533,7 @@ bool RegAllocFastImpl::mayLiveOut(Register VirtReg) {
535533 // value inside a self looping block.
536534 if (SelfLoopDef == &UseInst ||
537535 !dominates (PosIndexes, *SelfLoopDef, UseInst)) {
538- MayLiveAcrossBlocks.set (Register::virtReg2Index ( VirtReg));
536+ MayLiveAcrossBlocks.set (VirtReg. virtRegIndex ( ));
539537 return true ;
540538 }
541539 }
@@ -546,15 +544,15 @@ bool RegAllocFastImpl::mayLiveOut(Register VirtReg) {
546544
547545// / Returns false if \p VirtReg is known to not be live into the current block.
548546bool RegAllocFastImpl::mayLiveIn (Register VirtReg) {
549- if (MayLiveAcrossBlocks.test (Register::virtReg2Index ( VirtReg)))
547+ if (MayLiveAcrossBlocks.test (VirtReg. virtRegIndex ( )))
550548 return !MBB->pred_empty ();
551549
552550 // See if the first \p Limit def of the register are all in the current block.
553551 static const unsigned Limit = 8 ;
554552 unsigned C = 0 ;
555553 for (const MachineInstr &DefInst : MRI->def_instructions (VirtReg)) {
556554 if (DefInst.getParent () != MBB || ++C >= Limit) {
557- MayLiveAcrossBlocks.set (Register::virtReg2Index ( VirtReg));
555+ MayLiveAcrossBlocks.set (VirtReg. virtRegIndex ( ));
558556 return !MBB->pred_empty ();
559557 }
560558 }
0 commit comments