Orc JIT Weekly #33 -- Orc Runtime patches, JITLink and C API improvements

Hi All,

Highlights this week (and for all the weeks I’ve missed over the last couple of months):

(1) The Orc runtime patches have started to land in the mainline [1], [2]. It’s slow going while the initial infrastructure is tidied up and reviewed (CMake is not my strong suit), but I expect the pace to pick up after that. My aim is to have everything in the runtime preview branch tidied up and landed in the mainline by the end of June.

(2) ExecutionSession::dispatchMaterialization has been generalized to dispatchTask. This will allow query callbacks to be dispatched (rather than being run immediately on the current thread), which will prevent work from piling up on one thread when one object file emission causes several query callbacks to fire. [3]

(3) JITLink has acquired generic x86-64 edge kinds and utilities, and the MachO x86-64 backend has been rewritten to take advantage of them rather than using edge types specific to MachO [4]. This will eventually improve code sharing between the MachO and ELF backends, though the ELF backend has not been rewritten to use the new edge kinds yet.

I expect this pattern (format agnostic edge kinds and utilities) to be followed by other architectures in the future. Generic arm64 edges and utilities are the next goal.

Side note: This work actually landed all the way back on March 11th, but I failed to include a note on it in Orc JIT Weekly #32, which was the only other edition since then. Oops!

(4) Stefan Granitz landed ELF debugging support for JITLink in [5] (also back in March). This is big news as it closes one of the significant remaining functionality gaps between JITLink and RuntimeDyld. Thanks Stefan!

(5) The C API has acquired some unit tests in [6] courtesy of Mats Larsen. Thanks Mats!

The C API test shook loose some bugs in the existing APIs, and led to contract changes on some of the functions. If you’re using the new Orc C bindings (especially the LLVMOrcAbsoluteSymbols function) please take a moment to review the changes to see if they affect you.

– Lang.

[1] https://github.com/llvm/llvm-project/commit/5e537ea1d7a937f848ff1c0fc691d5a5afdf2459
[2] https://reviews.llvm.org/D102080
[3] https://github.com/llvm/llvm-project/commit/5344c88dcb2845f6a12cd0992deab1448b4d1419
[4] https://github.com/llvm/llvm-project/commit/ecf6466f01c52ebd8c86575dfdc03fe08ad1b2e0
[5] https://github.com/llvm/llvm-project/commit/ef2389235c5dec03be93f8c9585cd9416767ef4c
[6] https://github.com/llvm/llvm-project/commit/8740360093b5154504f5e056596119f9566f4b06