[llvm] [AArch64] Initial compiler support for SVE unwind on Windows. (PR #138609)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Fri May 16 05:52:51 PDT 2025


================
@@ -2757,10 +2871,25 @@ StackOffset AArch64FrameLowering::resolveFrameOffsetReference(
   }
 
   StackOffset ScalableOffset = {};
-  if (UseFP && !(isFixed || isCSR))
-    ScalableOffset = -SVEStackSize;
-  if (!UseFP && (isFixed || isCSR))
-    ScalableOffset = SVEStackSize;
+  if (FPAfterSVECalleeSaves) {
+    // In this stack layout, the FP is in between the callee saves and other
+    // SVE allocations.
+    StackOffset SVECalleeSavedStack =
+        StackOffset::getScalable(AFI->getSVECalleeSavedStackSize());
+    if (UseFP) {
+      if (!(isFixed || isCSR))
+        ScalableOffset = SVECalleeSavedStack - SVEStackSize;
+      else
+        ScalableOffset = SVECalleeSavedStack;
----------------
MacDue wrote:

IIUC this offset is correct for fixed stack objects (which are still above the SVE callee saves), but I don't think this works for (fixed) callee-saves, which are now below them. 

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


More information about the llvm-commits mailing list