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_gprs
intocallee_saved_regs
and make it not specific to GPRs (this appears needed for saving XMM registers on windows_fastcall too).- Refactor this
callee_saved_regs
from being a private function to being a function in theTargetIsa
trait, so that we can access thecallee_saved_gprs
from other places in the code.- Make the code mentioned above in spilling.rs consult the
TargetIsa
'scallee_saved_regs
set and skip spilling registers in the callee-saved set.
Last updated: Oct 23 2024 at 20:03 UTC