ORC JIT Update / Office Hours -- September 2022

Hi All,

As discussed in RFC - LLVM JIT Office Hours / Updates I’m going to try holding regular LLVM JIT office hours starting this month. The first session this month will be held on Monday September 26th 2022, from 8AM to 9AM PDT. I will post a zoom link in the thread below. If you have questions or comments about ORC, or just want to chat about the project, please come along!

I also want to mention some of the updates to the APIs since the last ORC JIT Weekly email. We can’t cover everything that’s happened since then, but I’d like to mention a few highlights:

Windows Support

GSoC student Sunho Kim has written JITLink and ORC runtime support for the COFF object format, including a COFF LinkGraph builder and COFF/x86-64 backend. This is a huge leap forward for Windows support in ORC – Windows users will now be able to use native COFF objects, rather than running under MinGW or ELF-win32 triples. There are still a handful of APIs that need to be updated before we can switch to JITLink for COFF by default, but we expect to be able to make that switch in the next month or so.

In addition to enabling Windows support on x86-64, Sunho’s COFFLinkGraphBuilder should make it easy to extend Windows support to new architectures by adding further COFF backends.

ELF/aarch64 Support

Sunho has also written an ELF/aarch64 backend, extending Linux support to AArch64 and including support for TLSDESC thread locals.

Slab Allocation and Shared Memory

GSoC student Anubhab Ghosh has written a new JITLinkMemoryManager implementation, the MapperJITLinkMemoryManager, that supports slab reservation and pluggable mappers to perform the actual memory allocation (like a much-improved version of MCJIT’s SectionMemoryManager). By reserving slabs up front Anubhab’s allocator can guarantee that range constraints for small code model are satisfied, allowing clients to load arbitrary small code model code safely under ORC. Anubhab’s implementation includes built-in support for in-process memory allocation, cross-process allocation via EPC calls, and cross-process allocation using POSIX and Win32 shared memory.

The MapperJITLinkMemoryManager class is a big step forward for memory allocation in ORC, making it both safer and easier for clients to deal with range constraints and out-of-process allocation. The llvm-jitlink tool has already been updated to use it, and once we have gotten some more experience with this allocator in-tree I expect it to replace InProcessJITLinkMemoryManager as the default allocator for ORC.

OrcTargetProcess is moving to the ORC runtime

OrcTargetProcess is an LLVM library containing executor-side functionality required for ORC (as opposed to the ORC library itself, which lives in the controller process). In PR56603 I have proposed that we move OrcTargetProcess’s functionality into the ORC runtime. The first steps in this direction are being taken now.

Beyond these major updates work continues on regular bug fixes and features. Themes for the LLVM 16 cycle will probably be (1) Refactoring OrcTargetProcess (see above), (2) moving to JITLink by default on more platforms, (3) fixing some low-hanging performance bugs.

And since work is very actively continuing, I hope you’ll jump in with bug reports and patches if you have them. :slight_smile:

Happy JITing everyone!

– Lang.

5 Likes

Hi,

The new memory manager is enabled by default in llvm-jitlink when running in the same process. When running out of process with --oop-executor= or --oop-executor-connect= shared memory can be enabled by adding the flag --use-shared-memory.
The default slab size for now is 1GiB on Unix-like platforms. However on Windows as memory over-commit is not very well supported/recommended, the default slab granularity is set to multiples of 1MiB and can be overridden with --slab-allocate= for best results.

Anubhab

2 Likes

Zoom Link:

Google calendar event here.

1 Like

Hi All,

Just a reminder that the first JIT office hours will be held on Monday 26th (next week) from 8AM to 9AM PDT. You’ll find the Zoom Link for the meeting in the message above.

I’ll start the meeting with a brief update on the status of the JIT and current development plans, then we’ll move to general questions and discussion.

Bring your questions if you have them, otherwise I have a few suggested topics that we can discuss:

  • Recent GSoC developments: Windows and shared memory support
  • Getting started: How to set up a basic JIT project, and what examples / tutorials to check out.
  • Reviews: How can we streamline the process.
  • Contributing: Open projects in the JIT libraries.

Hope to see you there!

– Lang.

@lhames Hi Lang, was there an October edition? Did I miss it? It looks like the calendar link above is broken.

Did I miss it?

You did not – I failed to schedule it.

I will aim to put a written update out this weekend and schedule the next office hours in November. The last Monday in November is the 21st, which is during the Thanksgiving week, so I will propose that we hold the November office hours on Monday the 14th instead.

The latest update is out here.

November office hours will be held on Monday November 14th at 8am PDT. See the linked thread for details.