[llvm] [AMDGPU] introduce S_WAITCNT_LDS_DIRECT in the memory legalizer (PR #150887)

Pierre van Houtryve via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 28 04:07:36 PDT 2025


================
@@ -2078,6 +2089,17 @@ bool SIGfx10CacheControl::insertWait(MachineBasicBlock::iterator &MI,
     Changed = true;
   }
 
+  // On architectures that support direct loads to LDS, emit an unknown waitcnt
+  // at workgroup-scoped release operations that specify the LDS address space.
+  // SIInsertWaitcnts will later replace this with a vmcnt().
+  if (ST.hasVMemToLDSLoad() && isReleaseOrStronger(Order) &&
+      Scope == SIAtomicScope::WORKGROUP &&
+      ((SIAtomicAddrSpace)AddrSpace & SIAtomicAddrSpace::LDS) !=
----------------
Pierre-vh wrote:

Does it need the cast still? I thought it wouldn't need it

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


More information about the llvm-commits mailing list