  A long-standing practical challenge in the optimization of higher-order
languages is inlining functions with free variables. Inlining code statically
at a function call site is safe if the compiler can guarantee that the free
variables have the same bindings at the inlining point as they do at the point
where the function is bound as a closure (code and free variables). There have
been many attempts to create a heuristic to check this correctness condition,
from Shivers' kCFA-based reflow analysis to Might's Delta-CFA and anodization,
but all of those have performance unsuitable for practical compiler
implementations. In practice, modern language implementations rely on a series
of tricks to capture some common cases (e.g., closures whose free variables are
only top-level identifiers such as +) and rely on hand-inlining by the
programmer for anything more complicated.
  This work provides the first practical, general approach for inlining
functions with free variables. We also provide a proof of correctness, an
evaluation of both the execution time and performance impact of this
optimization, and some tips and tricks for implementing an efficient and
precise control-flow analysis.
