class LLJIT

Declaration

class LLJIT { /* full declaration omitted */ };

Description

A pre-fabricated ORC JIT stack that can serve as an alternative to MCJIT. Create instances using LLJITBuilder.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:37

Member Variables

protected std::unique_ptr<ExecutionSession> ES
protected std::unique_ptr<PlatformSupport> PS
protected llvm::orc::JITDylib* Main = nullptr
protected llvm::DataLayout DL
protected llvm::Triple TT
protected std::unique_ptr<ThreadPool> CompileThreads
protected std::unique_ptr<ObjectLayer> ObjLinkingLayer
protected std::unique_ptr<ObjectTransformLayer> ObjTransformLayer
protected std::unique_ptr<IRCompileLayer> CompileLayer
protected std::unique_ptr<IRTransformLayer> TransformLayer
protected std::unique_ptr<IRTransformLayer> InitHelperTransformLayer

Method Overview

  • protected LLJIT(llvm::orc::LLJITBuilderState & S, llvm::Error & Err)
  • public llvm::Error addIRModule(llvm::orc::ResourceTrackerSP RT, llvm::orc::ThreadSafeModule TSM)
  • public llvm::Error addIRModule(llvm::orc::JITDylib & JD, llvm::orc::ThreadSafeModule TSM)
  • public llvm::Error addIRModule(llvm::orc::ThreadSafeModule TSM)
  • public llvm::Error addObjectFile(llvm::orc::ResourceTrackerSP RT, std::unique_ptr<MemoryBuffer> Obj)
  • public llvm::Error addObjectFile(llvm::orc::JITDylib & JD, std::unique_ptr<MemoryBuffer> Obj)
  • public llvm::Error addObjectFile(std::unique_ptr<MemoryBuffer> Obj)
  • protected llvm::Error applyDataLayout(llvm::Module & M)
  • protected static Expected<std::unique_ptr<IRCompileLayer::IRCompiler>> createCompileFunction(llvm::orc::LLJITBuilderState & S, llvm::orc::JITTargetMachineBuilder JTMB)
  • public Expected<llvm::orc::JITDylib &> createJITDylib(std::string Name)
  • protected static Expected<std::unique_ptr<ObjectLayer>> createObjectLinkingLayer(llvm::orc::LLJITBuilderState & S, llvm::orc::ExecutionSession & ES)
  • public llvm::Error deinitialize(llvm::orc::JITDylib & JD)
  • public const llvm::DataLayout & getDataLayout() const
  • public llvm::orc::ExecutionSession & getExecutionSession()
  • public llvm::orc::IRCompileLayer & getIRCompileLayer()
  • public llvm::orc::IRTransformLayer & getIRTransformLayer()
  • public llvm::orc::JITDylib * getJITDylibByName(llvm::StringRef Name)
  • public llvm::orc::JITDylib & getMainJITDylib()
  • public llvm::orc::ObjectLayer & getObjLinkingLayer()
  • public llvm::orc::ObjectTransformLayer & getObjTransformLayer()
  • public llvm::orc::LLJIT::PlatformSupport * getPlatformSupport()
  • public const llvm::Triple & getTargetTriple() const
  • public llvm::Error initialize(llvm::orc::JITDylib & JD)
  • public Expected<llvm::orc::ExecutorAddr> lookup(llvm::orc::JITDylib & JD, llvm::StringRef UnmangledName)
  • public Expected<llvm::orc::ExecutorAddr> lookup(llvm::StringRef UnmangledName)
  • public Expected<llvm::orc::ExecutorAddr> lookupLinkerMangled(llvm::StringRef Name)
  • public Expected<llvm::orc::ExecutorAddr> lookupLinkerMangled(llvm::orc::JITDylib & JD, llvm::StringRef Name)
  • public Expected<llvm::orc::ExecutorAddr> lookupLinkerMangled(llvm::orc::JITDylib & JD, llvm::orc::SymbolStringPtr Name)
  • public std::string mangle(llvm::StringRef UnmangledName) const
  • public llvm::orc::SymbolStringPtr mangleAndIntern(llvm::StringRef UnmangledName) const
  • protected void recordCtorDtors(llvm::Module & M)
  • public void setPlatformSupport(std::unique_ptr<PlatformSupport> PS)
  • public virtual ~LLJIT()

Methods

LLJIT(llvm::orc::LLJITBuilderState& S,
      llvm::Error& Err)

Description

Create an LLJIT instance with a single compile thread.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:196

Parameters

llvm::orc::LLJITBuilderState& S
llvm::Error& Err

llvm::Error addIRModule(
    llvm::orc::ResourceTrackerSP RT,
    llvm::orc::ThreadSafeModule TSM)

Description

Adds an IR module with the given ResourceTracker.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:90

Parameters

llvm::orc::ResourceTrackerSP RT
llvm::orc::ThreadSafeModule TSM

llvm::Error addIRModule(
    llvm::orc::JITDylib& JD,
    llvm::orc::ThreadSafeModule TSM)

Description

Adds an IR module to the given JITDylib.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:93

Parameters

llvm::orc::JITDylib& JD
llvm::orc::ThreadSafeModule TSM

llvm::Error addIRModule(
    llvm::orc::ThreadSafeModule TSM)

Description

Adds an IR module to the Main JITDylib.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:96

Parameters

llvm::orc::ThreadSafeModule TSM

llvm::Error addObjectFile(
    llvm::orc::ResourceTrackerSP RT,
    std::unique_ptr<MemoryBuffer> Obj)

Description

Adds an object file to the given JITDylib.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:101

Parameters

llvm::orc::ResourceTrackerSP RT
std::unique_ptr<MemoryBuffer> Obj

llvm::Error addObjectFile(
    llvm::orc::JITDylib& JD,
    std::unique_ptr<MemoryBuffer> Obj)

