MLton

Inline is an optimization pass for the SSA IntermediateLanguage, invoked from SSASimplify.

Description

This pass inlines SSA functions using a size-based metric.

Implementation

Details and Notes

The Inline pass can be invoked to use one of three metrics:

  • NonRecursive(product, small) — inline any function satisfying (numCalls - 1) * (size - small) ⇐ product, where numCalls is the static number of calls to the function and size is the size of the function.

  • Leaf(size) — inline any leaf function smaller than size

  • LeafNoLoop(size) — inline any leaf function without loops smaller than size