[llvm] 1ae9575 - [AMDGPU][NFC] Update a comment about FLAT v/s LDSDMA
Sameer Sahasrabuddhe via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 8 07:19:39 PST 2025
Author: Sameer Sahasrabuddhe
Date: 2025-12-08T20:49:19+05:30
New Revision: 1ae957515cccf8825733fbe100ff32864543d248
URL: https://github.com/llvm/llvm-project/commit/1ae957515cccf8825733fbe100ff32864543d248
DIFF: https://github.com/llvm/llvm-project/commit/1ae957515cccf8825733fbe100ff32864543d248.diff
LOG: [AMDGPU][NFC] Update a comment about FLAT v/s LDSDMA
The change in #170263 does not do justice to common knowledge in the backend.
Fix the comment to reflect the relation between FLAT encoding, flat pointer
access, and LDSDMA operations.
Added:
Modified:
llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp b/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
index 3b59045337b10..664ce126e64a1 100644
--- a/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
+++ b/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
@@ -2297,12 +2297,11 @@ void SIInsertWaitcnts::updateEventWaitcntAfter(MachineInstr &Inst,
ScoreBrackets->updateByEvent(LDS_ACCESS, Inst);
}
- // If this is a truly flat memory operation, then it accesss both VMEM and
- // LDS, so note it - it will require that both the VM and LGKM be flushed to
- // zero if it is pending when a VM or LGKM dependency occurs.
- //
- // For example, LDS DMA operations have FLAT set in their TSFlags for
- // unspecified reasons, but they are not flat operations)
+ // Async/LDSDMA operations have FLAT encoding but do not actually use flat
+ // pointers. They do have two operands that each access global and LDS, thus
+ // making it appear at this point that they are using a flat pointer. Filter
+ // them out, and for the rest, generate a dependency on flat pointers so
+ // that both VM and LGKM counters are flushed.
if (!SIInstrInfo::isLDSDMA(Inst) && FlatASCount > 1)
ScoreBrackets->setPendingFlat();
} else if (SIInstrInfo::isVMEM(Inst) &&
More information about the llvm-commits
mailing list