[llvm-dev] ORC JIT Weekly #1
Lang Hames via llvm-dev
llvm-dev at lists.llvm.org
Thu Jan 16 18:00:53 PST 2020
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
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).
Since this is the first update, I have also added some highlights from last year, and the plan for 2020.
Highlights from 2019:
(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 https://llvm.org/docs/ORCv2.html .
(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.
(3) Google Summer of Code student Praveen Velliengiri demonstrated a basic speculative compilation 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 https://preejackie.github.io/GSoC-2019-LLVM).
The plan for 2020:
- Improve JIT support for static initializers:
- Add support for running initializers from object files, which will enable loading and caching of objects containing initializers.
- Improve support for platform-specific initializer kinds like Objective-C +load methods.
- 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.
- Improve adherence to static/dynamic linker rules: Weak symbol resolution across JITDylib boundaries is still not handled correctly.
- Remove ORCv1.
- Bug fixes and documentation improvements.
Status report for this week:
-- 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.
-- There’s a long-ish chat with @drmeister on the discord #llvm channel about RuntimeDyld vs JITLink, and large vs small code model.
-- 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.
-- COFF support in the JIT still lags ELF and MachO (See e.g. http://llvm.org/PR40074). If there are any COFF experts out there who are interested in helping out with JIT bugs please let me know!
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. :)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev