[llvm] 938ee65 - [AMDGPU][InsertWaitCnts] Move TENSOR/ASYNC event detection to separate header (#204544)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 26 01:09:48 PDT 2026


Author: Pierre van Houtryve
Date: 2026-06-26T10:09:44+02:00
New Revision: 938ee65f1a7dcf228d39ef6eff2e0edcc522270a

URL: https://github.com/llvm/llvm-project/commit/938ee65f1a7dcf228d39ef6eff2e0edcc522270a
DIFF: https://github.com/llvm/llvm-project/commit/938ee65f1a7dcf228d39ef6eff2e0edcc522270a.diff

LOG: [AMDGPU][InsertWaitCnts] Move TENSOR/ASYNC event detection to separate header (#204544)

I forgot to move those out of the way as they were not grouped with the
other.
Now `getEventsFor` does all the work.

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/AMDGPUHWEvents.cpp
    llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/AMDGPUHWEvents.cpp b/llvm/lib/Target/AMDGPU/AMDGPUHWEvents.cpp
index ee1d507a08c9b..c472bac3babec 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUHWEvents.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUHWEvents.cpp
@@ -127,9 +127,16 @@ static HWEvents getEventsForImpl(const MachineInstr &Inst,
 
     if (TII.mayAccessLDSThroughFlat(Inst))
       E |= HWEvents::LDS_ACCESS;
+
+    if (SIInstrInfo::usesASYNC_CNT(Inst))
+      E |= HWEvents::ASYNC_ACCESS;
+
     return E;
   }
 
+  if (SIInstrInfo::usesTENSOR_CNT(Inst))
+    return HWEvents::TENSOR_ACCESS;
+
   if (SIInstrInfo::isVMEM(Inst) &&
       (!AMDGPU::getMUBUFIsBufferInv(Inst.getOpcode()) ||
        Inst.getOpcode() == AMDGPU::BUFFER_WBL2)) {

diff  --git a/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp b/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
index 93bf63cb640ef..db2609651440d 100644
--- a/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
+++ b/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
@@ -2668,11 +2668,6 @@ void SIInsertWaitcnts::updateEventWaitcntAfter(MachineInstr &Inst,
       // pointers so that both VM and LGKM counters are flushed.
       ScoreBrackets->setPendingFlat();
     }
-    if (SIInstrInfo::usesASYNC_CNT(Inst)) {
-      ScoreBrackets->updateByEvent(HWEvents::ASYNC_ACCESS, Inst);
-    }
-  } else if (SIInstrInfo::usesTENSOR_CNT(Inst)) {
-    ScoreBrackets->updateByEvent(HWEvents::TENSOR_ACCESS, Inst);
   } else if (Inst.isCall()) {
     // Act as a wait on everything, but AsyncCnt and TensorCnt are never
     // included in such blanket waits.


        


More information about the llvm-commits mailing list