[llvm] [AMDGPU][AMDGPUBaseInfo] Replace Waitcnt members with array (PR #182927)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 10 03:17:49 PDT 2026


================
@@ -198,6 +198,37 @@ iota_range<InstCounterType> inst_counter_types(InstCounterType MaxCounter) {
   return enum_seq(LOAD_CNT, MaxCounter);
 }
 
+StringLiteral instCounterTypeToStr(InstCounterType T) {
+  switch (T) {
+  case LOAD_CNT:
+    return "LOAD_CNT";
+  case DS_CNT:
+    return "DS_CNT";
+  case EXP_CNT:
+    return "EXP_CNT";
+  case STORE_CNT:
+    return "STORE_CNT";
+  case SAMPLE_CNT:
+    return "SAMPLE_CNT";
+  case BVH_CNT:
+    return "BVH_CNT";
+  case KM_CNT:
+    return "KM_CNT";
+  case X_CNT:
+    return "X_CNT";
+  case VA_VDST:
+    return "VA_VDST";
+  case VM_VSRC:
+    return "VM_VSRC";
+  default:
+    return "Unknown T";
+  }
+}
+
+#ifndef NDEBUG
+void Waitcnt::dump() const { dbgs() << *this << "\n"; }
----------------
jayfoad wrote:

The convention seems to be:
```suggestion
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
LLVM_DUMP_METHOD void Waitcnt::dump() const { dbgs() << *this << "\n"; }
```

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


More information about the llvm-commits mailing list