[llvm] [AMDGPU] Remove some unneeded waits for VA_VDST (PR #210741)

Krzysztof Drewniak via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 20 08:46:34 PDT 2026


================
@@ -1484,8 +1492,16 @@ void WaitcntBrackets::tryClearSCCWriteEvent(MachineInstr *Inst) {
 }
 
 void WaitcntBrackets::applyWaitcnt(const AMDGPU::Waitcnt &Wait) {
-  for (AMDGPU::InstCounterType T : AMDGPU::inst_counter_types())
-    applyWaitcnt(Wait, T);
+  for (AMDGPU::InstCounterType T : AMDGPU::inst_counter_types()) {
+    unsigned Cnt;
+    if (T == AMDGPU::VA_VDST_RD || T == AMDGPU::VA_VDST_WR) {
+      Cnt =
+          std::min(Wait.get(AMDGPU::VA_VDST_RD), Wait.get(AMDGPU::VA_VDST_WR));
----------------
krzysz00 wrote:

I think the question is if there's code that "bypasses" this API that could miss this check or if it'd be easy to accidentally change this system in a way that'd bring the problem back in the future

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


More information about the llvm-commits mailing list