[llvm] [AMDGPU] Classify FLAT instructions as VMEM (PR #137148)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue May 6 06:25:07 PDT 2025


================
@@ -2454,8 +2454,10 @@ bool SIInsertWaitcnts::isPreheaderToFlush(
 }
 
 bool SIInsertWaitcnts::isVMEMOrFlatVMEM(const MachineInstr &MI) const {
-  return SIInstrInfo::isVMEM(MI) ||
-         (SIInstrInfo::isFLAT(MI) && mayAccessVMEMThroughFlat(MI));
+  if (SIInstrInfo::isFLAT(MI))
+    return mayAccessVMEMThroughFlat(MI);
+  return SIInstrInfo::isMUBUF(MI) || SIInstrInfo::isMTBUF(MI) ||
+         SIInstrInfo::isImage(MI);
----------------
arsenm wrote:

I mean the special case handling where it's looking at the memory operands. mayAccessVMEMThroughFlat can only improve a very niche case. To handle that, treat isFLAT as the special case and then the rest doesn't matter, it's the vmem except flat 

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


More information about the llvm-commits mailing list