[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),
+
+ 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,
----------------
jayfoad wrote:
I'm not sure LDSDMA_END is needed? In a couple of places you use it in assertions, but there is nothing that would prevent those assertions from failing if LDS IDs happened to climb high enough.
https://github.com/llvm/llvm-project/pull/162077
More information about the llvm-commits
mailing list