Commit | Line | Data |
---|---|---|
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>SSA2</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 | |
14 | asciidoc.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>SSA2</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="SSA2">SSA2</a> is an <a href="IntermediateLanguage">IntermediateLanguage</a>, translated from <a href="SSA">SSA</a> by\r | |
32 | <a href="ToSSA2">ToSSA2</a>, optimized by <a href="SSA2Simplify">SSA2Simplify</a>, and translated by\r | |
33 | <a href="ToRSSA">ToRSSA</a> to <a href="RSSA">RSSA</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="SSA2">SSA2</a> is a <a href="FirstOrder">FirstOrder</a>, <a href="SimplyTyped">SimplyTyped</a>\r | |
40 | <a href="IntermediateLanguage">IntermediateLanguage</a>, a slight variant of the <a href="SSA">SSA</a>\r | |
41 | <a href="IntermediateLanguage">IntermediateLanguage</a>,</p></div>\r | |
42 | <div class="paragraph"><p>Like <a href="SSA">SSA</a>, an <a href="SSA2">SSA2</a> program consists of a collection of datatype\r | |
43 | declarations, a sequence of global statements, and a collection of\r | |
44 | functions, along with a distinguished "main" function. Each function\r | |
45 | consists of a collection of basic blocks, where each basic block is a\r | |
46 | sequence of statements ending with some control transfer.</p></div>\r | |
47 | <div class="paragraph"><p>Unlike <a href="SSA">SSA</a>, <a href="SSA2">SSA2</a> includes mutable fields in objects and makes\r | |
48 | the vector type constructor n-ary instead of unary. This allows\r | |
49 | optimizations like <a href="RefFlatten">RefFlatten</a> and <a href="DeepFlatten">DeepFlatten</a> to be expressed.</p></div>\r | |
50 | </div>\r | |
51 | </div>\r | |
52 | <div class="sect1">\r | |
53 | <h2 id="_implementation">Implementation</h2>\r | |
54 | <div class="sectionbody">\r | |
55 | <div class="ulist"><ul>\r | |
56 | <li>\r | |
57 | <p>\r | |
58 | <a href="https://github.com/MLton/mlton/blob/master/mlton/ssa/ssa2.sig"><span class="monospaced">ssa2.sig</span></a>\r | |
59 | </p>\r | |
60 | </li>\r | |
61 | <li>\r | |
62 | <p>\r | |
63 | <a href="https://github.com/MLton/mlton/blob/master/mlton/ssa/ssa2.fun"><span class="monospaced">ssa2.fun</span></a>\r | |
64 | </p>\r | |
65 | </li>\r | |
66 | <li>\r | |
67 | <p>\r | |
68 | <a href="https://github.com/MLton/mlton/blob/master/mlton/ssa/ssa-tree2.sig"><span class="monospaced">ssa-tree2.sig</span></a>\r | |
69 | </p>\r | |
70 | </li>\r | |
71 | <li>\r | |
72 | <p>\r | |
73 | <a href="https://github.com/MLton/mlton/blob/master/mlton/ssa/ssa-tree2.fun"><span class="monospaced">ssa-tree2.fun</span></a>\r | |
74 | </p>\r | |
75 | </li>\r | |
76 | </ul></div>\r | |
77 | </div>\r | |
78 | </div>\r | |
79 | <div class="sect1">\r | |
80 | <h2 id="_type_checking">Type Checking</h2>\r | |
81 | <div class="sectionbody">\r | |
82 | <div class="paragraph"><p>Type checking (<a href="https://github.com/MLton/mlton/blob/master/mlton/ssa/type-check2.sig"><span class="monospaced">type-check2.sig</span></a>,\r | |
83 | <a href="https://github.com/MLton/mlton/blob/master/mlton/ssa/type-check2.fun"><span class="monospaced">type-check2.fun</span></a>) of a <a href="SSA2">SSA2</a>\r | |
84 | program verifies the following:</p></div>\r | |
85 | <div class="ulist"><ul>\r | |
86 | <li>\r | |
87 | <p>\r | |
88 | no duplicate definitions (tycons, cons, vars, labels, funcs)\r | |
89 | </p>\r | |
90 | </li>\r | |
91 | <li>\r | |
92 | <p>\r | |
93 | no out of scope references (tycons, cons, vars, labels, funcs)\r | |
94 | </p>\r | |
95 | </li>\r | |
96 | <li>\r | |
97 | <p>\r | |
98 | variable definitions dominate variable uses\r | |
99 | </p>\r | |
100 | </li>\r | |
101 | <li>\r | |
102 | <p>\r | |
103 | case transfers are exhaustive and irredundant\r | |
104 | </p>\r | |
105 | </li>\r | |
106 | <li>\r | |
107 | <p>\r | |
108 | <span class="monospaced">Enter</span>/<span class="monospaced">Leave</span> profile statements match\r | |
109 | </p>\r | |
110 | </li>\r | |
111 | <li>\r | |
112 | <p>\r | |
113 | "traditional" well-typedness\r | |
114 | </p>\r | |
115 | </li>\r | |
116 | </ul></div>\r | |
117 | </div>\r | |
118 | </div>\r | |
119 | <div class="sect1">\r | |
120 | <h2 id="_details_and_notes">Details and Notes</h2>\r | |
121 | <div class="sectionbody">\r | |
122 | <div class="paragraph"><p>SSA is an abbreviation for Static Single Assignment.</p></div>\r | |
123 | </div>\r | |
124 | </div>\r | |
125 | </div>\r | |
126 | <div id="footnotes"><hr></div>\r | |
127 | <div id="footer">\r | |
128 | <div id="footer-text">\r | |
129 | </div>\r | |
130 | <div id="footer-badges">\r | |
131 | </div>\r | |
132 | </div>\r | |
133 | </body>\r | |
134 | </html>\r |