Jlm
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
jlm::llvm::LambdaExitMemoryStateMergeOperation Class Referencefinal

#include <MemoryStateOperations.hpp>

Inheritance diagram for jlm::llvm::LambdaExitMemoryStateMergeOperation:
Inheritance graph
[legend]
Collaboration diagram for jlm::llvm::LambdaExitMemoryStateMergeOperation:
Collaboration graph
[legend]

Public Member Functions

 ~LambdaExitMemoryStateMergeOperation () noexcept override
 
 LambdaExitMemoryStateMergeOperation (const std::vector< MemoryNodeId > &memoryNodeIds)
 
bool operator== (const Operation &other) const noexcept override
 
std::string debug_string () const override
 
std::unique_ptr< Operation > copy () const override
 
std::vector< MemoryNodeIdgetMemoryNodeIds () const noexcept
 
- Public Member Functions inherited from jlm::rvsdg::SimpleOperation
 ~SimpleOperation () noexcept override
 
 SimpleOperation (std::vector< std::shared_ptr< const jlm::rvsdg::Type >> operands, std::vector< std::shared_ptr< const jlm::rvsdg::Type >> results)
 
size_t narguments () const noexcept
 
const std::shared_ptr< const rvsdg::Type > & argument (size_t index) const noexcept
 
size_t nresults () const noexcept
 
const std::shared_ptr< const rvsdg::Type > & result (size_t index) const noexcept
 
- Public Member Functions inherited from jlm::rvsdg::Operation
virtual ~Operation () noexcept
 
virtual bool operator== (const Operation &other) const noexcept=0
 
bool operator!= (const Operation &other) const noexcept
 

Static Public Member Functions

static rvsdg::InputtryMapMemoryNodeIdToInput (const rvsdg::SimpleNode &node, MemoryNodeId memoryNodeId)
 
static MemoryNodeId mapInputToMemoryNodeId (const rvsdg::Input &input)
 
static std::optional< std::vector< rvsdg::Output * > > NormalizeLoadFromAlloca (const LambdaExitMemoryStateMergeOperation &operation, const std::vector< rvsdg::Output * > &operands)
 
static std::optional< std::vector< rvsdg::Output * > > NormalizeStoreToAlloca (const LambdaExitMemoryStateMergeOperation &operation, const std::vector< rvsdg::Output * > &operands)
 
static std::optional< std::vector< rvsdg::Output * > > NormalizeAlloca (const LambdaExitMemoryStateMergeOperation &operation, const std::vector< rvsdg::Output * > &operands)
 
static rvsdg::NodeCreateNode (rvsdg::Region &region, const std::vector< rvsdg::Output * > &operands, const std::vector< MemoryNodeId > &memoryNodeIds)
 

Private Attributes

util::BijectiveMap< MemoryNodeId, size_t > MemoryNodeIdToIndex_ {}
 

Additional Inherited Members

- Protected Member Functions inherited from jlm::llvm::MemoryStateOperation
 MemoryStateOperation (size_t numOperands, size_t numResults)
 

Detailed Description

A lambda exit memory state merge operation takes multiple states as input and merges them together to a single output state. In contrast to the MemoryStateMergeOperation, this operation is allowed to have zero input states. The operation's output is required to be connected to the memory state result of a lambda.

The operation has no equivalent LLVM instruction.

See also
LambdaEntryMemoryStateMergeOperation

Definition at line 382 of file MemoryStateOperations.hpp.

Constructor & Destructor Documentation

◆ ~LambdaExitMemoryStateMergeOperation()

jlm::llvm::LambdaExitMemoryStateMergeOperation::~LambdaExitMemoryStateMergeOperation ( )
overridedefaultnoexcept

◆ LambdaExitMemoryStateMergeOperation()

jlm::llvm::LambdaExitMemoryStateMergeOperation::LambdaExitMemoryStateMergeOperation ( const std::vector< MemoryNodeId > &  memoryNodeIds)
explicit

Definition at line 423 of file MemoryStateOperations.cpp.

Member Function Documentation

◆ copy()

std::unique_ptr< rvsdg::Operation > jlm::llvm::LambdaExitMemoryStateMergeOperation::copy ( ) const
overridevirtual

Implements jlm::rvsdg::Operation.

Definition at line 450 of file MemoryStateOperations.cpp.

◆ CreateNode()

static rvsdg::Node& jlm::llvm::LambdaExitMemoryStateMergeOperation::CreateNode ( rvsdg::Region region,
const std::vector< rvsdg::Output * > &  operands,
const std::vector< MemoryNodeId > &  memoryNodeIds 
)
inlinestatic