Description

Adds an object file to the given JITDylib.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:104

Parameters

llvm::orc::JITDylib& JD
std::unique_ptr<MemoryBuffer> Obj

llvm::Error addObjectFile(
    std::unique_ptr<MemoryBuffer> Obj)

Description

Adds an object file to the given JITDylib.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:107

Parameters

std::unique_ptr<MemoryBuffer> Obj

llvm::Error applyDataLayout(llvm::Module& M)

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:198

Parameters

llvm::Module& M

static Expected<
    std::unique_ptr<IRCompileLayer::IRCompiler>>
createCompileFunction(
    llvm::orc::LLJITBuilderState& S,
    llvm::orc::JITTargetMachineBuilder JTMB)

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:193

Parameters

llvm::orc::LLJITBuilderState& S
llvm::orc::JITTargetMachineBuilder JTMB

Expected<llvm::orc::JITDylib&> createJITDylib(
    std::string Name)

Description

Create a new JITDylib with the given name and return a reference to it. JITDylib names must be unique. If the given name is derived from user input or elsewhere in the environment then the client should check (e.g. by calling getJITDylibByName) that the given name is not already in use.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:85

Parameters

std::string Name

static Expected<std::unique_ptr<ObjectLayer>>
createObjectLinkingLayer(
    llvm::orc::LLJITBuilderState& S,
    llvm::orc::ExecutionSession& ES)

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:190

Parameters

llvm::orc::LLJITBuilderState& S
llvm::orc::ExecutionSession& ES

llvm::Error deinitialize(llvm::orc::JITDylib& JD)

Description

Run the deinitializers for the given JITDylib.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:159

Parameters

llvm::orc::JITDylib& JD

const llvm::DataLayout& getDataLayout() const

Description

Returns a reference to the DataLayout for this instance.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:68

llvm::orc::ExecutionSession& getExecutionSession()

Description

Returns the ExecutionSession for this instance.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:62

llvm::orc::IRCompileLayer& getIRCompileLayer()

Description

Returns a reference to the IR compile layer.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:178

llvm::orc::IRTransformLayer& getIRTransformLayer()

Description

Returns a reference to the IR transform layer.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:175

llvm::orc::JITDylib* getJITDylibByName(
    llvm::StringRef Name)

Description

Returns the JITDylib with the given name, or nullptr if no JITDylib with that name exists.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:75

Parameters

llvm::StringRef Name

llvm::orc::JITDylib& getMainJITDylib()

Description

Returns a reference to the JITDylib representing the JIT'd main program.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:71

llvm::orc::ObjectLayer& getObjLinkingLayer()

Description

Returns a reference to the ObjLinkingLayer

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:169

llvm::orc::ObjectTransformLayer&
getObjTransformLayer()

Description

Returns a reference to the object transform layer.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:172

llvm::orc::LLJIT::PlatformSupport*
getPlatformSupport()

Description

Get the PlatformSupport instance.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:146

const llvm::Triple& getTargetTriple() const

Description

Returns a reference to the triple for this instance.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:65

llvm::Error initialize(llvm::orc::JITDylib& JD)

Description

Run the initializers for the given JITDylib.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:149

Parameters

llvm::orc::JITDylib& JD

Expected<llvm::orc::ExecutorAddr> lookup(
    llvm::orc::JITDylib& JD,
    llvm::StringRef UnmangledName)

Description

Look up a symbol in JITDylib JD based on its IR symbol name.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:131

Parameters

llvm::orc::JITDylib& JD
llvm::StringRef UnmangledName

Expected<llvm::orc::ExecutorAddr> lookup(
    llvm::StringRef UnmangledName)

Description

Look up a symbol in the main JITDylib based on its IR symbol name.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:136

Parameters

llvm::StringRef UnmangledName

Expected<llvm::orc::ExecutorAddr>
lookupLinkerMangled(llvm::StringRef Name)

Description

Look up a symbol in the main JITDylib by the symbol's linker-mangled name (to look up symbols based on their IR name use the lookup function instead).

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:126

Parameters

llvm::StringRef Name

Expected<llvm::orc::ExecutorAddr>
lookupLinkerMangled(llvm::orc::JITDylib& JD,
                    llvm::StringRef Name)

Description

Look up a symbol in JITDylib JD by the symbol's linker-mangled name (to look up symbols based on their IR name use the lookup function instead).

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:118

Parameters

llvm::orc::JITDylib& JD
llvm::StringRef Name

Expected<llvm::orc::ExecutorAddr>
lookupLinkerMangled(
    llvm::orc::JITDylib& JD,
    llvm::orc::SymbolStringPtr Name)

Description

Look up a symbol in JITDylib JD by the symbol's linker-mangled name (to look up symbols based on their IR name use the lookup function instead).

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:113

Parameters

llvm::orc::JITDylib& JD
llvm::orc::SymbolStringPtr Name

std::string mangle(
    llvm::StringRef UnmangledName) const

Description

Returns a linker-mangled version of UnmangledName.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:181

Parameters

llvm::StringRef UnmangledName

llvm::orc::SymbolStringPtr mangleAndIntern(
    llvm::StringRef UnmangledName) const

Description

Returns an interned, linker-mangled version of UnmangledName.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:184

Parameters

llvm::StringRef UnmangledName

void recordCtorDtors(llvm::Module& M)

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:200

Parameters

llvm::Module& M

void setPlatformSupport(
    std::unique_ptr<PlatformSupport> PS)

Description

Set the PlatformSupport instance.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:141

Parameters

std::unique_ptr<PlatformSupport> PS

virtual ~LLJIT()

Description

Destruct this instance. If a multi-threaded instance, waits for all compile threads to complete.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:59