From 103dd11732c49ac5bf2f44dc61a25c4ec272c621 Mon Sep 17 00:00:00 2001 From: gangc Date: Mon, 30 Sep 2024 12:30:19 -0700 Subject: [PATCH] [AMDGPU] Refactor several functions for downstream merging. For setScore, the root function is setScoreByInterval with RegInterval input. For determineWait, the root function is determineWait with RegInterval inputs. --- llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp b/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp index ba567f863a7e75..e64b35d230d486 100644 --- a/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp +++ b/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp @@ -859,7 +859,8 @@ void WaitcntBrackets::updateByEvent(const SIInstrInfo *TII, } } else if (TII->isMIMG(Inst)) { if (Inst.mayStore()) { - setScoreByOperand(&Inst, TRI, MRI, Inst.getOperand(0), EXP_CNT, CurrScore); + setScoreByOperand(&Inst, TRI, MRI, Inst.getOperand(0), EXP_CNT, + CurrScore); } else if (SIInstrInfo::isAtomicRet(Inst)) { setScoreByOperand(&Inst, TRI, MRI, *TII->getNamedOperand(Inst, AMDGPU::OpName::data), @@ -867,10 +868,12 @@ void WaitcntBrackets::updateByEvent(const SIInstrInfo *TII, } } else if (TII->isMTBUF(Inst)) { if (Inst.mayStore()) - setScoreByOperand(&Inst, TRI, MRI, Inst.getOperand(0), EXP_CNT, CurrScore); + setScoreByOperand(&Inst, TRI, MRI, Inst.getOperand(0), EXP_CNT, + CurrScore); } else if (TII->isMUBUF(Inst)) { if (Inst.mayStore()) { - setScoreByOperand(&Inst, TRI, MRI, Inst.getOperand(0), EXP_CNT, CurrScore); + setScoreByOperand(&Inst, TRI, MRI, Inst.getOperand(0), EXP_CNT, + CurrScore); } else if (SIInstrInfo::isAtomicRet(Inst)) { setScoreByOperand(&Inst, TRI, MRI, *TII->getNamedOperand(Inst, AMDGPU::OpName::data),