Definition at line 485 of file MemoryStateOperations.hpp.

◆ debug_string()

std::string jlm::llvm::LambdaExitMemoryStateMergeOperation::debug_string ( ) const
overridevirtual

Implements jlm::rvsdg::Operation.

Definition at line 444 of file MemoryStateOperations.cpp.

◆ getMemoryNodeIds()

std::vector<MemoryNodeId> jlm::llvm::LambdaExitMemoryStateMergeOperation::getMemoryNodeIds ( ) const
inlinenoexcept
Returns
The MemoryNodeId for each of the operation's operands.

Definition at line 402 of file MemoryStateOperations.hpp.

◆ mapInputToMemoryNodeId()

MemoryNodeId jlm::llvm::LambdaExitMemoryStateMergeOperation::mapInputToMemoryNodeId ( const rvsdg::Input input)
static

Maps the input a LambdaExitMemoryStateMergeOperation node to the respective MemoryNodeId.

Parameters
inputA input of LambdaExitMemoryStateMergeOperation node.
Returns
The MemoryNodeId.
Precondition
The input is assumed to belong to a LambdaExitMemoryStateMergeOperation node.

Definition at line 478 of file MemoryStateOperations.cpp.

◆ NormalizeAlloca()

std::optional< std::vector< rvsdg::Output * > > jlm::llvm::LambdaExitMemoryStateMergeOperation::NormalizeAlloca ( const LambdaExitMemoryStateMergeOperation operation,
const std::vector< rvsdg::Output * > &  operands 
)
static

Performs the following transformation:

a, s1 = AllocaOperation ... ... = LambdaExitMemoryStateMergeOperation s1 ... sn => a, s1 = AllocaOperation ... s2 = UndefValueOperation ... = LambdaExitMemoryStateMergeOperation s2 ... sn

Definition at line 567 of file MemoryStateOperations.cpp.

◆ NormalizeLoadFromAlloca()

std::optional< std::vector< rvsdg::Output * > > jlm::llvm::LambdaExitMemoryStateMergeOperation::NormalizeLoadFromAlloca ( const LambdaExitMemoryStateMergeOperation operation,
const std::vector< rvsdg::Output * > &  operands 
)
static

Performs the following transformation:

a, s1 = AllocaOperation ... v, s2 = LoadOperation a s1 ... = LambdaExitMemoryStateMergeOperation s2 ... sn => a, s1 = AllocaOperation ... v, s2 = LoadOperation a s1 ... = LambdaExitMemoryStateMergeOperation s1 ... sn

Definition at line 488 of file MemoryStateOperations.cpp.

◆ NormalizeStoreToAlloca()

std::optional< std::vector< rvsdg::Output * > > jlm::llvm::LambdaExitMemoryStateMergeOperation::NormalizeStoreToAlloca ( const LambdaExitMemoryStateMergeOperation operation,
const std::vector< rvsdg::Output * > &  operands 
)
static

Performs the following transformation:

a, s1 = AllocaOperation ... s2 = StoreOperation a v s1 ... = LambdaExitMemoryStateMergeOperation s2 ... sn => a, s1 = AllocaOperation ... s2 = StoreOperation a v s1 ... = LambdaExitMemoryStateMergeOperation s1 ... sn

Definition at line 527 of file MemoryStateOperations.cpp.

◆ operator==()

bool jlm::llvm::LambdaExitMemoryStateMergeOperation::operator== ( const Operation &  other) const
overridenoexcept

Definition at line 437 of file MemoryStateOperations.cpp.

◆ tryMapMemoryNodeIdToInput()

rvsdg::Input * jlm::llvm::LambdaExitMemoryStateMergeOperation::tryMapMemoryNodeIdToInput ( const rvsdg::SimpleNode node,
MemoryNodeId  memoryNodeId 
)
static

Maps a memory node identifier to the respective input of a LambdaExitMemoryStateMergeOperation node.

Parameters
nodeA LambdaExitMemoryStateMergeOperation node.
memoryNodeIdA memory node identifier.
Returns
The respective input if the memory node identifier maps to one, otherwise nullptr.

Definition at line 456 of file MemoryStateOperations.cpp.

Member Data Documentation

◆ MemoryNodeIdToIndex_

util::BijectiveMap<MemoryNodeId, size_t> jlm::llvm::LambdaExitMemoryStateMergeOperation::MemoryNodeIdToIndex_ {}
private

Definition at line 496 of file MemoryStateOperations.hpp.


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