Backport from sid to buster
[hcoop/debian/mlton.git] / doc / guide / localhost / Inline
CommitLineData
7f918cf1
CE
1<!DOCTYPE html>\r
2<html lang="en">\r
3<head>\r
4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\r
5<meta name="generator" content="AsciiDoc 8.6.9">\r
6<title>Inline</title>\r
7<link rel="stylesheet" href="./asciidoc.css" type="text/css">\r
8<link rel="stylesheet" href="./pygments.css" type="text/css">\r
9\r
10\r
11<script type="text/javascript" src="./asciidoc.js"></script>\r
12<script type="text/javascript">\r
13/*<![CDATA[*/\r
14asciidoc.install();\r
15/*]]>*/\r
16</script>\r
17<link rel="stylesheet" href="./mlton.css" type="text/css">\r
18</head>\r
19<body class="article">\r
20<div id="banner">\r
21<div id="banner-home">\r
22<a href="./Home">MLton 20180207</a>\r
23</div>\r
24</div>\r
25<div id="header">\r
26<h1>Inline</h1>\r
27</div>\r
28<div id="content">\r
29<div id="preamble">\r
30<div class="sectionbody">\r
31<div class="paragraph"><p><a href="Inline">Inline</a> is an optimization pass for the <a href="SSA">SSA</a>\r
32<a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="SSASimplify">SSASimplify</a>.</p></div>\r
33</div>\r
34</div>\r
35<div class="sect1">\r
36<h2 id="_description">Description</h2>\r
37<div class="sectionbody">\r
38<div class="paragraph"><p>This pass inlines <a href="SSA">SSA</a> functions using a size-based metric.</p></div>\r
39</div>\r
40</div>\r
41<div class="sect1">\r
42<h2 id="_implementation">Implementation</h2>\r
43<div class="sectionbody">\r
44<div class="ulist"><ul>\r
45<li>\r
46<p>\r
47<a href="https://github.com/MLton/mlton/blob/master/mlton/ssa/inline.sig"><span class="monospaced">inline.sig</span></a>\r
48</p>\r
49</li>\r
50<li>\r
51<p>\r
52<a href="https://github.com/MLton/mlton/blob/master/mlton/ssa/inline.fun"><span class="monospaced">inline.fun</span></a>\r
53</p>\r
54</li>\r
55</ul></div>\r
56</div>\r
57</div>\r
58<div class="sect1">\r
59<h2 id="_details_and_notes">Details and Notes</h2>\r
60<div class="sectionbody">\r
61<div class="paragraph"><p>The <a href="Inline">Inline</a> pass can be invoked to use one of three metrics:</p></div>\r
62<div class="ulist"><ul>\r
63<li>\r
64<p>\r
65<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.\r
66</p>\r
67</li>\r
68<li>\r
69<p>\r
70<span class="monospaced">Leaf(size)</span>&#8201;&#8212;&#8201;inline any leaf function smaller than <span class="monospaced">size</span>\r
71</p>\r
72</li>\r
73<li>\r
74<p>\r
75<span class="monospaced">LeafNoLoop(size)</span>&#8201;&#8212;&#8201;inline any leaf function without loops smaller than <span class="monospaced">size</span>\r
76</p>\r
77</li>\r
78</ul></div>\r
79</div>\r
80</div>\r
81</div>\r
82<div id="footnotes"><hr></div>\r
83<div id="footer">\r
84<div id="footer-text">\r
85</div>\r
86<div id="footer-badges">\r
87</div>\r
88</div>\r
89</body>\r
90</html>\r