[llvm] [AMDGPU] Don't cluster lds instrs together (PR #180908)

via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 21 08:32:27 PST 2026


================
@@ -563,12 +563,22 @@ static bool memOpsHaveSameBasePtr(const MachineInstr &MI1,
   return Base1 == Base2;
 }
 
+static bool isDSInstrOperands(ArrayRef<const MachineOperand *> operands) {
+  if (operands.empty())
+    return false;
+  const auto *MI = operands.front()->getParent();
+  return SIInstrInfo::isDS(*MI);
----------------
lijinpei-amd wrote:

> I feel you ought to add a comment explaining what this `isDs` means.

It's an amdgpu specific helper function, which corresponds to instructions in the "Local Data Share Operations" chapter of [rdna/cdna ISA](https://gpuopen.com/amd-gpu-architecture-programming-documentation/). DS(Local Data Share) is shared-memory per CUDA nomenclature.
As I merely reference to this function, I think it's a separate concern to add a comment on it.

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


More information about the llvm-commits mailing list