[llvm] [AMDGPU] CodeGen for GFX12 S_WAIT_* instructions (PR #77438)

Pierre van Houtryve via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 12 04:51:41 PST 2024


================
@@ -57,7 +57,18 @@ namespace {
 // associated with the operand.  Used for determining whether
 // s_waitcnt instruction needs to be emitted.
 
-enum InstCounterType { VM_CNT = 0, LGKM_CNT, EXP_CNT, VS_CNT, NUM_INST_CNTS };
+enum InstCounterType {
+  LOAD_CNT = 0, // VMcnt prior to gfx12.
+  DS_CNT,       // LKGMcnt prior to gfx12.
+  EXP_CNT,      //
+  STORE_CNT,    // VScnt in gfx10/gfx11.
+  NUM_NORMAL_INST_CNTS,
----------------
Pierre-vh wrote:

I feel like I see this pattern more often:

```
STORE_CNT,

NORMAL_INST_CNTS_MAX = STORE_CNT,
````

Rather than having a "max" entry that's more like a sentinel value. I just prefer this style more than having a dedicated enum value for MAX

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


More information about the llvm-commits mailing list