Import Upstream version 20180207
[hcoop/debian/mlton.git] / doc / guide / localhost / SSA
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta name="generator" content="AsciiDoc 8.6.9">
6 <title>SSA</title>
7 <link rel="stylesheet" href="./asciidoc.css" type="text/css">
8 <link rel="stylesheet" href="./pygments.css" type="text/css">
9
10
11 <script type="text/javascript" src="./asciidoc.js"></script>
12 <script type="text/javascript">
13 /*<![CDATA[*/
14 asciidoc.install();
15 /*]]>*/
16 </script>
17 <link rel="stylesheet" href="./mlton.css" type="text/css">
18 </head>
19 <body class="article">
20 <div id="banner">
21 <div id="banner-home">
22 <a href="./Home">MLton 20180207</a>
23 </div>
24 </div>
25 <div id="header">
26 <h1>SSA</h1>
27 </div>
28 <div id="content">
29 <div id="preamble">
30 <div class="sectionbody">
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
32 <a href="ClosureConvert">ClosureConvert</a>, optimized by <a href="SSASimplify">SSASimplify</a>, and translated by
33 <a href="ToSSA2">ToSSA2</a> to <a href="SSA2">SSA2</a>.</p></div>
34 </div>
35 </div>
36 <div class="sect1">
37 <h2 id="_description">Description</h2>
38 <div class="sectionbody">
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>.
40 It is the main <a href="IntermediateLanguage">IntermediateLanguage</a> used for optimizations.</p></div>
41 <div class="paragraph"><p>An <a href="SSA">SSA</a> program consists of a collection of datatype declarations,
42 a sequence of global statements, and a collection of functions, along
43 with a distinguished "main" function. Each function consists of a
44 collection of basic blocks, where each basic block is a sequence of
45 statements ending with some control transfer.</p></div>
46 </div>
47 </div>
48 <div class="sect1">
49 <h2 id="_implementation">Implementation</h2>
50 <div class="sectionbody">
51 <div class="ulist"><ul>
52 <li>
53 <p>
54 <a href="https://github.com/MLton/mlton/blob/master/mlton/ssa/ssa.sig"><span class="monospaced">ssa.sig</span></a>
55 </p>
56 </li>
57 <li>
58 <p>
59 <a href="https://github.com/MLton/mlton/blob/master/mlton/ssa/ssa.fun"><span class="monospaced">ssa.fun</span></a>
60 </p>
61 </li>
62 <li>
63 <p>
64 <a href="https://github.com/MLton/mlton/blob/master/mlton/ssa/ssa-tree.sig"><span class="monospaced">ssa-tree.sig</span></a>
65 </p>
66 </li>
67 <li>
68 <p>
69 <a href="https://github.com/MLton/mlton/blob/master/mlton/ssa/ssa-tree.fun"><span class="monospaced">ssa-tree.fun</span></a>
70 </p>
71 </li>
72 </ul></div>
73 </div>
74 </div>
75 <div class="sect1">
76 <h2 id="_type_checking">Type Checking</h2>
77 <div class="sectionbody">
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>,
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
80 verifies the following:</p></div>
81 <div class="ulist"><ul>
82 <li>
83 <p>
84 no duplicate definitions (tycons, cons, vars, labels, funcs)
85 </p>
86 </li>
87 <li>
88 <p>
89 no out of scope references (tycons, cons, vars, labels, funcs)
90 </p>
91 </li>
92 <li>
93 <p>
94 variable definitions dominate variable uses
95 </p>
96 </li>
97 <li>
98 <p>
99 case transfers are exhaustive and irredundant
100 </p>
101 </li>
102 <li>
103 <p>
104 <span class="monospaced">Enter</span>/<span class="monospaced">Leave</span> profile statements match
105 </p>
106 </li>
107 <li>
108 <p>
109 "traditional" well-typedness
110 </p>
111 </li>
112 </ul></div>
113 </div>
114 </div>
115 <div class="sect1">
116 <h2 id="_details_and_notes">Details and Notes</h2>
117 <div class="sectionbody">
118 <div class="paragraph"><p>SSA is an abbreviation for Static Single Assignment.</p></div>
119 <div class="paragraph"><p>For some initial design discussion, see the thread at:</p></div>
120 <div class="ulist"><ul>
121 <li>
122 <p>
123 <a href="http://mlton.org/pipermail/mlton/2001-August/019689.html">http://mlton.org/pipermail/mlton/2001-August/019689.html</a>
124 </p>
125 </li>
126 </ul></div>
127 <div class="paragraph"><p>For some retrospectives, see the threads at:</p></div>
128 <div class="ulist"><ul>
129 <li>
130 <p>
131 <a href="http://mlton.org/pipermail/mlton/2003-January/023054.html">http://mlton.org/pipermail/mlton/2003-January/023054.html</a>
132 </p>
133 </li>
134 <li>
135 <p>
136 <a href="http://mlton.org/pipermail/mlton/2007-February/029597.html">http://mlton.org/pipermail/mlton/2007-February/029597.html</a>
137 </p>
138 </li>
139 </ul></div>
140 </div>
141 </div>
142 </div>
143 <div id="footnotes"><hr></div>
144 <div id="footer">
145 <div id="footer-text">
146 </div>
147 <div id="footer-badges">
148 </div>
149 </div>
150 </body>
151 </html>