[PATCH] D136677: [AMDGPU] Small cleanups in wait counter code

Stephen Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 26 04:00:17 PDT 2022


stepthomas added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp:698-715
 
     switch (T) {
     case VM_CNT:
-      OS << "    VM_CNT(" << UB - LB << "): ";
+      OS << "    VM_CNT(" << SR << "): ";
       break;
     case LGKM_CNT:
+      OS << "    LGKM_CNT(" << SR << "): ";
----------------
scott.linder wrote:
> Nit, but I'd also factor out the remaining common stuff
I'll decline this suggestion if I may - it actually makes it less clear to me.


================
Comment at: llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp:1238
 
-  unsigned UB = ScoreBrackets.getScoreUB(VM_CNT);
-  unsigned LB = ScoreBrackets.getScoreLB(VM_CNT);
-  if (UB - LB == 0)
+  if (ScoreBrackets.getScoreRange(VM_CNT) == 0)
     return false;
----------------
scott.linder wrote:
> 
As I was typing this (and other cases) I was very much in two minds. I think I'll adopt this suggestion.


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