regalloc.rs
regalloc.rs copied to clipboard
Saving/restoring callee-saved regs
From an email from @julian-seward1 :
Is there any mileage in the idea of
implementing save/restore of callee saves regs by simply copying them all into
new virtual regs in the prologue and copying them back in the epilogue? Then
the RA's spilling mechanism will naturally push them to the stack as required.
If we also also told the RA that the associated VRegs have a tiny spill cost
then we'd be pretty sure that these values get "spilled" before any others.