non-tail returns

Stephen Weeks MLton@sourcelight.com
Fri, 26 Oct 2001 09:25:51 -0700


> Anyways, here are the benchmark results:
...
> Unfortunately, the new non-tail returns do almost nothing; and where they
> are doing something, they seem to hurt.  Not quite sure why; in theory,
> the change in return convention should improve some things.
> 
> Here are a couple of notes.  Nothing forces all of the continuation
> formals to be stack allocated.

Yeah, I had definitely intended for this to be part of it, and to
combine with native-live-stack true.

> On the other hand, for a return, there is no interference when moving the
> return values into their return location below the top of the stack.

I guess it would help to have the callee do a little lookahead and use
some negative stack offsets to store its results directly in the right
place.

I agree with your conclusions.  I also observe from those numbers that
I really want -native-live-stack true.  Those are some nice speedups.
Maybe we could put some hack in that uses -native-live-stack true for
programs with fewer than N statements (where N =~ 10000)?