4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta name="generator" content="AsciiDoc 8.6.9">
7 <link rel="stylesheet" href="./asciidoc.css" type="text/css">
8 <link rel="stylesheet" href="./pygments.css" type="text/css">
11 <script type="text/javascript" src="./asciidoc.js"></script>
12 <script type="text/javascript">
17 <link rel="stylesheet" href="./mlton.css" type="text/css">
19 <body class="article">
21 <div id="banner-home">
22 <a href="./Home">MLton 20180207</a>
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>
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>
49 <h2 id="_implementation">Implementation</h2>
50 <div class="sectionbody">
51 <div class="ulist"><ul>
54 <a href="https://github.com/MLton/mlton/blob/master/mlton/ssa/ssa.sig"><span class="monospaced">ssa.sig</span></a>
59 <a href="https://github.com/MLton/mlton/blob/master/mlton/ssa/ssa.fun"><span class="monospaced">ssa.fun</span></a>
64 <a href="https://github.com/MLton/mlton/blob/master/mlton/ssa/ssa-tree.sig"><span class="monospaced">ssa-tree.sig</span></a>
69 <a href="https://github.com/MLton/mlton/blob/master/mlton/ssa/ssa-tree.fun"><span class="monospaced">ssa-tree.fun</span></a>
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>
84 no duplicate definitions (tycons, cons, vars, labels, funcs)
89 no out of scope references (tycons, cons, vars, labels, funcs)
94 variable definitions dominate variable uses
99 case transfers are exhaustive and irredundant
104 <span class="monospaced">Enter</span>/<span class="monospaced">Leave</span> profile statements match
109 "traditional" well-typedness
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>
123 <a href="http://mlton.org/pipermail/mlton/2001-August/019689.html">http://mlton.org/pipermail/mlton/2001-August/019689.html</a>
127 <div class="paragraph"><p>For some retrospectives, see the threads at:</p></div>
128 <div class="ulist"><ul>
131 <a href="http://mlton.org/pipermail/mlton/2003-January/023054.html">http://mlton.org/pipermail/mlton/2003-January/023054.html</a>
136 <a href="http://mlton.org/pipermail/mlton/2007-February/029597.html">http://mlton.org/pipermail/mlton/2007-February/029597.html</a>
143 <div id="footnotes"><hr></div>
145 <div id="footer-text">
147 <div id="footer-badges">