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

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 27 05:09:11 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),
----------------
jayfoad wrote:

Is this just an arbitrary value larger than MAX_REGUNITS? Can you assert somewhere that it is `>= TRI.getNumRegUnits()`?

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


More information about the llvm-commits mailing list