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

#include <Load.hpp>

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

Public Member Functions

 ~LoadNonVolatileOperation () noexcept override
 
 LoadNonVolatileOperation (std::shared_ptr< const rvsdg::Type > loadedType, size_t numMemoryStates, size_t alignment)
 
bool operator== (const Operation &other) const noexcept override
 
std::string debug_string () const override
 
std::unique_ptr< Operation > copy () const override
 
- Public Member Functions inherited from jlm::llvm::LoadOperation
size_t GetAlignment () const noexcept
 
std::shared_ptr< const rvsdg::TypeGetLoadedType () const noexcept
 
size_t NumMemoryStates () 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 std::optional< std::vector< rvsdg::Output * > > NormalizeLoadAlloca (const LoadNonVolatileOperation &operation, const std::vector< rvsdg::Output * > &operands)
 If the producer of a load's address is an alloca operation, then we can remove all state edges originating from other alloca operations. More...
 
static std::optional< std::vector< rvsdg::Output * > > NormalizeLoadStore (const LoadNonVolatileOperation &operation, const std::vector< rvsdg::Output * > &operands)
 Forwards the value from a store operation. More...
 
static std::optional< std::vector< rvsdg::Output * > > NormalizeLoadStoreState (const LoadNonVolatileOperation &operation, const std::vector< rvsdg::Output * > &operands)
 If the producer of a load's address is an alloca operation, then we can remove all state edges originating from other alloca operations coming through store operations. More...
 
static std::optional< std::vector< rvsdg::Output * > > NormalizeDuplicateStates (const LoadNonVolatileOperation &operation, const std::vector< rvsdg::Output * > &operands)
 Remove duplicated state operands. More...
 
static std::optional< std::vector< rvsdg::Output * > > NormalizeIOBarrierAllocaAddress (const LoadNonVolatileOperation &operation, const std::vector< rvsdg::Output * > &operands)
 Redirect the address operand of the LoadNonVolatileOperation from an IOBarrierOperation when it can be determined that it originates from an AllocaOperation. More...
 
static std::unique_ptr< llvm::ThreeAddressCodeCreate (const Variable *address, const Variable *state, std::shared_ptr< const rvsdg::Type > loadedType, size_t alignment)
 
static std::vector< rvsdg::Output * > Create (rvsdg::Output *address, const std::vector< rvsdg::Output * > &memoryStates, std::shared_ptr< const rvsdg::Type > loadedType, const size_t alignment)
 
static rvsdg::SimpleNodeCreateNode (rvsdg::Region &region, std::unique_ptr< LoadNonVolatileOperation > loadOperation, const std::vector< rvsdg::Output * > &operands)
 
static std::vector< rvsdg::Output * > Create (rvsdg::Region &region, std::unique_ptr< LoadNonVolatileOperation > loadOperation, const std::vector< rvsdg::Output * > &operands)
 
static rvsdg::SimpleNodeCreateNode (rvsdg::Output &address, const std::vector< rvsdg::Output * > &memoryStates, std::shared_ptr< const rvsdg::Type > loadedType, size_t alignment)
 
- Static Public Member Functions inherited from jlm::llvm::LoadOperation
static rvsdg::InputAddressInput (const rvsdg::Node &node) noexcept
 
static rvsdg::OutputLoadedValueOutput (const rvsdg::Node &node)
 
static rvsdg::Node::OutputIteratorRange MemoryStateOutputs (const rvsdg::Node &node) noexcept
 
static rvsdg::Node::InputIteratorRange MemoryStateInputs (const rvsdg::Node &node) noexcept
 
static rvsdg::InputMapMemoryStateOutputToInput (const rvsdg::Output &output)
 
static rvsdg::OutputmapMemoryStateInputToOutput (const rvsdg::Input &input)
 

Static Private Member Functions

static std::vector< std::shared_ptr< const rvsdg::Type > > CreateOperandTypes (size_t numMemoryStates)
 
static std::vector< std::shared_ptr< const rvsdg::Type > > CreateResultTypes (std::shared_ptr< const rvsdg::Type > loadedType, size_t numMemoryStates)
 

Additional Inherited Members

- Protected Member Functions inherited from jlm::llvm::LoadOperation
 LoadOperation (const std::vector< std::shared_ptr< const rvsdg::Type >> &operandTypes, const std::vector< std::shared_ptr< const rvsdg::Type >> &resultTypes, const size_t numMemoryStates, const size_t alignment)
 

Detailed Description

Represents an LLVM load instruction.

See also
LoadVolatileOperation

Definition at line 294 of file Load.hpp.

Constructor & Destructor Documentation

◆ ~LoadNonVolatileOperation()

jlm::llvm::LoadNonVolatileOperation::~LoadNonVolatileOperation ( )
overridedefaultnoexcept

◆ LoadNonVolatileOperation()

jlm::llvm::LoadNonVolatileOperation::LoadNonVolatileOperation ( std::shared_ptr< const rvsdg::Type loadedType,
size_t  numMemoryStates,
size_t  alignment 
)
inline

Definition at line 299 of file Load.hpp.

Member Function Documentation

◆ copy()

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

Implements jlm::rvsdg::Operation.

Definition at line 35 of file Load.cpp.

◆ Create() [1/3]

static std::unique_ptr<llvm::ThreeAddressCode> jlm::llvm::LoadNonVolatileOperation::Create ( const Variable address,
const Variable state,
std::shared_ptr< const rvsdg::Type loadedType,
size_t  alignment 
)
inlinestatic

Definition at line 429 of file Load.hpp.

