[llvm] [AMDGPU][SIInsertWaitcnts][NFC] Common InstCounterType printer (PR #187559)
Pierre van Houtryve via llvm-commits
llvm-commits at lists.llvm.org
Mon May 4 01:46:21 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")
----------------
Pierre-vh 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.
I fully agree, let's just have the counter that matches the enum. The enum can then document the legacy names.
Changing debug output is NFC still. It's not machine parseable or tested anywhere AFAIK.
IMO debug output like this should be as lightweight as possible (not take an excessive amount of logic) and map directly to the name/structure of the code.
https://github.com/llvm/llvm-project/pull/187559
More information about the llvm-commits
mailing list