[llvm] [AMDGPU][SIInsertWaitcnts] Wait on all LDS DMA operations when no aliasing store is found (PR #170660)

Pierre van Houtryve via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 5 01:16:21 PST 2025


================
@@ -2010,15 +2014,23 @@ bool SIInsertWaitcnts::generateWaitcntInstBefore(MachineInstr &MI,
         if (Ptr && Memop->getAAInfo()) {
           const auto &LDSDMAStores = ScoreBrackets.getLDSDMAStores();
           for (unsigned I = 0, E = LDSDMAStores.size(); I != E; ++I) {
-            if (MI.mayAlias(AA, *LDSDMAStores[I], true))
+            if (MI.mayAlias(AA, *LDSDMAStores[I], true)) {
+              if ((I + 1) >= NUM_LDS_VGPRS) {
----------------
Pierre-vh wrote:

We still need to do the AA check if we hit the limit. If we don't alias with any LDSDMAStore, even those above the limit, we don't need to wait

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


More information about the llvm-commits mailing list