akirilov-arm commented on issue #1148:
This optimization has now been implemented in the AArch64 and s390x backends. PR #2960 also included the x64 changes, but we had to revert them because of test failures on macOS.
fitzgen commented on issue #1148:
Closing this as Cranelift supports it now, but not all backends implement it and we have dedicated issues for those backends
fitzgen closed issue #1148:
- What is the feature or code improvement you would like to do in Cranelift? Small functions which don't make usage of the stack will still preserve the stack pointer by saving it into the frame pointer register, which is spurious. It's a few instructions per call which could be removed in general.
- What is the value of adding this in Cranelift? Runtime speedup.
- Do you have an implementation plan, and/or ideas for data structures or
algorithms to use? Have you considered alternative implementations? If so, how are they better
or worse than your proposal? Implementation should be trivial: lookup the number of stack slots
and don't preserve SP if there are no stack slots.
Last updated: Jul 29 2026 at 05:03 UTC