[MLton] leaf inlining

Matthew Fluet fluet at tti-c.org
Mon Jun 25 05:20:12 PDT 2007

skaller wrote:
> On Sun, 2007-06-24 at 22:46 -0500, Matthew Fluet wrote:
>> I added an introduceLoops pass before inlining, since inlining can't be 
>> applied to recursive functions (and recursive functions aren't leaf).
> Huh? Is Mlton only inlining non-recursive leaves?

In the leafInline optimization pass, yes.  In the later general inlining 
pass, there is a more permissive inlining heuristic.

In MLton, a function is inlined at all of its call sites, or not at all. 
  So, recursive functions may never be inlined.

> When you say 'pass' is this a single operation applied to
> the whole program?

An SSA optimization pass is an SSA IL program to SSA IL program 

> Is there any ordering?

There is a fixed sequence of optimization passes, applied in order.
See 'ssaPassesDefault' in:

More information about the MLton mailing list