new Cps optimization -- flattening arrays

Stephen Weeks sweeks@wasabi.epr.com
Tue, 21 Dec 1999 13:27:12 -0800 (PST)


> For this transformation to be fast, it is clearly essential that cps sub does
> NOT do the bounds check, otherwise you would do the check twice.

Right.  That is the current state of affairs.

> Are you convinced that the transformation is  always  a  win.   Note,  it  is
> essentially  flattening  out something, and that can cost you.  As a concrete
> example: if I subscript into an (int * int) array,  and  the  result  has  to
> actually  be  a  tuple, then the old code will not have to allocate the tuple
> (because it can share with the array element) while the new code will.

I agree this could happen, but I would be surprised if it happens
much.  And I'd still take the space win anyways.