@@ -206,8 +206,7 @@ static const TargetRegisterClass *
206206getMinimalPhysRegClass (const TargetRegisterInfo *TRI, MCRegister Reg,
207207 TypeT Ty) {
208208 static_assert (std::is_same_v<TypeT, MVT> || std::is_same_v<TypeT, LLT>);
209- assert (Register::isPhysicalRegister (Reg) &&
210- " reg must be a physical register" );
209+ assert (Reg.isPhysical () && " reg must be a physical register" );
211210
212211 bool IsDefault = [&]() {
213212 if constexpr (std::is_same_v<TypeT, MVT>)
@@ -235,8 +234,7 @@ static const TargetRegisterClass *
235234getCommonMinimalPhysRegClass (const TargetRegisterInfo *TRI, MCRegister Reg1,
236235 MCRegister Reg2, TypeT Ty) {
237236 static_assert (std::is_same_v<TypeT, MVT> || std::is_same_v<TypeT, LLT>);
238- assert (Register::isPhysicalRegister (Reg1) &&
239- Register::isPhysicalRegister (Reg2) &&
237+ assert (Reg1.isPhysical () && Reg2.isPhysical () &&
240238 " Reg1/Reg2 must be a physical register" );
241239
242240 bool IsDefault = [&]() {
@@ -504,14 +502,13 @@ bool TargetRegisterInfo::getRegAllocationHints(
504502
505503bool TargetRegisterInfo::isCalleeSavedPhysReg (
506504 MCRegister PhysReg, const MachineFunction &MF) const {
507- if (PhysReg == 0 )
505+ if (! PhysReg)
508506 return false ;
509507 const uint32_t *callerPreservedRegs =
510508 getCallPreservedMask (MF, MF.getFunction ().getCallingConv ());
511509 if (callerPreservedRegs) {
512- assert (Register::isPhysicalRegister (PhysReg) &&
513- " Expected physical register" );
514- return (callerPreservedRegs[PhysReg / 32 ] >> PhysReg % 32 ) & 1 ;
510+ assert (PhysReg.isPhysical () && " Expected physical register" );
511+ return (callerPreservedRegs[PhysReg.id () / 32 ] >> PhysReg.id () % 32 ) & 1 ;
515512 }
516513 return false ;
517514}
0 commit comments