<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="generator" content="AsciiDoc 8.6.8">
<title>Inline</title>
<link rel="stylesheet" href="./asciidoc.css" type="text/css">
<link rel="stylesheet" href="./pygments.css" type="text/css">


<script type="text/javascript" src="./asciidoc.js"></script>
<script type="text/javascript">
/*<![CDATA[*/
asciidoc.install();
/*]]>*/
</script>
<link rel="stylesheet" href="./mlton.css" type="text/css"/>
</head>
<body class="article">
<div id="banner">
<div id="banner-home">
<a href="./Home">MLton 20130715</a>
</div>
</div>
<div id="header">
<h1>Inline</h1>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="paragraph"><p><a href="Inline">Inline</a> is an optimization pass for the <a href="SSA">SSA</a>
<a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="SSASimplify">SSASimplify</a>.</p></div>
</div>
</div>
<div class="sect1">
<h2 id="_description">Description</h2>
<div class="sectionbody">
<div class="paragraph"><p>This pass inlines <a href="SSA">SSA</a> functions using a size-based metric.</p></div>
</div>
</div>
<div class="sect1">
<h2 id="_implementation">Implementation</h2>
<div class="sectionbody">
<div class="ulist"><ul>
<li>
<p>
<a href="https://github.com/MLton/mlton/blob/master/mlton/ssa/inline.sig"><span class="monospaced">inline.sig</span></a>
</p>
</li>
<li>
<p>
<a href="https://github.com/MLton/mlton/blob/master/mlton/ssa/inline.fun"><span class="monospaced">inline.fun</span></a>
</p>
</li>
</ul></div>
</div>
</div>
<div class="sect1">
<h2 id="_details_and_notes">Details and Notes</h2>
<div class="sectionbody">
<div class="paragraph"><p>The <a href="Inline">Inline</a> pass can be invoked to use one of three metrics:</p></div>
<div class="ulist"><ul>
<li>
<p>
<span class="monospaced">NonRecursive(product, small)</span>&#8201;&#8212;&#8201;inline any function satisfying <span class="monospaced">(numCalls - 1) * (size - small) &lt;= product</span>, where <span class="monospaced">numCalls</span> is the static number of calls to the function and <span class="monospaced">size</span> is the size of the function.
</p>
</li>
<li>
<p>
<span class="monospaced">Leaf(size)</span>&#8201;&#8212;&#8201;inline any leaf function smaller than <span class="monospaced">size</span>
</p>
</li>
<li>
<p>
<span class="monospaced">LeafNoLoop(size)</span>&#8201;&#8212;&#8201;inline any leaf function without loops smaller than <span class="monospaced">size</span>
</p>
</li>
</ul></div>
</div>
</div>
</div>
<div id="footnotes"><hr></div>
<div id="footer">
<div id="footer-text">
</div>
<div id="footer-badges">
</div>
</div>
</body>
</html>
