<div dir="ltr">This is really cool! +CC Philip and Sanjoy who have been quite active lately upstream on improving LLVM for this sort of use case.<div><br></div><div>-- Sean Silva</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 13, 2015 at 11:14 PM, Russell Hadley <span dir="ltr"><<a href="mailto:rhadley@microsoft.com" target="_blank">rhadley@microsoft.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="#0563C1" vlink="#954F72">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black;background:#f8f8f8">The LLILC project (we pronounce it "lilac") is a new effort started at Microsoft to produce MSIL code generators based on LLVM and targeting
 the open source dotnet<span> </span></span>CoreCLR (<a href="https://github.com/dotnet/coreclr" target="_blank">https://github.com/dotnet/coreclr</a>)<span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black;background:#f8f8f8">. We are envisioning using the LLVM infrastructure
 for a number of scenarios, but our first tool is a Just in Time(JIT) compiler for CoreCLR. This new project is being developed on GitHub and you can check it out<span> at
<a href="https://github.com/dotnet/llilc" target="_blank">https://github.com/dotnet/llilc</a></span>.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black;background:#f8f8f8"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black">* Why a new JIT for CoreCLR?<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-right:0in;margin-bottom:12.0pt;margin-left:0in">
<span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black">While the CoreCLR already has a JIT, we saw an opportunity to provide a new code generator that has the potential to run across all the targets and platforms supported by LLVM. To
 enable this, as part of our project we're modifying an MSIL reader that operates directly against the same common JIT interface as the production JIT (RyuJIT). This new JIT will allow any C# program written for the .NET Core class libraries to run on any platform
 that CoreCLR can be ported to and that LLVM will target.<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-right:0in;margin-bottom:12.0pt;margin-left:0in">
<span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black">*Are we planning to do Ahead of Time compilation?<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-right:0in;margin-bottom:12.0pt;margin-left:0in">
<span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black">Yes.  The roadmap for the project includes an AOT tool but we’re still getting our plans together.  There is more detail on this part of the project on the wiki.<u></u><u></u></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black;background:#f8f8f8">* Managed code in LLVM<u></u><u></u></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black;background:#f8f8f8"><u></u> <u></u></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black;background:#f8f8f8">We’ve been having a great experience with LLVM and it’s been super-fast to get the JIT up and running. There are 3
 areas we will need to be expanding support for in LLVM:  managed code centric optimizations, precise garbage collection, and exception handling.  Each one of these areas has a broader treatment on the wiki but briefly we intend to help bring:</span><span style="font-size:11.5pt;font-family:"Segoe UI",sans-serif;color:#212121"><u></u><u></u></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black;background:#f8f8f8"> </span><span style="font-size:11.5pt;font-family:"Segoe UI",sans-serif;color:#212121"><u></u><u></u></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black;background:#f8f8f8">- Optimization of implicit runtime checks that support type safety in C#.</span><span style="font-size:11.5pt;font-family:"Segoe UI",sans-serif;color:#212121"><u></u><u></u></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black;background:#f8f8f8">- Precise garbage collection (we’re building on the statepoint design that’s currently being added to LLVM)</span><span style="font-size:11.5pt;font-family:"Segoe UI",sans-serif;color:#212121"><u></u><u></u></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black;background:#f8f8f8">- Exception handling semantics for C#</span><span style="font-size:11.5pt;font-family:"Segoe UI",sans-serif;color:#212121"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-right:0in;margin-bottom:12.0pt;margin-left:0in">
<span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black;background:#f8f8f8">* What’s working?<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-right:0in;margin-bottom:12.0pt;margin-left:0in">
<span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black;background:#f8f8f8">Today on Windows we have the MSIL reader & LLVM JIT implemented well enough to compile a significant number of methods in the JIT bring up tests included in CoreCLR.
 In these tests we compile about 90% the methods and then fall back to RyuJIT for cases we can't handle yet. The testing experience is pretty decent for developers. The tests we run can be seen in the CoreCLR test repo.<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-right:0in;margin-bottom:12.0pt;margin-left:0in">
<span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black">Please check out our wiki for more info.  (<a href="https://github.com/dotnet/llilc/wiki" target="_blank">https://github.com/dotnet/llilc/wiki</a>)<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-right:0in;margin-bottom:12.0pt;margin-left:0in">
<span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black">Thanks,<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-right:0in;margin-bottom:12.0pt;margin-left:0in">
<span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black">Russell<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>

<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>