This is an archive of the discontinued LLVM Phabricator instance.

[ORC-RT] Initial ORC Runtime directories and build system files.
ClosedPublic

Authored by lhames on Apr 17 2021, 1:36 PM.

Details

Summary

This patch contains initial directories and build files for the ORC runtime.
The prototype runtime library code has been omitted to simplify the review.

Background:

The ORC runtime will support the LLVM ORC JIT libraries by providing code that
can be loaded by the JIT into the target "executor" process to support
non-trivial operations in that process. The runtime will enable the following
features in JIT'd code:

(1) Native thread local variables
(2) C++ Exceptions
(3) Static initializers
(4) At-exit interposition for correct execution of static destructors
(5) Language runtime registration (e.g. for Objective-C and Swift)
(6) Cross-process lazy compilation
(7) Executor process memory reads/writes by the JIT process

Some of these features (e.g. exception handling and remote lazy compilation)
have been partially implemented in LLVM, but can be more naturally implemented
in a runtime. Other features (e.g. native thread local variables) are
impractical to implement within LLVM and require this runtime.

Constraints:

The ORC runtime requires:
(1) A C++ 14 host compiler and c++ standard library.
(2) A built LLVM to provide the llvm-jitlink tool (required for testing).
(3) A clang compiler (required for testing).

Testing plan:

All planned testing will consist of regression tests using the llvm-jitlink
testing tool.

As the runtime grows there may also be opportunities to write unit tests for
functionality that can be meaningfully tested in isolation (without a JIT
process to communicate with).

Diff Detail

Event Timeline

lhames created this revision.Apr 17 2021, 1:36 PM
lhames requested review of this revision.Apr 17 2021, 1:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 17 2021, 1:36 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
phosek accepted this revision.Apr 20 2021, 1:10 AM

LGTM

compiler-rt/lib/orc/CMakeLists.txt
28–34

This looks unused and ideally shouldn't be needed at all since CMake doesn't require absolute paths.

This revision is now accepted and ready to land.Apr 20 2021, 1:10 AM

Thanks Petr. Committed with suggested fix in 1e1d75b190c2.

Herald added a project: Restricted Project. · View Herald TranscriptJul 19 2022, 9:24 AM