Import Debian changes 20180207-1
[hcoop/debian/mlton.git] / doc / guide / localhost / SSA
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>SSA</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>SSA</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="SSA">SSA</a> is an <a href="IntermediateLanguage">IntermediateLanguage</a>, translated from <a href="SXML">SXML</a> by\r
32<a href="ClosureConvert">ClosureConvert</a>, optimized by <a href="SSASimplify">SSASimplify</a>, and translated by\r
33<a href="ToSSA2">ToSSA2</a> to <a href="SSA2">SSA2</a>.</p></div>\r
34</div>\r
35</div>\r
36<div class="sect1">\r
37<h2 id="_description">Description</h2>\r
38<div class="sectionbody">\r
39<div class="paragraph"><p><a href="SSA">SSA</a> is a <a href="FirstOrder">FirstOrder</a>, <a href="SimplyTyped">SimplyTyped</a> <a href="IntermediateLanguage">IntermediateLanguage</a>.\r
40It is the main <a href="IntermediateLanguage">IntermediateLanguage</a> used for optimizations.</p></div>\r
41<div class="paragraph"><p>An <a href="SSA">SSA</a> program consists of a collection of datatype declarations,\r
42a sequence of global statements, and a collection of functions, along\r
43with a distinguished "main" function. Each function consists of a\r
44collection of basic blocks, where each basic block is a sequence of\r
45statements ending with some control transfer.</p></div>\r
46</div>\r
47</div>\r
48<div class="sect1">\r
49<h2 id="_implementation">Implementation</h2>\r
50<div class="sectionbody">\r
51<div class="ulist"><ul>\r
52<li>\r
53<p>\r
54<a href="https://github.com/MLton/mlton/blob/master/mlton/ssa/ssa.sig"><span class="monospaced">ssa.sig</span></a>\r
55</p>\r
56</li>\r
57<li>\r
58<p>\r
59<a href="https://github.com/MLton/mlton/blob/master/mlton/ssa/ssa.fun"><span class="monospaced">ssa.fun</span></a>\r
60</p>\r
61</li>\r
62<li>\r
63<p>\r
64<a href="https://github.com/MLton/mlton/blob/master/mlton/ssa/ssa-tree.sig"><span class="monospaced">ssa-tree.sig</span></a>\r
65</p>\r
66</li>\r
67<li>\r
68<p>\r
69<a href="https://github.com/MLton/mlton/blob/master/mlton/ssa/ssa-tree.fun"><span class="monospaced">ssa-tree.fun</span></a>\r
70</p>\r
71</li>\r
72</ul></div>\r
73</div>\r
74</div>\r
75<div class="sect1">\r
76<h2 id="_type_checking">Type Checking</h2>\r
77<div class="sectionbody">\r
78<div class="paragraph"><p>Type checking (<a href="https://github.com/MLton/mlton/blob/master/mlton/ssa/type-check.sig"><span class="monospaced">type-check.sig</span></a>,\r
79<a href="https://github.com/MLton/mlton/blob/master/mlton/ssa/type-check.fun"><span class="monospaced">type-check.fun</span></a>) of a <a href="SSA">SSA</a> program\r
80verifies the following:</p></div>\r
81<div class="ulist"><ul>\r
82<li>\r
83<p>\r
84no duplicate definitions (tycons, cons, vars, labels, funcs)\r
85</p>\r
86</li>\r
87<li>\r
88<p>\r
89no out of scope references (tycons, cons, vars, labels, funcs)\r
90</p>\r
91</li>\r
92<li>\r
93<p>\r
94variable definitions dominate variable uses\r
95</p>\r
96</li>\r
97<li>\r
98<p>\r
99case transfers are exhaustive and irredundant\r
100</p>\r
101</li>\r
102<li>\r
103<p>\r
104<span class="monospaced">Enter</span>/<span class="monospaced">Leave</span> profile statements match\r
105</p>\r
106</li>\r
107<li>\r
108<p>\r
109"traditional" well-typedness\r
110</p>\r
111</li>\r
112</ul></div>\r
113</div>\r
114</div>\r
115<div class="sect1">\r
116<h2 id="_details_and_notes">Details and Notes</h2>\r
117<div class="sectionbody">\r
118<div class="paragraph"><p>SSA is an abbreviation for Static Single Assignment.</p></div>\r
119<div class="paragraph"><p>For some initial design discussion, see the thread at:</p></div>\r
120<div class="ulist"><ul>\r
121<li>\r
122<p>\r
123<a href="http://mlton.org/pipermail/mlton/2001-August/019689.html">http://mlton.org/pipermail/mlton/2001-August/019689.html</a>\r
124</p>\r
125</li>\r
126</ul></div>\r
127<div class="paragraph"><p>For some retrospectives, see the threads at:</p></div>\r
128<div class="ulist"><ul>\r
129<li>\r
130<p>\r
131<a href="http://mlton.org/pipermail/mlton/2003-January/023054.html">http://mlton.org/pipermail/mlton/2003-January/023054.html</a>\r
132</p>\r
133</li>\r
134<li>\r
135<p>\r
136<a href="http://mlton.org/pipermail/mlton/2007-February/029597.html">http://mlton.org/pipermail/mlton/2007-February/029597.html</a>\r
137</p>\r
138</li>\r
139</ul></div>\r
140</div>\r
141</div>\r
142</div>\r
143<div id="footnotes"><hr></div>\r
144<div id="footer">\r
145<div id="footer-text">\r
146</div>\r
147<div id="footer-badges">\r
148</div>\r
149</div>\r
150</body>\r
151</html>\r