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

#include <Store.hpp>

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

Public Member Functions

 ~StoreNonVolatileOperation () noexcept override
 
 StoreNonVolatileOperation (std::shared_ptr< const rvsdg::Type > storedType, const size_t numMemoryStates, const 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::StoreOperation
size_t GetAlignment () const noexcept
 
const rvsdg::TypeGetStoredType () 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 * > > NormalizeStoreMux (const StoreNonVolatileOperation &operation, const std::vector< rvsdg::Output * > &operands)
 Swaps a memory state merge operation and a store operation. More...
 
static std::optional< std::vector< rvsdg::Output * > > NormalizeStoreStore (const StoreNonVolatileOperation &operation, const std::vector< rvsdg::Output * > &operands)
 Removes a duplicated store to the same address. More...
 
static std::optional< std::vector< rvsdg::Output * > > NormalizeStoreAlloca (const StoreNonVolatileOperation &operation, const std::vector< rvsdg::Output * > &operands)
 Removes unnecessary state from a store node when its address originates directly from an alloca node. More...
 
static std::optional< std::vector< rvsdg::Output * > > NormalizeDuplicateStates (const StoreNonVolatileOperation &operation, const std::vector< rvsdg::Output * > &operands)
 Remove duplicated state operands. More...
 
static std::optional< std::vector< rvsdg::Output * > > NormalizeIOBarrierAllocaAddress (const StoreNonVolatileOperation &operation, const std::vector< rvsdg::Output * > &operands)
 Redirect the address operand of the StoreNonVolatileOperation from an IOBarrierOperation when it can be determined that it originates from an AllocaOperation. More...
 
static std::optional< std::vector< rvsdg::Output * > > normalizeStoreAllocaSingleUser (const StoreNonVolatileOperation &operation, const std::vector< rvsdg::Output * > &operands)
 
static std::unique_ptr< llvm::ThreeAddressCodeCreate (const Variable *address, const Variable *value, const Variable *state, size_t alignment)
 
static std::vector< rvsdg::Output * > Create (rvsdg::Output *address, rvsdg::Output *value, const std::vector< rvsdg::Output * > &memoryStates, size_t alignment)
 
static rvsdg::SimpleNodeCreateNode (rvsdg::Output &address, rvsdg::Output &value, const std::vector< rvsdg::Output * > &memoryStates, size_t alignment)
 
static std::vector< rvsdg::Output * > Create (rvsdg::Region &region, std::unique_ptr< StoreNonVolatileOperation > storeOperation, const std::vector< rvsdg::Output * > &operands)
 
static rvsdg::SimpleNodeCreateNode (rvsdg::Region &region, std::unique_ptr< StoreNonVolatileOperation > storeOperation, const std::vector< rvsdg::Output * > &operands)
 
- Static Public Member Functions inherited from jlm::llvm::StoreOperation
static rvsdg::InputAddressInput (const rvsdg::Node &node) noexcept
 
static rvsdg::InputStoredValueInput (const rvsdg::Node &node) noexcept
 
static rvsdg::Node::OutputIteratorRange MemoryStateOutputs (const rvsdg::SimpleNode &node) noexcept
 
static rvsdg::InputMapMemoryStateOutputToInput (const rvsdg::Output &output)
 

Static Private Member Functions

static const std::shared_ptr< const jlm::rvsdg::TypeCheckAndExtractStoredType (const std::shared_ptr< const rvsdg::Type > &type)
 
static std::vector< std::shared_ptr< const rvsdg::Type > > CreateOperandTypes (std::shared_ptr< const rvsdg::Type > storedType, size_t numMemoryStates)
 

Additional Inherited Members

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

Detailed Description

Represents an LLVM store instruction.

See also
StoreVolatileOperation

Definition at line 132 of file Store.hpp.

Constructor & Destructor Documentation

◆ ~StoreNonVolatileOperation()

jlm::llvm::StoreNonVolatileOperation::~StoreNonVolatileOperation ( )
overridedefaultnoexcept

◆ StoreNonVolatileOperation()

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

Definition at line 137 of file Store.hpp.

Member Function Documentation

◆ CheckAndExtractStoredType()

static const std::shared_ptr<const jlm::rvsdg::Type> jlm::llvm::StoreNonVolatileOperation::CheckAndExtractStoredType ( const std::shared_ptr< const rvsdg::Type > &  type)
inlinestaticprivate

Definition at line 338 of file Store.hpp.

◆ copy()

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

Implements jlm::rvsdg::Operation.

Definition at line 34 of file Store.cpp.

◆ Create() [1/3]

static std::unique_ptr<llvm::ThreeAddressCode> jlm::llvm::StoreNonVolatileOperation::Create ( const Variable address,
const Variable value,
const Variable state,
size_t  alignment 
)
inlinestatic

Definition at line 281 of file Store.hpp.

◆ Create() [2/3]

static std::vector<rvsdg::Output *> jlm::llvm::StoreNonVolatileOperation::Create ( rvsdg::Output address,
rvsdg::Output value,
const std::vector< rvsdg::Output * > &  memoryStates,
size_t  alignment 
)
inlinestatic

Definition at line 290 of file Store.hpp.

◆ Create() [3/3]

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

Definition at line 319 of file Store.hpp.

◆ CreateNode() [1/2]

static rvsdg::SimpleNode& jlm::llvm::StoreNonVolatileOperation::CreateNode ( rvsdg::Output address,
rvsdg::Output value,
const std::vector< rvsdg::Output * > &  memoryStates,
size_t  alignment 
)
inlinestatic

Definition at line 300 of file Store.hpp.

◆ CreateNode() [2/2]

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

Definition at line 328 of file Store.hpp.

◆ CreateOperandTypes()

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

Definition at line 349 of file Store.hpp.

◆ debug_string()

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

Implements jlm::rvsdg::Operation.

Definition at line 28 of file Store.cpp.

◆ NormalizeDuplicateStates()

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

Remove duplicated state operands.

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

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

Definition at line 234 of file Store.cpp.

◆ NormalizeIOBarrierAllocaAddress()

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

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

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

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

Definition at line 245 of file Store.cpp.

◆ NormalizeStoreAlloca()

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

Removes unnecessary state from a store node when its address originates directly from an alloca node.

a s = AllocaOperation b so1 so2 = StoreNonVolatileOperation a v s si1 si2 ... = AnyOperation so1 so2 => a s = AllocaOperation b so1 = StoreNonVolatileOperation a v s ... = AnyOp so1 so1

Parameters
operationThe operation of the StoreNonVolatile node.
operandsThe operands of the StoreNonVolatile node.
Returns
If the normalization could be applied, then the results of the store operation after the transformation. Otherwise, std::nullopt.

Definition at line 223 of file Store.cpp.

◆ normalizeStoreAllocaSingleUser()

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

Redirect the users of the StoreNonVolatileOperation results to its memory state operands if it can be shown that the StoreNonVolatileOperation is the only user of an AllocaOperation.

a s1 = AllocaOperation ... s2 = StoreNonVolatileOperation a v s1 ... = AnyOperation s2 => a s1 = AllocaOperation ... ... = AnyOperation s1

Definition at line 273 of file Store.cpp.

◆ NormalizeStoreMux()

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

Swaps a memory state merge operation and a store operation.

sx1 = MemStateMergeOperation si1 ... siM sl1 = StoreNonVolatileOperation a v sx1 => sl1 ... slM = StoreNonVolatileOperation a v si1 ... siM sx1 = MemStateMergeOperation sl1 ... slM

FIXME: The reduction can be generalized: A store node can have multiple operands from different merge nodes.

Parameters
operationThe operation of the StoreNonVolatile node.
operandsThe operands of the StoreNonVolatile node.
Returns
If the normalization could be applied, then the results of the store operation after the transformation. Otherwise, std::nullopt.

Definition at line 201 of file Store.cpp.

◆ NormalizeStoreStore()

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

Removes a duplicated store to the same address.

so1 so2 = StoreNonVolatileOperation a v1 si1 si2 sx1 sx2 = StoreNonVolatileOperation a v2 so1 so2 => sx1 sx2 = StoreNonVolatileOperation a v2 si1 si2

Parameters
operationThe operation of the StoreNonVolatile node.
operandsThe operands of the StoreNonVolatile node.
Returns
If the normalization could be applied, then the results of the store operation after the transformation. Otherwise, std::nullopt.

Definition at line 212 of file Store.cpp.

◆ operator==()

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

Definition at line 19 of file Store.cpp.


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