diff --git a/llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp b/llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp --- a/llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp +++ b/llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp @@ -61,7 +61,8 @@ "getNumCoveredRegs() will not work with generated subreg masks!"); RegPressureIgnoredUnits.resize(getNumRegUnits()); - RegPressureIgnoredUnits.set(*MCRegUnitIterator(AMDGPU::M0, this)); + RegPressureIgnoredUnits.set( + *MCRegUnitIterator(MCRegister::from(AMDGPU::M0), this)); for (auto Reg : AMDGPU::VGPR_HI16RegClass) RegPressureIgnoredUnits.set(*MCRegUnitIterator(Reg, this)); @@ -2091,7 +2092,8 @@ DefIdx = V->def; } else { // Find last def. - for (MCRegUnitIterator Units(Reg, this); Units.isValid(); ++Units) { + for (MCRegUnitIterator Units(Reg.asMCReg(), this); Units.isValid(); + ++Units) { LiveRange &LR = LIS->getRegUnit(*Units); if (VNInfo *V = LR.getVNInfoAt(UseIdx)) { if (!DefIdx.isValid() || diff --git a/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp b/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp --- a/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp +++ b/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp @@ -353,7 +353,8 @@ if (Reg == AMDGPU::EXEC || Reg == AMDGPU::EXEC_LO) continue; - for (MCRegUnitIterator RegUnit(Reg, TRI); RegUnit.isValid(); ++RegUnit) { + for (MCRegUnitIterator RegUnit(Reg.asMCReg(), TRI); RegUnit.isValid(); + ++RegUnit) { LiveRange &LR = LIS->getRegUnit(*RegUnit); const VNInfo *Value = LR.Query(LIS->getInstructionIndex(MI)).valueIn(); if (!Value) @@ -630,7 +631,8 @@ if (!SaveSCC) return PreferLast ? Last : First; - LiveRange &LR = LIS->getRegUnit(*MCRegUnitIterator(AMDGPU::SCC, TRI)); + LiveRange &LR = + LIS->getRegUnit(*MCRegUnitIterator(MCRegister::from(AMDGPU::SCC), TRI)); auto MBBE = MBB.end(); SlotIndex FirstIdx = First != MBBE ? LIS->getInstructionIndex(*First) : LIS->getMBBEndIdx(&MBB); @@ -1060,7 +1062,7 @@ // Physical registers like SCC aren't tracked by default anyway, so just // removing the ranges we computed is the simplest option for maintaining // the analysis results. - LIS->removeRegUnit(*MCRegUnitIterator(AMDGPU::SCC, TRI)); + LIS->removeRegUnit(*MCRegUnitIterator(MCRegister::from(AMDGPU::SCC), TRI)); return true; } diff --git a/llvm/lib/Target/PowerPC/PPCVSXFMAMutate.cpp b/llvm/lib/Target/PowerPC/PPCVSXFMAMutate.cpp --- a/llvm/lib/Target/PowerPC/PPCVSXFMAMutate.cpp +++ b/llvm/lib/Target/PowerPC/PPCVSXFMAMutate.cpp @@ -315,9 +315,9 @@ // Extend the live interval of the addend source (it might end at the // copy to be removed, or somewhere in between there and here). This // is necessary only if it is a physical register. - if (!Register::isVirtualRegister(AddendSrcReg)) - for (MCRegUnitIterator Units(AddendSrcReg, TRI); Units.isValid(); - ++Units) { + if (!AddendSrcReg.isVirtual()) + for (MCRegUnitIterator Units(AddendSrcReg.asMCReg(), TRI); + Units.isValid(); ++Units) { unsigned Unit = *Units; LiveRange &AddendSrcRange = LIS->getRegUnit(Unit); diff --git a/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp b/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp --- a/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp +++ b/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp @@ -999,7 +999,7 @@ unsigned Opcode = MI.getOpcode(); // Check CC liveness if new instruction introduces a dead def of CC. - MCRegUnitIterator CCUnit(SystemZ::CC, TRI); + MCRegUnitIterator CCUnit(MCRegister::from(SystemZ::CC), TRI); SlotIndex MISlot = SlotIndex(); LiveRange *CCLiveRange = nullptr; bool CCLiveAtMI = true;