mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
[Orc] New JIT APIs.
This patch adds a new set of JIT APIs to LLVM. The aim of these new APIs is to cleanly support a wider range of JIT use cases in LLVM, and encourage the development and contribution of re-usable infrastructure for LLVM JIT use-cases. These APIs are intended to live alongside the MCJIT APIs, and should not affect existing clients. Included in this patch: 1) New headers in include/llvm/ExecutionEngine/Orc that provide a set of components for building JIT infrastructure. Implementation code for these headers lives in lib/ExecutionEngine/Orc. 2) A prototype re-implementation of MCJIT (OrcMCJITReplacement) built out of the new components. 3) Minor changes to RTDyldMemoryManager needed to support the new components. These changes should not impact existing clients. 4) A new flag for lli, -use-orcmcjit, which will cause lli to use the OrcMCJITReplacement class as its underlying execution engine, rather than MCJIT itself. Tests to follow shortly. Special thanks to Michael Ilseman, Pete Cooper, David Blaikie, Eric Christopher, Justin Bogner, and Jim Grosbach for extensive feedback and discussion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226940 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -10,6 +10,7 @@ set(LLVM_LINK_COMPONENTS
|
||||
MC
|
||||
MCJIT
|
||||
Object
|
||||
OrcJIT
|
||||
SelectionDAG
|
||||
Support
|
||||
native
|
||||
|
@@ -25,6 +25,7 @@
|
||||
#include "llvm/ExecutionEngine/JITEventListener.h"
|
||||
#include "llvm/ExecutionEngine/MCJIT.h"
|
||||
#include "llvm/ExecutionEngine/ObjectCache.h"
|
||||
#include "llvm/ExecutionEngine/OrcMCJITReplacement.h"
|
||||
#include "llvm/ExecutionEngine/SectionMemoryManager.h"
|
||||
#include "llvm/IR/IRBuilder.h"
|
||||
#include "llvm/IR/Module.h"
|
||||
@@ -74,6 +75,13 @@ namespace {
|
||||
cl::desc("Force interpretation: disable JIT"),
|
||||
cl::init(false));
|
||||
|
||||
cl::opt<bool> UseOrcMCJITReplacement("use-orcmcjit",
|
||||
cl::desc("Use the experimental "
|
||||
"OrcMCJITReplacement as a "
|
||||
"drop-in replacement for "
|
||||
"MCJIT."),
|
||||
cl::init(false));
|
||||
|
||||
// The MCJIT supports building for a target address space separate from
|
||||
// the JIT compilation process. Use a forked process and a copying
|
||||
// memory manager with IPC to execute using this functionality.
|
||||
@@ -421,6 +429,7 @@ int main(int argc, char **argv, char * const *envp) {
|
||||
builder.setEngineKind(ForceInterpreter
|
||||
? EngineKind::Interpreter
|
||||
: EngineKind::JIT);
|
||||
builder.setUseOrcMCJITReplacement(UseOrcMCJITReplacement);
|
||||
|
||||
// If we are supposed to override the target triple, do so now.
|
||||
if (!TargetTriple.empty())
|
||||
|
Reference in New Issue
Block a user