<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="generator" content="AsciiDoc 8.6.10">
<title>LLVMCodegen</title>
<link rel="stylesheet" href="./asciidoc.css" type="text/css">
<link rel="stylesheet" href="./pygments.css" type="text/css">


<script type="text/javascript" src="./asciidoc.js"></script>
<script type="text/javascript">
/*<![CDATA[*/
asciidoc.install();
/*]]>*/
</script>
<link rel="stylesheet" href="./mlton.css" type="text/css">
</head>
<body class="article">
<div id="banner">
<div id="banner-home">
<a href="./Home">MLton 20201002</a>
</div>
</div>
<div id="header">
<h1>LLVMCodegen</h1>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="paragraph"><p>The <a href="LLVMCodegen">LLVMCodegen</a> is a <a href="Codegen">code generator</a> that translates the
<a href="Machine">Machine</a> <a href="IntermediateLanguage">IntermediateLanguage</a> to <a href="LLVM">LLVM</a> assembly, which is
further optimized and compiled to native object code by the <a href="LLVM">LLVM</a>
toolchain.</p></div>
<div class="paragraph"><p>It requires <a href="LLVM">LLVM</a> version 3.7 or greater to be installed.</p></div>
<div class="paragraph"><p>In benchmarks performed on the <a href="RunningOnAMD64">AMD64</a> architecture,
code size with this generator is usually slightly smaller than either
the <a href="AMD64Codegen">native</a> or the <a href="CCodegen">C</a> code generators. Compile
time is worse than <a href="AMD64Codegen">native</a>, but slightly better than
<a href="CCodegen">C</a>. Run time is often better than either <a href="AMD64Codegen">native</a>
or <a href="CCodegen">C</a>.</p></div>
</div>
</div>
<div class="sect1">
<h2 id="_implementation">Implementation</h2>
<div class="sectionbody">
<div class="ulist"><ul>
<li>
<p>
<a href="https://github.com/MLton/mlton/blob/master/mlton/codegen/llvm-codegen/llvm-codegen.sig"><span class="monospaced">llvm-codegen.sig</span></a>
</p>
</li>
<li>
<p>
<a href="https://github.com/MLton/mlton/blob/master/mlton/codegen/llvm-codegen/llvm-codegen.fun"><span class="monospaced">llvm-codegen.fun</span></a>
</p>
</li>
</ul></div>
</div>
</div>
<div class="sect1">
<h2 id="_details_and_notes">Details and Notes</h2>
<div class="sectionbody">
<div class="paragraph"><p>The <a href="LLVMCodegen">LLVMCodegen</a> was initially developed by Brian Leibig (see
<a href="References#Leibig13">An LLVM Back-end for MLton</a>).</p></div>
</div>
</div>
</div>
<div id="footnotes"><hr></div>
<div id="footer">
<div id="footer-text">
</div>
<div id="footer-badges">
</div>
</div>
</body>
</html>
