[llvm] [AMDGPU][SIInsertWaitcnts][NFC] Common InstCounterType printer (PR #187559)

Sameer Sahasrabuddhe via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 28 20:10:44 PDT 2026


================
@@ -15,16 +15,19 @@ iota_range<InstCounterType> inst_counter_types(InstCounterType MaxCounter) {
   return enum_seq(LOAD_CNT, MaxCounter);
 }
 
-StringLiteral getInstCounterName(InstCounterType T) {
+StringLiteral getInstCounterName(InstCounterType T, bool HasExtendedWaitcnts) {
   switch (T) {
   case LOAD_CNT:
-    return "LOAD_CNT";
+    return HasExtendedWaitcnts ? StringLiteral("LOAD_CNT")
+                               : StringLiteral("VM_CNT");
   case DS_CNT:
-    return "DS_CNT";
+    return HasExtendedWaitcnts ? StringLiteral("DS_CNT")
----------------
ssahasra wrote:

What is the benefit of having an older name for these counters? Clearly the code does not say `LGKM_CNT` anywhere, and someone looking at the debug output of this pass is assumed to be informed enough to know what `LOAD_CNT` means. I would say it's far more consistent if the debug output matched the actual code instead of using outdated names.

https://github.com/llvm/llvm-project/pull/187559


More information about the llvm-commits mailing list