@@ -206,8 +206,7 @@ static const TargetRegisterClass *
206
206
getMinimalPhysRegClass (const TargetRegisterInfo *TRI, MCRegister Reg,
207
207
TypeT Ty) {
208
208
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" );
211
210
212
211
bool IsDefault = [&]() {
213
212
if constexpr (std::is_same_v<TypeT, MVT>)
@@ -235,8 +234,7 @@ static const TargetRegisterClass *
235
234
getCommonMinimalPhysRegClass (const TargetRegisterInfo *TRI, MCRegister Reg1,
236
235
MCRegister Reg2, TypeT Ty) {
237
236
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 () &&
240
238
" Reg1/Reg2 must be a physical register" );
241
239
242
240
bool IsDefault = [&]() {
@@ -504,14 +502,13 @@ bool TargetRegisterInfo::getRegAllocationHints(
504
502
505
503
bool TargetRegisterInfo::isCalleeSavedPhysReg (
506
504
MCRegister PhysReg, const MachineFunction &MF) const {
507
- if (PhysReg == 0 )
505
+ if (! PhysReg)
508
506
return false ;
509
507
const uint32_t *callerPreservedRegs =
510
508
getCallPreservedMask (MF, MF.getFunction ().getCallingConv ());
511
509
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 ;
515
512
}
516
513
return false ;
517
514
}
0 commit comments