[llvm] [AArch64][SME] Reuse ZT0 spill slot (PR #158593)

Gaƫtan Bossu via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 16 02:06:54 PDT 2025


================
@@ -8023,6 +8023,17 @@ static bool isPassedInFPR(EVT VT) {
          (VT.isFloatingPoint() && !VT.isScalableVector());
 }
 
+static SDValue getZT0FrameIndex(MachineFrameInfo &MFI,
+                                AArch64FunctionInfo &FuncInfo,
+                                SelectionDAG &DAG) {
+  if (!FuncInfo.hasZT0SpillSlotIndex())
+    FuncInfo.setZT0SpillSlotIndex(MFI.CreateSpillStackObject(64, Align(16)));
+
+  return DAG.getFrameIndex(
+      FuncInfo.getZT0SpillSlotIndex(),
+      DAG.getTargetLoweringInfo().getFrameIndexTy(DAG.getDataLayout()));
----------------
gbossu wrote:

Checking: we make the assumption that a function cannot have multiple ZT0 scopes, which means we can always re-use the same frame index for saving/restoring.

Curious: Does that mean that function using `ZT0` can never be inlined?

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


More information about the llvm-commits mailing list