[llvm] [AMDGPU] Enable reordering of VMEM loads during clustering (PR #107986)

Carl Ritson via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 7 22:31:48 PST 2025


================
@@ -581,6 +581,23 @@ bool SIInstrInfo::shouldClusterMemOps(ArrayRef<const MachineOperand *> BaseOps1,
   return NumDWORDs <= 8;
 }
 
+bool SIInstrInfo::canReorderClusterMemOps(
+    ArrayRef<const MachineOperand *> BaseOps1,
+    ArrayRef<const MachineOperand *> BaseOps2) const {
+  const MachineInstr *FirstLdSt =
+      !BaseOps1.empty() ? BaseOps1.front()->getParent() : nullptr;
+  const MachineInstr *SecondLdSt =
+      !BaseOps2.empty() ? BaseOps2.front()->getParent() : nullptr;
+  ;
+
+  if (!FirstLdSt || !isVMEM(*FirstLdSt))
+    return false;
+  if (!SecondLdSt || !isVMEM(*SecondLdSt))
+    return false;
+
----------------
perlfu wrote:

Yes AFAIK

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


More information about the llvm-commits mailing list