4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta name="generator" content="AsciiDoc 8.6.9">
6 <title>PolyHash</title>
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="PolyHash">PolyHash</a> is an optimization pass for the <a href="SSA">SSA</a>
32 <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="SSASimplify">SSASimplify</a>.</p></div>
36 <h2 id="_description">Description</h2>
37 <div class="sectionbody">
38 <div class="paragraph"><p>This pass implements polymorphic, structural hashing.</p></div>
42 <h2 id="_implementation">Implementation</h2>
43 <div class="sectionbody">
44 <div class="ulist"><ul>
47 <a href="https://github.com/MLton/mlton/blob/master/mlton/ssa/poly-hash.fun"><span class="monospaced">poly-hash.fun</span></a>
54 <h2 id="_details_and_notes">Details and Notes</h2>
55 <div class="sectionbody">
56 <div class="paragraph"><p>For each datatype, tycon, and vector type, it builds and equality
57 function and translates calls to <span class="monospaced">MLton_hash</span> into calls to that
59 <div class="paragraph"><p>For tuples, it does the equality test inline; i.e., it does not create
60 a separate equality function for each tuple type.</p></div>
61 <div class="paragraph"><p>All equality functions are created only if necessary, i.e., if
62 equality is actually used at a type.</p></div>
66 <div id="footnotes"><hr></div>
68 <div id="footer-text">
70 <div id="footer-badges">