Skip to content

perf(aarch64): use lr-only linkage frames for simple regular calls#13055

Draft
pnodet wants to merge 2 commits intobytecodealliance:mainfrom
pnodet:aarch64-opt2-lr-only
Draft

perf(aarch64): use lr-only linkage frames for simple regular calls#13055
pnodet wants to merge 2 commits intobytecodealliance:mainfrom
pnodet:aarch64-opt2-lr-only

Conversation

@pnodet
Copy link
Copy Markdown
Contributor

@pnodet pnodet commented Apr 11, 2026

This updates AArch64 prologue/epilogue generation to use an LR-only linkage frame for a narrow set of simple regular-call functions. Instead of always doing stp fp, lr + mov fp, sp and restoring both registers, we now use str/ldr lr with the same 16-byte stack adjustment when it’s safe to do so.

The optimization is intentionally conservative. It does not apply when frame pointers are required, when unwind info is enabled, when return-address signing is enabled, or when the frame layout needs full FP-based setup. In those cases we keep the existing FP/LR path unchanged.

The goal is to trim unnecessary frame setup/teardown work in the common eligible cases while preserving ABI alignment and keeping behavior identical outside that narrow window.

@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator cranelift:area:aarch64 Issues related to AArch64 backend. labels Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift:area:aarch64 Issues related to AArch64 backend. cranelift Issues related to the Cranelift code generator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant