[MLton] Vector len passed to MakeFormalsRel

Stephen Weeks MLton@mlton.org
Mon, 1 Mar 2004 13:08:19 -0800


> I  don't  know  if this is relevant, but I remember long ago when Stephen had
> some early polyvariance in the compiler, that it turned out that it was  VERY
> important to do a kind of redundant argument analysis.  The problem was, as I
> recall, that flattening was passing the `same' argument many  times  (in  the
> same call).  Could that be happening here?

I think that part of the problem could be that the same variable that
appears in many different closures, then appears many times
(redundantly) once all the closures are completely flattened.
Someday, hopefully someone will have time to try out my flatter
closure conversion, which would eliminate that problem (possibly
introducing other problems :-).

The particular problem that you are thinking of is long gone, now that
we do the polyvariance before control-flow analysis.  When we did them
together, due to some vagary of the closure conversion that I can no
longer recall, the environment often got (redundantly) passed as two
different arguments, and so it was important for redundant to
eliminate that.  I have no idea if redundant does anything useful any
more.