ICFP?

Stephen Weeks MLton@sourcelight.com
Mon, 10 Sep 2001 16:07:09 -0700


> I certainly don't intend to argue that SSA makes the raise=>jump better.

Did I miss a mail that led to this response?

> The example I was thinking of though was simpler.  If you have a  fold  (over
> lists  say)  and  you  now want to exit the loop early, the easiest way is to
> have the folder function raise an exception and handle the call to fold.   In
> the  absence  of  inlining fold, this is really going to have to use the full
> exception handling mechanism to pop off the frame of the folder procedure and
> of  the  fold procedure.  In MLton, if both fold and the folder procedure are
> inlined (which they almost always are) then the  raise  in  the  folder  just
> turns  into  a jump out of the loop (thanks to the raise=>jump optimization).
> Without inlining, this optimization would basically never trigger because  no
> one  is  going  to  write  code to do a raise for this. 

Actually, it does happen with handling Overflow, but other than that, I agree.

> In MLton it IS a win
> because the raise can only be seen to be a jump after inlining.

> Just to be completely explicit:
...
> In MLton, this should generate good code.

Yep.