[llvm] [AArch64][Win] Account for the fixed object area when classifying CSR… (PR #222111)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 11 09:53:31 PDT 2026


================
@@ -1390,8 +1390,19 @@ StackOffset AArch64FrameLowering::resolveFrameOffsetReference(
 
   int64_t FPOffset = getFPOffset(MF, ObjectOffset).getFixed();
   int64_t Offset = getStackOffset(MF, ObjectOffset).getFixed();
+
+  // The fixed object area sits above the callee-saved area and can grow
+  // large enough to displace it; account for that displacement here so CSR
+  // objects aren't misclassified as locals and addressed via the base
+  // pointer.
+  const int64_t FixedObjectSize = getFixedObjectSize(
+      MF, AFI,
+      Subtarget.isCallingConvWin64(MF.getFunction().getCallingConv(),
+                                   MF.getFunction().isVarArg()),
+      false);
----------------
efriedma-quic wrote:

IsFunclet=false should be fine, I think.  Funclets have their own CSRs, but I don't think we ever generate frame indexes for them.  (If we wanted to for some reason, I think we'd need other changes.)

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


More information about the llvm-commits mailing list