[llvm] [AArch64][SVE] Avoid extra pop of "FixedObject" with FPAfterSVECalleeSaves (PR #156452)
Benjamin Maxwell via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 25 01:47:48 PDT 2025
================
@@ -2587,15 +2595,22 @@ void AArch64FrameLowering::emitEpilogue(MachineFunction &MF,
// may clobber), convert it to a post-index ldp.
if (OffsetOp.getImm() == 0 && AfterCSRPopSize >= 0) {
convertCalleeSaveRestoreToSPPrePostIncDec(
- MBB, Pop, DL, TII, PrologueSaveSize, NeedsWinCFI, &HasWinCFI, EmitCFI,
- MachineInstr::FrameDestroy, PrologueSaveSize);
+ MBB, Pop, DL, TII, ProloguePopSize, NeedsWinCFI, &HasWinCFI, EmitCFI,
+ MachineInstr::FrameDestroy, ProloguePopSize);
+ } else if (FPAfterSVECalleeSaves) {
+ // If not, and FPAfterSVECalleeSaves is enabled, deallocate callee-save
+ // non-SVE registers to move the stack pointer to the start of the SVE
+ // area.
+ emitFrameOffset(MBB, std::next(Pop), DL, AArch64::SP, AArch64::SP,
+ StackOffset::getFixed(ProloguePopSize), TII,
+ MachineInstr::FrameDestroy, false, NeedsWinCFI,
+ &HasWinCFI);
----------------
MacDue wrote:
That does not hit this specific case. You only enter the "If not, and FPAfterSVECalleeSaves is enabled,..." block if the pop can't be folded into a post-decrement (but it almost always can).
https://github.com/llvm/llvm-project/pull/156452
More information about the llvm-commits
mailing list