<div dir="ltr"><div>Excellent initiative. Thanks, Lang! We are grateful for any high-level JIT-related info you see fit to provide, as it avoids us having to bother people on the mailing list or try to figure out how the source code works...</div><div><br></div><div>Geoff<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 17, 2020 at 3:00 AM Lang Hames <<a href="mailto:lhames@gmail.com">lhames@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div dir="ltr">Hi All,<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><br></div><div>In the interests of improving visibility into ORC JIT development I'm going to try writing weekly status updates for the community. I hope they will provide insight into the design and state of development of LLVM's JIT APIs, as well as serving as a convenient space for discussions among LLVM's large and growing community of JIT API users. The </div><div>length and detail will vary (depending on how much work I've gotten through, and how long I can dedicate to writing the update), but if people find the updates valuable I will make an effort to write at least something. Questions and comments are most welcome (both on the format, and on the content).</div><div><br></div><div>Since this is the first update, I have also added some highlights from last year, and the plan for 2020.</div><div><br></div><div><i>Highlights from 2019</i>:</div><div><br></div><div>(1) ORCv1 was officially deprecated in LLVM 9. I have left it in for the LLVM 10 branch, but plan to remove it from master in the coming weeks. All development effort is now focused on ORCv2. If you are an ORCv1 client, now's the time to switch over. If you need help please ask on the llvm-dev mailing lists (make sure you CC me) or #llvm on discord. There are also some tips available in <a href="https://llvm.org/docs/ORCv2.html" target="_blank">https://llvm.org/docs/ORCv2.html</a> .</div><div><br></div><div>(2) LLVM has a new JIT linker, JITLink, which is intended as an eventual replacement for RuntimeDyld. The new design supports linker plugins (allowing operation on the low-level bits generated by the JIT linker) and native code models (RuntimeDyld required a custom code model on some platforms). Currently JITLink only supports Darwin x86-64 and arm64, but I hope to see support for new platforms added in the future.</div><div> </div><div>(3) Google Summer of Code student Praveen Velliengiri demonstrated a basic <i>speculative compilation</i> system built on ORCv2. This system analyses code added to the JIT and triggers early compilation on background threads for code that is likely to be used at runtime. Using this system Praveen was able to demonstrate significant speedups on JIT execution of some SPEC benchmarks. He presented this work at the 2019 LLVM Developer's Meeting in San Jose (see <a href="https://preejackie.github.io/GSoC-2019-LLVM" target="_blank">https://preejackie.github.io/GSoC-2019-LLVM</a>).</div><div><br></div><div><i>The plan for 2020</i>:</div><div><br></div><div>- Improve JIT support for static initializers:</div><div> - Add support for running initializers from object files, which will enable loading and caching of objects containing initializers.</div><div> - Improve support for platform-specific initializer kinds like Objective-C +load methods.</div><div> - Switch from a push (“runConstructors”) to a pull model (“getConstructorsToRun”) for initializer execution. This will allow JIT’d code to “dlopen” other JIT’d code and run the initializers on the expected thread, which is important for JIT’ing code that uses threads and locks in initializers.</div><div><br></div><div>- Improve adherence to static/dynamic linker rules: Weak symbol resolution across JITDylib boundaries is still not handled correctly.</div><div><br></div><div>- Remove ORCv1.</div><div><br></div><div>- Bug fixes and documentation improvements.</div><div><br></div><div><i>Status report for this week</i>:<br></div><div><br></div><div>-- I’ve been working on a generic implementation of the new initialization APIs which I hope to be able to land next week. This will replace the runConstructors/runDestructors API in LLJIT (providing equivalent functionality: initializers will be discovered by scanning llvm.global_ctors/llvm.global_dtors), and will enable the development of platform specific initializer-support implementations.</div><div><br></div><div>-- There’s a long-ish chat with @drmeister on the discord #llvm channel about RuntimeDyld vs JITLink, and large vs small code model.</div><div><br></div><div>-- I have added a new LLJIT example program that demonstrates how to use lazy-reexports in ORCv2 to add lazy compilation: llvm/examples/LLJITExamples/LLJITWithLazyReexports.<br></div><div><br></div><div>-- COFF support in the JIT still lags ELF and MachO (See e.g. <a href="https://bugs.llvm.org/show_bug.cgi?id=40074" target="_blank">http://llvm.org/PR40074</a>). If there are any COFF experts out there who are interested in helping out with JIT bugs please let me know!</div><div><br></div><div>Ok -- that’s enough from me for now. If you’re a JIT user, developer, or just casual JIT-development observer (dblaikie), and you have questions, comments, or just feel like introducing yourself: jump on in. :)</div><div><br></div><div>Lang.</div></div></div></div></div>
</div></div></div></div></blockquote></div>