================
@@ -297,6 +302,34 @@ class WaitcntGenerator {
   // optimization.
   bool isOptNone() const { return OptNone; }
 
+  // Get the maximum wait count value for a given counter type.
+  // For pre-GFX12, LOAD_CNT uses vmcnt and DS_CNT uses lgkmcnt.
+  // For GFX12+, LOAD_CNT uses loadcnt and DS_CNT uses dscnt.
+  unsigned getWaitCountMax(InstCounterType T) const {
----------------
PankajDwivedi-25 wrote:

Right, `WaitcntGenerator` does not have a pointer back to `SIInsertWaitcnts`, 
so it couldn't call Context->getWaitCountMax().

I have made it a free function that both can use.

https://github.com/llvm/llvm-project/pull/169345
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to