@@ -874,11 +874,11 @@ static bool updateOperandIfDifferent(MachineInstr &MI, uint16_t OpName,
874874}
875875
876876bool SIInsertWaitcnts::promoteSoftWaitCnt (MachineInstr *Waitcnt) const {
877- unsigned Opcode = Waitcnt->getOpcode ();
878- if (! SIInstrInfo::isSoftWaitcnt ( Opcode))
877+ unsigned Opcode = SIInstrInfo::getNonSoftWaitcntOpcode ( Waitcnt->getOpcode () );
878+ if (Opcode == Waitcnt-> getOpcode ( ))
879879 return false ;
880880
881- Waitcnt->setDesc (TII->get (SIInstrInfo::getNonSoftWaitcntOpcode ( Opcode) ));
881+ Waitcnt->setDesc (TII->get (Opcode));
882882 return true ;
883883}
884884
@@ -898,10 +898,10 @@ bool SIInsertWaitcnts::applyPreexistingWaitcnt(
898898 if (II.isMetaInstruction ())
899899 continue ;
900900
901- unsigned Opcode = II.getOpcode ();
902- bool IsSoft = SIInstrInfo::isSoftWaitcnt ( Opcode);
901+ unsigned Opcode = SIInstrInfo::getNonSoftWaitcntOpcode ( II.getOpcode () );
902+ bool IsSoft = Opcode != II. getOpcode ( );
903903
904- if (SIInstrInfo::isWaitcnt (Opcode) ) {
904+ if (Opcode == AMDGPU::S_WAITCNT ) {
905905 // Update required wait count. If this is a soft waitcnt (= it was added
906906 // by an earlier pass), it may be entirely removed.
907907 unsigned IEnc = II.getOperand (0 ).getImm ();
@@ -918,7 +918,7 @@ bool SIInsertWaitcnts::applyPreexistingWaitcnt(
918918 WaitcntInstr = ⅈ
919919
920920 } else {
921- assert (SIInstrInfo::isWaitcntVsCnt (Opcode) );
921+ assert (Opcode == AMDGPU::S_WAITCNT_VSCNT );
922922 assert (II.getOperand (0 ).getReg () == AMDGPU::SGPR_NULL);
923923
924924 unsigned OldVSCnt =
@@ -1590,9 +1590,9 @@ bool WaitcntBrackets::merge(const WaitcntBrackets &Other) {
15901590}
15911591
15921592static bool isWaitInstr (MachineInstr &Inst) {
1593- auto Opcode = Inst.getOpcode ();
1594- return SIInstrInfo::isWaitcnt (Opcode) ||
1595- (SIInstrInfo::isWaitcntVsCnt (Opcode) && Inst.getOperand (0 ).isReg () &&
1593+ unsigned Opcode = SIInstrInfo::getNonSoftWaitcntOpcode ( Inst.getOpcode () );
1594+ return Opcode == AMDGPU::S_WAITCNT ||
1595+ (Opcode == AMDGPU::S_WAITCNT_VSCNT && Inst.getOperand (0 ).isReg () &&
15961596 Inst.getOperand (0 ).getReg () == AMDGPU::SGPR_NULL);
15971597}
15981598
0 commit comments