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

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Wed May 28 10:58:17 PDT 2025


================
@@ -2303,10 +2371,16 @@ void AArch64FrameLowering::emitEpilogue(MachineFunction &MF,
     assert(AfterCSRPopSize == 0);
     return;
   }
+
+  bool FPAfterSVECalleeSaves =
+      Subtarget.isTargetWindows() && AFI->getSVECalleeSavedStackSize();
+
   bool CombineSPBump = shouldCombineCSRLocalStackBumpInEpilogue(MBB, NumBytes);
   // Assume we can't combine the last pop with the sp restore.
   bool CombineAfterCSRBump = false;
-  if (!CombineSPBump && PrologueSaveSize != 0) {
+  if (FPAfterSVECalleeSaves) {
+    AfterCSRPopSize = FixedObject;
----------------
efriedma-quic wrote:

ArgumentStackToRestore is usually zero; it's only non-zero if you're using some weird callee-pop calling convention, or doing tail-call optimization.  I'll try to write some tail-call tests.

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


More information about the llvm-commits mailing list