LLVM 22.0.0git
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:
[legend]

Public Types

using GlobalValueSet = std::set<const GlobalValue *>
using PartitionFunction
 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.

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 38 of file IRPartitionLayer.h.

Member Typedef Documentation

◆ GlobalValueSet

Definition at line 42 of file IRPartitionLayer.h.

◆ PartitionFunction

Initial value:
std::function<std::optional<GlobalValueSet>(GlobalValueSet Requested)>
std::set< const GlobalValue * > GlobalValueSet

Partitioning function.

Definition at line 45 of file IRPartitionLayer.h.

Constructor & Destructor Documentation

◆ IRPartitionLayer()

IRPartitionLayer::IRPartitionLayer ( ExecutionSession & ES,
IRLayer & BaseLayer )

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.

◆ PartitioningIRMaterializationUnit

friend class PartitioningIRMaterializationUnit
friend

Definition at line 39 of file IRPartitionLayer.h.

References PartitioningIRMaterializationUnit.

Referenced by PartitioningIRMaterializationUnit.


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