[llvm] [AMDGPU][SIInsertWaitCnts] Use RegUnits-based tracking (PR #162077)

Pierre van Houtryve via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 28 02:14:26 PST 2025


================
@@ -97,7 +97,32 @@ auto inst_counter_types(InstCounterType MaxCounter = NUM_INST_CNTS) {
   return enum_seq(LOAD_CNT, MaxCounter);
 }
 
-using RegInterval = std::pair<int, int>;
+/// Integer IDs used to track vector memory locations we may have to wait on.
+/// Encoded as u16 chunks:
+///
+///   [0,            MAX_REGUNITS ): MCRegUnit
+///   [FIRST_LDSDMA, LAST_LDSDMA  ): LDS DMA IDs
+using VMEMID = uint32_t;
+
+enum : VMEMID {
+  TRACKINGID_RANGE_LEN = (1 << 16),
+
+  REGUNITS_BEGIN = 0,
+  REGUNITS_END = REGUNITS_BEGIN + TRACKINGID_RANGE_LEN,
+
+  // Note for LDSDMA: LDSDMA_BEGIN corresponds to the "common"
+  // entry, which is updated for all LDS DMA operations encountered.
+  // Specific LDS DMA IDs start at LDSDMA_BEGIN + 1.
+  LDSDMA_BEGIN = REGUNITS_END,
+  LDSDMA_END = LDSDMA_BEGIN + TRACKINGID_RANGE_LEN,
----------------
Pierre-vh wrote:

`determineWaitForLDSDMA` would fail because it checks the ID is in the right range

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


More information about the llvm-commits mailing list