@@ -3408,7 +3408,7 @@ void SIInstrInfo::insertSelect(MachineBasicBlock &MBB,
34083408 }
34093409}
34103410
3411- bool SIInstrInfo::isFoldableCopy (const MachineInstr &MI) const {
3411+ bool SIInstrInfo::isFoldableCopy (const MachineInstr &MI) {
34123412 switch (MI.getOpcode ()) {
34133413 case AMDGPU::V_MOV_B16_t16_e32:
34143414 case AMDGPU::V_MOV_B32_e32:
@@ -3951,13 +3951,12 @@ bool SIInstrInfo::areMemAccessesTriviallyDisjoint(const MachineInstr &MIa,
39513951 return false ;
39523952}
39533953
3954- bool SIInstrInfo::getFoldableImm (Register Reg, const MachineRegisterInfo &MRI,
3955- int64_t &Imm,
3956- MachineInstr **DefMI = nullptr ) const {
3954+ static bool getFoldableImm (Register Reg, const MachineRegisterInfo &MRI,
3955+ int64_t &Imm, MachineInstr **DefMI = nullptr ) {
39573956 if (Reg.isPhysical ())
39583957 return false ;
39593958 auto *Def = MRI.getUniqueVRegDef (Reg);
3960- if (Def && isFoldableCopy (*Def) && Def->getOperand (1 ).isImm ()) {
3959+ if (Def && SIInstrInfo:: isFoldableCopy (*Def) && Def->getOperand (1 ).isImm ()) {
39613960 Imm = Def->getOperand (1 ).getImm ();
39623961 if (DefMI)
39633962 *DefMI = Def;
@@ -3966,8 +3965,8 @@ bool SIInstrInfo::getFoldableImm(Register Reg, const MachineRegisterInfo &MRI,
39663965 return false ;
39673966}
39683967
3969- bool SIInstrInfo:: getFoldableImm (const MachineOperand *MO, int64_t &Imm,
3970- MachineInstr **DefMI = nullptr ) const {
3968+ static bool getFoldableImm (const MachineOperand *MO, int64_t &Imm,
3969+ MachineInstr **DefMI = nullptr ) {
39713970 if (!MO->isReg ())
39723971 return false ;
39733972 const MachineFunction *MF = MO->getParent ()->getParent ()->getParent ();
@@ -4691,12 +4690,12 @@ bool SIInstrInfo::hasModifiers(unsigned Opcode) const {
46914690}
46924691
46934692bool SIInstrInfo::hasModifiersSet (const MachineInstr &MI,
4694- AMDGPU::OpName OpName) const {
4693+ AMDGPU::OpName OpName) {
46954694 const MachineOperand *Mods = getNamedOperand (MI, OpName);
46964695 return Mods && Mods->getImm ();
46974696}
46984697
4699- bool SIInstrInfo::hasAnyModifiersSet (const MachineInstr &MI) const {
4698+ bool SIInstrInfo::hasAnyModifiersSet (const MachineInstr &MI) {
47004699 return any_of (ModifierOpNames,
47014700 [&](AMDGPU::OpName Name) { return hasModifiersSet (MI, Name); });
47024701}
@@ -9338,7 +9337,7 @@ Register SIInstrInfo::findUsedSGPR(const MachineInstr &MI,
93389337}
93399338
93409339MachineOperand *SIInstrInfo::getNamedOperand (MachineInstr &MI,
9341- AMDGPU::OpName OperandName) const {
9340+ AMDGPU::OpName OperandName) {
93429341 if (OperandName == AMDGPU::OpName::NUM_OPERAND_NAMES)
93439342 return nullptr ;
93449343
@@ -10619,11 +10618,10 @@ bool SIInstrInfo::optimizeCompareInstr(MachineInstr &CmpInstr, Register SrcReg,
1061910618 return false ;
1062010619
1062110620 int64_t Mask;
10622- const auto isMask = [&Mask, SrcSize,
10623- this ](const MachineOperand *MO) -> bool {
10621+ const auto isMask = [&Mask, SrcSize](const MachineOperand *MO) -> bool {
1062410622 if (MO->isImm ())
1062510623 Mask = MO->getImm ();
10626- else if (!this -> getFoldableImm (MO, Mask))
10624+ else if (!getFoldableImm (MO, Mask))
1062710625 return false ;
1062810626 Mask &= maxUIntN (SrcSize);
1062910627 return isPowerOf2_64 (Mask);
0 commit comments