◆ Create() [2/3]

static std::vector<rvsdg::Output *> jlm::llvm::LoadNonVolatileOperation::Create ( rvsdg::Output address,
const std::vector< rvsdg::Output * > &  memoryStates,
std::shared_ptr< const rvsdg::Type loadedType,
const size_t  alignment 
)
inlinestatic

Definition at line 441 of file Load.hpp.

◆ Create() [3/3]

static std::vector<rvsdg::Output *> jlm::llvm::LoadNonVolatileOperation::Create ( rvsdg::Region region,
std::unique_ptr< LoadNonVolatileOperation loadOperation,
const std::vector< rvsdg::Output * > &  operands 
)
inlinestatic

Definition at line 460 of file Load.hpp.

◆ CreateNode() [1/2]

static rvsdg::SimpleNode& jlm::llvm::LoadNonVolatileOperation::CreateNode ( rvsdg::Output address,
const std::vector< rvsdg::Output * > &  memoryStates,
std::shared_ptr< const rvsdg::Type loadedType,
size_t  alignment 
)
inlinestatic

Definition at line 469 of file Load.hpp.

◆ CreateNode() [2/2]

static rvsdg::SimpleNode& jlm::llvm::LoadNonVolatileOperation::CreateNode ( rvsdg::Region region,
std::unique_ptr< LoadNonVolatileOperation loadOperation,
const std::vector< rvsdg::Output * > &  operands 
)
inlinestatic

Definition at line 451 of file Load.hpp.

◆ CreateOperandTypes()

static std::vector<std::shared_ptr<const rvsdg::Type> > jlm::llvm::LoadNonVolatileOperation::CreateOperandTypes ( size_t  numMemoryStates)
inlinestaticprivate

Definition at line 487 of file Load.hpp.

◆ CreateResultTypes()

static std::vector<std::shared_ptr<const rvsdg::Type> > jlm::llvm::LoadNonVolatileOperation::CreateResultTypes ( std::shared_ptr< const rvsdg::Type loadedType,
size_t  numMemoryStates 
)
inlinestaticprivate

Definition at line 498 of file Load.hpp.

◆ debug_string()

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

Implements jlm::rvsdg::Operation.

Definition at line 29 of file Load.cpp.

◆ NormalizeDuplicateStates()

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

Remove duplicated state operands.

v so1 so2 so3 = LoadNonVolatileOperation a si1 si1 si1 => v so1 = LoadNonVolatileOperation a si1

Parameters
operationThe load operation on which the transformation is performed.
operandsThe operands of the load node.
Returns
If the normalization could be applied, then the results of the load operation after the transformation. Otherwise, std::nullopt.

Definition at line 329 of file Load.cpp.

◆ NormalizeIOBarrierAllocaAddress()

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

Redirect the address operand of the LoadNonVolatileOperation from an IOBarrierOperation when it can be determined that it originates from an AllocaOperation.

a1 memState = AllocaOperation ... a2 = IOBarrierOperation a1 ioState ... = LoadNonVolatileOperation a2 ... => a1 memState = AllocaOperation ... a2 = IOBarrierOperation a1 ioState ... = LoadNonVolatileOperation a1 ...

Parameters
operationThe LoadNonVolatileOperation on which the transformation is performed.
operandsThe operands of the LoadNonVolatileOperation node.
Returns
If the normalization could be applied, then the results of the LoadNonVolatileOperation node after the transformation. Otherwise, std::nullopt.

Definition at line 340 of file Load.cpp.

◆ NormalizeLoadAlloca()

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

If the producer of a load's address is an alloca operation, then we can remove all state edges originating from other alloca operations.

a1 s1 = AllocaOperation ... a2 s2 = AllocaOperation ... s3 = MuxOperation s1 v sl1 sl2 sl3 = LoadNonVolatileOperation a1 s1 s2 s3 => ... v sl1 sl3 = LoadNonVolatileOperation a1 s1 s3

Parameters
operationThe load operation on which the transformation is performed.
operandsThe operands of the load node.
Returns
If the normalization could be applied, then the results of the load operation after the transformation. Otherwise, std::nullopt.

Definition at line 307 of file Load.cpp.

◆ NormalizeLoadStore()

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

Forwards the value from a store operation.

s2 = StoreNonVolatileOperation a v1 s1 v2 s3 = LoadNonVolatileOperation a s2 ... = AnyOperation v2 => s2 = StoreNonVolatileOperation a v1 s1 ... = AnyOperation v1

Parameters
operationThe load operation on which the transformation is performed.
operandsThe operands of the load node.
Returns
If the normalization could be applied, then the results of the load operation after the transformation. Otherwise, std::nullopt.

Definition at line 244 of file Load.cpp.

◆ NormalizeLoadStoreState()

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

If the producer of a load's address is an alloca operation, then we can remove all state edges originating from other alloca operations coming through store operations.

a1 sa1 = AllocaOperation ... a2 sa2 = AllocaOperation ... ss1 = StoreNonVolatileOperation a1 ... sa1 ss2 = StoreNonVolatileOperation a2 ... sa2 ... = LoadNonVolatileOperation a1 ss1 ss2 => ... ... = LoadNonVolatileOperation a1 ss1

Parameters
operationThe load operation on which the transformation is performed.
operandsThe operands of the load node.
Returns
If the normalization could be applied, then the results of the load operation after the transformation. Otherwise, std::nullopt.

Definition at line 318 of file Load.cpp.

◆ operator==()

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

Definition at line 20 of file Load.cpp.


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