[llvm] [AMDGPU] Consider FLAT instructions for VMEM hazard detection (PR #137170)

Robert Imschweiler via llvm-commits llvm-commits at lists.llvm.org
Wed May 28 00:40:39 PDT 2025


================
@@ -1417,9 +1417,8 @@ static bool shouldRunLdsBranchVmemWARHazardFixup(const MachineFunction &MF,
   bool HasVmem = false;
   for (auto &MBB : MF) {
     for (auto &MI : MBB) {
-      HasLds |= SIInstrInfo::isDS(MI);
-      HasVmem |= (SIInstrInfo::isVMEM(MI) && !SIInstrInfo::isFLAT(MI)) ||
-                 SIInstrInfo::isSegmentSpecificFLAT(MI);
+      HasLds |= SIInstrInfo::isDS(MI) || SIInstrInfo::isLDSDMA(MI);
+      HasVmem |= SIInstrInfo::isVMEM(MI) && !SIInstrInfo::isLDSDMA(MI);
----------------
ro-i wrote:

Are you sure that this applies to all architectures? Because in the MI300 ISA, for example, 9.1.9 says: "The MUBUF instruction format allows reading data from a memory buffer directly into LDS without passing through VGPRs." Without passing through VGPRs would mean that no vector memory is touched and, thus, no hazard can happen within vector memory, right?

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


More information about the llvm-commits mailing list