LLVM 20.0.0git
|
A layer that breaks up IR modules into smaller submodules that only contains looked up symbols. More...
#include "llvm/ExecutionEngine/Orc/IRPartitionLayer.h"
Public Types | |
using | GlobalValueSet = std::set< const GlobalValue * > |
using | PartitionFunction = std::function< std::optional< GlobalValueSet >(GlobalValueSet Requested)> |
Partitioning function. | |
Public Member Functions | |
IRPartitionLayer (ExecutionSession &ES, IRLayer &BaseLayer) | |
Construct a IRPartitionLayer. | |
void | setPartitionFunction (PartitionFunction Partition) |
Sets the partition function. | |
void | emit (std::unique_ptr< MaterializationResponsibility > R, ThreadSafeModule TSM) override |
Emits the given module. | |
Public Member Functions inherited from llvm::orc::IRLayer | |
IRLayer (ExecutionSession &ES, const IRSymbolMapper::ManglingOptions *&MO) | |
virtual | ~IRLayer () |
ExecutionSession & | getExecutionSession () |
Returns the ExecutionSession for this layer. | |
const IRSymbolMapper::ManglingOptions *& | getManglingOptions () const |
Get the mangling options for this layer. | |
void | setCloneToNewContextOnEmit (bool CloneToNewContextOnEmit) |
Sets the CloneToNewContextOnEmit flag (false by default). | |
bool | getCloneToNewContextOnEmit () const |
Returns the current value of the CloneToNewContextOnEmit flag. | |
virtual Error | add (ResourceTrackerSP RT, ThreadSafeModule TSM) |
Add a MaterializatinoUnit representing the given IR to the JITDylib targeted by the given tracker. | |
Error | add (JITDylib &JD, ThreadSafeModule TSM) |
Adds a MaterializationUnit representing the given IR to the given JITDylib. | |
virtual void | emit (std::unique_ptr< MaterializationResponsibility > R, ThreadSafeModule TSM)=0 |
Emit should materialize the given IR. | |
Static Public Member Functions | |
static std::optional< GlobalValueSet > | compileRequested (GlobalValueSet Requested) |
Off-the-shelf partitioning which compiles all requested symbols (usually a single function at a time). | |
static std::optional< GlobalValueSet > | compileWholeModule (GlobalValueSet Requested) |
Off-the-shelf partitioning which compiles whole modules whenever any symbol in them is requested. | |
Friends | |
class | PartitioningIRMaterializationUnit |
A layer that breaks up IR modules into smaller submodules that only contains looked up symbols.
Definition at line 37 of file IRPartitionLayer.h.
using llvm::orc::IRPartitionLayer::GlobalValueSet = std::set<const GlobalValue *> |
Definition at line 41 of file IRPartitionLayer.h.
using llvm::orc::IRPartitionLayer::PartitionFunction = std::function<std::optional<GlobalValueSet>(GlobalValueSet Requested)> |
Partitioning function.
Definition at line 44 of file IRPartitionLayer.h.
IRPartitionLayer::IRPartitionLayer | ( | ExecutionSession & | ES, |
IRLayer & | BaseLayer | ||
) |
Construct a IRPartitionLayer.
Definition at line 102 of file IRPartitionLayer.cpp.
|
static |
Off-the-shelf partitioning which compiles all requested symbols (usually a single function at a time).
Definition at line 110 of file IRPartitionLayer.cpp.
|
static |
Off-the-shelf partitioning which compiles whole modules whenever any symbol in them is requested.
Definition at line 115 of file IRPartitionLayer.cpp.
|
overridevirtual |
Emits the given module.
This should not be called by clients: it will be called by the JIT when a definition added via the add method is requested.
Implements llvm::orc::IRLayer.
Definition at line 119 of file IRPartitionLayer.cpp.
References assert(), llvm::orc::IRLayer::getExecutionSession(), llvm::orc::IRLayer::getManglingOptions(), and llvm::orc::ThreadSafeModule::withModuleDo().
void IRPartitionLayer::setPartitionFunction | ( | PartitionFunction | Partition | ) |
Sets the partition function.
Definition at line 105 of file IRPartitionLayer.cpp.
|
friend |
Definition at line 38 of file IRPartitionLayer.h.