Benjamin Goldberg <[EMAIL PROTECTED]> wrote:
> I would expect a large majority of parrot subroutines to *not* use all
> four register types.

> How difficult would it be to make imcc detect when less than 4 register
> types were used in a subroutine, and replace a call to "saveall" with an
> appropriate combination of "pushi", "pushs", "pushp", and "pushn" (and
> likewise with "restoreall")?

Easy for stack calling conventions, almost impossible for parrot calling
conventions, where the caller basically doesn't know, what the
subroutines register usage is.

> ... I've been looking at the optomizer, and it
> hurts my head to try and understand it.

This is currently just a playground to see, what info/data structures
are necessary, to implement a real optimizer ;-)

> Perhaps more importantly, could continuations be made to *not*
> save/restore all four register types, and instead only save/restore
> those types that we ask it to save/restore?

Not generally. Only a call to a leaf could somehow benefit from this.
OTOH, when there is some register usage info in the ("compiled")
function prototype, imcc could emit code to only save certain kinds of
registers, if all called subroutines down the call chain are known.

leo

Reply via email to