RSSA
Stephen Weeks
MLton@sourcelight.com
Mon, 7 Jan 2002 16:55:40 -0800
The general principle that I would like to apply is to express as many
of the limit check optimizations as we can in RSSA/MACHINE, before the
codegens. Using that principle ...
> What it basically comes down to is should I special case:
>
> Array {numElts, bytesPerElt as 0, extraBytes as 0}
This should be turned into a heap limit check by the backend.
> or will we turn this into a Heap limit check for 0 bytes and just special
> case
>
> Heap {bytes as 0, stackToo}
This should be special cased by the codegen to avoid the add.
> Likewise, I could imagine turning
>
> Array {numElts as Operand.Int numElts', bytesPerElt, extraBytes}
>
> into a standard Heap check.
Agreed -- this will be handled by limit check insertion, so that the
codegen will never see such things.
> But, I don't know how this figures in with your notion of checking limit
> check insertions; I would imagine leaving Array kinds associated with
> Array allocations would make it easier.
I doubt that it matters much. The code that inserts the limit checks
will see the Operand.Int's and the code that checks it can see them
just as easily.