[PATCH] D136677: [AMDGPU] Small cleanups in wait counter code
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 25 06:14:15 PDT 2022
foad added a comment.
Note that getScoreLB should //always// be <= getScoreUB, so code like `getScoreLB < getScoreUB` can be updated to `getScoreRange != 0`.
================
Comment at: llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp:1335
+static bool isStoreCountWait(const MachineInstr &I) {
+ return (I.getOpcode() == AMDGPU::S_WAITCNT_VSCNT &&
----------------
Not sure about the name. Maybe `isWaitStoreCountZero` would be better...?
================
Comment at: llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp:1336
+static bool isStoreCountWait(const MachineInstr &I) {
+ return (I.getOpcode() == AMDGPU::S_WAITCNT_VSCNT &&
+ I.getOperand(0).getReg() == AMDGPU::SGPR_NULL &&
----------------
Don't need the outermost parens.
================
Comment at: llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp:698
unsigned LB = getScoreLB(T);
unsigned UB = getScoreUB(T);
----------------
Can use getScoreRange here.
================
Comment at: llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp:759
const unsigned LB = getScoreLB(T);
const unsigned UB = getScoreUB(T);
----------------
Can use getScoreRange here.
================
Comment at: llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp:1204
if (ScoreBrackets.getScoreLB(LGKM_CNT) <
ScoreBrackets.getScoreUB(LGKM_CNT) &&
ScoreBrackets.hasPendingEvent(SMEM_ACCESS)) {
----------------
Can use getScoreRange here.
================
Comment at: llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp:1598
ScoreBrackets.getScoreLB(LGKM_CNT) <
ScoreBrackets.getScoreUB(LGKM_CNT) &&
ScoreBrackets.hasPendingEvent(SMEM_ACCESS)) {
----------------
Can use getScoreRange here.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D136677/new/
https://reviews.llvm.org/D136677
More information about the llvm-commits
mailing list