@@ -91,7 +91,7 @@ class MachineCSEImpl {
9191 ScopedHashTable<MachineInstr *, unsigned , MachineInstrExpressionTrait,
9292 AllocatorTy>;
9393 using ScopeType = ScopedHTType::ScopeTy;
94- using PhysDefVector = SmallVector<std::pair<unsigned , unsigned >, 2 >;
94+ using PhysDefVector = SmallVector<std::pair<unsigned , Register >, 2 >;
9595
9696 unsigned LookAheadLimit = 0 ;
9797 DenseMap<MachineBasicBlock *, ScopeType *> ScopeMap;
@@ -321,7 +321,7 @@ bool MachineCSEImpl::hasLivePhysRegDefUses(const MachineInstr *MI,
321321 // common since this pass is run before livevariables. We can scan
322322 // forward a few instructions and check if it is obviously dead.
323323 if (!MO.isDead () && !isPhysDefTriviallyDead (Reg.asMCReg (), I, MBB->end ()))
324- PhysDefs.push_back ( std::make_pair ( MOP.index (), Reg) );
324+ PhysDefs.emplace_back ( MOP.index (), Reg);
325325 }
326326
327327 // Finally, add all defs to PhysRefs as well.
@@ -531,9 +531,9 @@ void MachineCSEImpl::ExitScope(MachineBasicBlock *MBB) {
531531bool MachineCSEImpl::ProcessBlockCSE (MachineBasicBlock *MBB) {
532532 bool Changed = false ;
533533
534- SmallVector<std::pair<unsigned , unsigned >, 8 > CSEPairs;
534+ SmallVector<std::pair<Register, Register >, 8 > CSEPairs;
535535 SmallVector<unsigned , 2 > ImplicitDefsToUpdate;
536- SmallVector<unsigned , 2 > ImplicitDefs;
536+ SmallVector<Register , 2 > ImplicitDefs;
537537 for (MachineInstr &MI : llvm::make_early_inc_range (*MBB)) {
538538 if (!isCSECandidate (&MI))
539539 continue ;
@@ -667,15 +667,15 @@ bool MachineCSEImpl::ProcessBlockCSE(MachineBasicBlock *MBB) {
667667 break ;
668668 }
669669
670- CSEPairs.push_back ( std::make_pair ( OldReg, NewReg) );
670+ CSEPairs.emplace_back ( OldReg, NewReg);
671671 --NumDefs;
672672 }
673673
674674 // Actually perform the elimination.
675675 if (DoCSE) {
676- for (const std::pair<unsigned , unsigned > &CSEPair : CSEPairs) {
677- unsigned OldReg = CSEPair.first ;
678- unsigned NewReg = CSEPair.second ;
676+ for (const std::pair<Register, Register > &CSEPair : CSEPairs) {
677+ Register OldReg = CSEPair.first ;
678+ Register NewReg = CSEPair.second ;
679679 // OldReg may have been unused but is used now, clear the Dead flag
680680 MachineInstr *Def = MRI->getUniqueVRegDef (NewReg);
681681 assert (Def != nullptr && " CSEd register has no unique definition?" );
0 commit comments