[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
2015-01-23 21:25:00 +00:00
|
|
|
//===-- OrcTargetSupport.h - Code to support specific targets --*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// Target specific code for Orc, e.g. callback assembly.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_EXECUTIONENGINE_ORC_ORCTARGETSUPPORT_H
|
|
|
|
#define LLVM_EXECUTIONENGINE_ORC_ORCTARGETSUPPORT_H
|
|
|
|
|
|
|
|
#include "IndirectionUtils.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
2015-02-21 20:44:36 +00:00
|
|
|
namespace orc {
|
[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
2015-01-23 21:25:00 +00:00
|
|
|
|
2015-02-17 01:18:38 +00:00
|
|
|
class OrcX86_64 {
|
|
|
|
public:
|
|
|
|
static const char *ResolverBlockName;
|
|
|
|
|
|
|
|
/// @brief Insert module-level inline callback asm into module M for the
|
|
|
|
/// symbols managed by JITResolveCallbackHandler J.
|
|
|
|
static void insertResolverBlock(
|
|
|
|
Module &M,
|
|
|
|
JITCompileCallbackManagerBase<OrcX86_64> &JCBM);
|
|
|
|
|
|
|
|
/// @brief Get a label name from the given index.
|
|
|
|
typedef std::function<std::string(unsigned)> LabelNameFtor;
|
|
|
|
|
|
|
|
static const unsigned CallSize = 6;
|
|
|
|
|
|
|
|
/// @brief Insert the requested number of trampolines into the given module.
|
|
|
|
/// @param M Module to insert the call block into.
|
|
|
|
/// @param NumCalls Number of calls to create in the call block.
|
|
|
|
/// @param StartIndex Optional argument specifying the index suffix to start
|
|
|
|
/// with.
|
|
|
|
/// @return A functor that provides the symbol name for each entry in the call
|
|
|
|
/// block.
|
|
|
|
///
|
|
|
|
static LabelNameFtor insertCompileCallbackTrampolines(
|
|
|
|
Module &M,
|
|
|
|
TargetAddress TrampolineAddr,
|
|
|
|
unsigned NumCalls,
|
|
|
|
unsigned StartIndex = 0);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2015-02-21 20:44:36 +00:00
|
|
|
} // End namespace orc.
|
|
|
|
} // End namespace llvm.
|
[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
2015-01-23 21:25:00 +00:00
|
|
|
|
|
|
|
#endif // LLVM_EXECUTIONENGINE_ORC_ORCTARGETSUPPORT_H
|