[llvm] [AArch64][SME] Fix restoring callee-saves from FP with hazard padding (PR #143371)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 16 04:30:23 PDT 2025


================
@@ -2535,27 +2535,69 @@ void AArch64FrameLowering::emitEpilogue(MachineFunction &MF,
                     DeallocateAfter, TII, MachineInstr::FrameDestroy, false,
                     NeedsWinCFI, &HasWinCFI);
   } else if (SVEStackSize) {
-    // If we have stack realignment or variable sized objects on the stack,
-    // restore the stack pointer from the frame pointer prior to SVE CSR
-    // restoration.
-    if (AFI->isStackRealigned() || MFI.hasVarSizedObjects()) {
-      if (int64_t CalleeSavedSize = AFI->getSVECalleeSavedStackSize()) {
-        // Set SP to start of SVE callee-save area from which they can
-        // be reloaded. The code below will deallocate the stack space
-        // space by moving FP -> SP.
-        emitFrameOffset(MBB, RestoreBegin, DL, AArch64::SP, AArch64::FP,
-                        StackOffset::getScalable(-CalleeSavedSize), TII,
----------------
MacDue wrote:

Updated to use the virtual register :+1: 

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


More information about the llvm-commits mailing list