Callee-saved registers
D.Sturm
D.Sturm42 at gmail.com
Wed Sep 18 11:17:25 PDT 2013
What is the best way to handle callee saved registers in the backend? This
doesn't seem to be handled by the register allocator already (since AMD64
declares all registers caller saved and SPARC has its handy register
windows).
The easiest solution seems to introduce a placeholder LIR instruction in
the prologue and make sure to spill all destroyed registers there on the
stack and then restore them at the exit points. But that is obviously not
especially efficient if there's more than one exit point (I'd have to
save/restore all potentially destroyed registers).
So is there some way to get the register allocator to spill callee-saved
registers before using them and then restoring them at the end?
-Daniel
More information about the graal-dev
mailing list