alexcrichton transferred Issue #455:
Currently, cranelift spills all registers across calls, without regard to whether they're callee-saved.
However the nice thing about callee-saved registers is that they're saved across calls ;-), and Cranelift indeed supports the callee side of this.
At a high level, the steps here are:
- Generalize x86's
callee_saved_gprsintocallee_saved_regsand make it not specific to GPRs (this appears needed for saving XMM registers on windows_fastcall too).- Refactor this
callee_saved_regsfrom being a private function to being a function in theTargetIsatrait, so that we can access thecallee_saved_gprsfrom other places in the code.- Make the code mentioned above in spilling.rs consult the
TargetIsa'scallee_saved_regsset and skip spilling registers in the callee-saved set.
Last updated: Dec 17 2025 at 03:29 UTC