1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
llvm-mirror/lib/ExecutionEngine/Orc
Lang Hames 4bba9adcc4 [Orc] Add support for emitting indirect stubs directly into the JIT target's
memory, rather than representing the stubs in IR. Update the CompileOnDemand
layer to use this functionality.

Directly emitting stubs is much cheaper than building them in IR and codegen'ing
them (see below). It also plays well with remote JITing - stubs can be emitted
directly in the target process, rather than having to send them over the wire.

The downsides are:

(1) Care must be taken when resolving symbols, as stub symbols are held in a
    separate symbol table. This is only a problem for layer writers and other
    people using this API directly. The CompileOnDemand layer hides this detail.

(2) Aliases of function stubs can't be symbolic any more (since there's no
    symbol definition in IR), but must be converted into a constant pointer
    expression. This means that modules containing aliases of stubs cannot be
    cached. In practice this is unlikely to be a problem: There's no benefit to
    caching such a module anyway.

On balance I think the extra performance is more than worth the trade-offs: In a
simple stress test with 10000 dummy functions requiring stubs and a single
executed "hello world" main function, directly emitting stubs reduced user time
for JITing / executing by over 90% (1.5s for IR stubs vs 0.1s for direct
emission).

llvm-svn: 250712
2015-10-19 17:43:51 +00:00
..
CMakeLists.txt Fix line endings (NFC) 2015-06-22 21:37:34 +00:00
ExecutionUtils.cpp [Orc] Add support classes for inspecting and running C++ static ctor/dtors, and 2015-04-02 04:34:45 +00:00
IndirectionUtils.cpp [Orc] Add support for emitting indirect stubs directly into the JIT target's 2015-10-19 17:43:51 +00:00
LLVMBuild.txt Orc/LLVMBuild.txt: Prune redundant "Target" in libdeps. 2015-01-25 11:41:41 +00:00
Makefile
NullResolver.cpp Fix line endings (NFC) 2015-06-22 21:37:34 +00:00
OrcMCJITReplacement.cpp [ExecutionEngine] ArrayRefize argument passing. 2015-06-13 19:50:29 +00:00
OrcMCJITReplacement.h Remove access to the DataLayout in the TargetMachine 2015-07-24 16:04:22 +00:00
OrcTargetSupport.cpp [Orc] Add support for emitting indirect stubs directly into the JIT target's 2015-10-19 17:43:51 +00:00