LLVM 20.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
llvm::orc::IRPartitionLayer Class Reference

A layer that breaks up IR modules into smaller submodules that only contains looked up symbols. More...

#include "llvm/ExecutionEngine/Orc/IRPartitionLayer.h"

Inheritance diagram for llvm::orc::IRPartitionLayer:
Inheritance graph
[legend]

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 ()
 
ExecutionSessiongetExecutionSession ()
 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< GlobalValueSetcompileRequested (GlobalValueSet Requested)
 Off-the-shelf partitioning which compiles all requested symbols (usually a single function at a time).
 
static std::optional< GlobalValueSetcompileWholeModule (GlobalValueSet Requested)
 Off-the-shelf partitioning which compiles whole modules whenever any symbol in them is requested.
 

Friends

class PartitioningIRMaterializationUnit
 

Detailed Description

A layer that breaks up IR modules into smaller submodules that only contains looked up symbols.

Definition at line 37 of file IRPartitionLayer.h.

Member Typedef Documentation

◆ GlobalValueSet

Definition at line 41 of file IRPartitionLayer.h.

◆ PartitionFunction

using llvm::orc::IRPartitionLayer::PartitionFunction = std::function<std::optional<GlobalValueSet>(GlobalValueSet Requested)>

Partitioning function.

Definition at line 44 of file IRPartitionLayer.h.

Constructor & Destructor Documentation

◆ IRPartitionLayer()

IRPartitionLayer::IRPartitionLayer ( ExecutionSession ES,
IRLayer BaseLayer 
)

Construct a IRPartitionLayer.

Definition at line 102 of file IRPartitionLayer.cpp.

Member Function Documentation

◆ compileRequested()

std::optional< IRPartitionLayer::GlobalValueSet > IRPartitionLayer::compileRequested ( GlobalValueSet  Requested)
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.

◆ compileWholeModule()

std::optional< IRPartitionLayer::GlobalValueSet > IRPartitionLayer::compileWholeModule ( GlobalValueSet  Requested)
static

Off-the-shelf partitioning which compiles whole modules whenever any symbol in them is requested.

Definition at line 115 of file IRPartitionLayer.cpp.

◆ emit()

void IRPartitionLayer::emit ( std::unique_ptr< MaterializationResponsibility R,
ThreadSafeModule  TSM 
)
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().

◆ setPartitionFunction()

void IRPartitionLayer::setPartitionFunction ( PartitionFunction  Partition)

Sets the partition function.

Definition at line 105 of file IRPartitionLayer.cpp.

Friends And Related Function Documentation

◆ PartitioningIRMaterializationUnit

friend class PartitioningIRMaterializationUnit
friend

Definition at line 38 of file IRPartitionLayer.h.


The documentation for this class was generated from the following files: