[llvm-branch-commits] [llvm] [AMDGPU][InsertWaitCnts] Move TENSOR/ASYNC event detection to separate header (PR #204544)
Pierre van Houtryve via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Jun 23 02:52:22 PDT 2026
https://github.com/Pierre-vh updated https://github.com/llvm/llvm-project/pull/204544
>From 65f566ae148b3cfdd1ae44b897de572373e17934 Mon Sep 17 00:00:00 2001
From: pvanhout <pierre.vanhoutryve at amd.com>
Date: Thu, 18 Jun 2026 10:58:24 +0200
Subject: [PATCH] [AMDGPU][InsertWaitCnts] Move TENSOR/ASYNC event detection to
separate header
I forgot to move those out of the way as they were not grouped with the other.
Now `getEventsFor` does all the work.
---
llvm/lib/Target/AMDGPU/AMDGPUHWEvents.cpp | 7 +++++++
llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp | 5 -----
2 files changed, 7 insertions(+), 5 deletions(-)
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-branch-commits
mailing list