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

Memory State Encoder. More...

#include <MemoryStateEncoder.hpp>

Classes

class  Context
 Context for the memory state encoder. More...
 

Public Member Functions

 ~MemoryStateEncoder () noexcept
 
 MemoryStateEncoder ()
 
 MemoryStateEncoder (const MemoryStateEncoder &)=delete
 
 MemoryStateEncoder (MemoryStateEncoder &&)=delete
 
MemoryStateEncoderoperator= (const MemoryStateEncoder &)=delete
 
MemoryStateEncoderoperator= (MemoryStateEncoder &&)=delete
 
void Encode (rvsdg::RvsdgModule &rvsdgModule, const ModRefSummary &modRefSummary, util::StatisticsCollector &statisticsCollector)
 

Private Member Functions

void EncodeRegion (rvsdg::Region &region)
 
void EncodeStructuralNode (rvsdg::StructuralNode &structuralNode)
 
void EncodeSimpleNode (const rvsdg::SimpleNode &simpleNode)
 
void EncodeAlloca (const rvsdg::SimpleNode &allocaNode)
 
void EncodeMalloc (const rvsdg::SimpleNode &mallocNode)
 
void EncodeLoad (const rvsdg::SimpleNode &node)
 
void EncodeStore (const rvsdg::SimpleNode &node)
 
void EncodeFree (const rvsdg::SimpleNode &freeNode)
 
void EncodeCall (const rvsdg::SimpleNode &callNode)
 
void EncodeMemcpy (const rvsdg::SimpleNode &memcpyNode)
 
void EncodeLambda (const rvsdg::LambdaNode &lambda)
 
void EncodeLambdaEntry (const rvsdg::LambdaNode &lambdaNode)
 
void EncodeLambdaExit (const rvsdg::LambdaNode &lambdaNode)
 
void EncodePhi (const rvsdg::PhiNode &phiNode)
 
void EncodeDelta (const rvsdg::DeltaNode &deltaNode)
 
void EncodeGamma (rvsdg::GammaNode &gammaNode)
 
void EncodeGammaEntry (rvsdg::GammaNode &gammaNode)
 
void EncodeGammaExit (rvsdg::GammaNode &gammaNode)
 
void EncodeTheta (rvsdg::ThetaNode &thetaNode)
 
std::vector< rvsdg::Output * > EncodeThetaEntry (rvsdg::ThetaNode &thetaNode)
 
void EncodeThetaExit (rvsdg::ThetaNode &thetaNode, const std::vector< rvsdg::Output * > &thetaStateOutputs)
 

Static Private Member Functions

static rvsdg::SimpleNodeReplaceLoadNode (const rvsdg::SimpleNode &node, const std::vector< rvsdg::Output * > &memoryStates)
 
static rvsdg::SimpleNodeReplaceStoreNode (const rvsdg::SimpleNode &node, const std::vector< rvsdg::Output * > &memoryStates)
 
static std::vector< rvsdg::Output * > ReplaceMemcpyNode (const rvsdg::SimpleNode &memcpyNode, const std::vector< rvsdg::Output * > &memoryStates)
 

Private Attributes

std::unique_ptr< ContextContext_
 

Detailed Description

Memory State Encoder.

A memory state encoder encodes a points-to graph in the RVSDG. The basic idea is that there exists a one-to-one correspondence between memory nodes in the points-to graph and memory states in the RVSDG, i.e., for each memory node in the points-to graph, there exists a memory state edge in the RVSDG. A memory state encoder routes these state edges through the RVSDG's structural nodes and ensures that simple nodes operating on a memory location represented by a corresponding memory node in the points-to graph are sequentialized with the respective memory state edge. For example, a store node that modifies a global variable needs to have the respective state edge that corresponds to its memory location routed through it, i.e., the store node is sequentialized by this state edge. Such an encoding ensures that the ordering of side-effecting operations touching on the same memory locations is preserved, while rendering operations independent that are not operating on the same memory locations.

Definition at line 53 of file MemoryStateEncoder.hpp.

Constructor & Destructor Documentation

◆ ~MemoryStateEncoder()

jlm::llvm::aa::MemoryStateEncoder::~MemoryStateEncoder ( )
defaultnoexcept

◆ MemoryStateEncoder() [1/3]

jlm::llvm::aa::MemoryStateEncoder::MemoryStateEncoder ( )
default

◆ MemoryStateEncoder() [2/3]

jlm::llvm::aa::MemoryStateEncoder::MemoryStateEncoder ( const MemoryStateEncoder )
delete

◆ MemoryStateEncoder() [3/3]

jlm::llvm::aa::MemoryStateEncoder::MemoryStateEncoder ( MemoryStateEncoder &&  )
delete

Member Function Documentation

◆ Encode()

void jlm::llvm::aa::MemoryStateEncoder::Encode ( rvsdg::RvsdgModule rvsdgModule,
const ModRefSummary modRefSummary,
util::StatisticsCollector statisticsCollector 
)

Definition at line 624 of file MemoryStateEncoder.cpp.

◆ EncodeAlloca()

void jlm::llvm::aa::MemoryStateEncoder::EncodeAlloca ( const rvsdg::SimpleNode allocaNode)
private

Definition at line 747 of file MemoryStateEncoder.cpp.

◆ EncodeCall()

void jlm::llvm::aa::MemoryStateEncoder::EncodeCall ( const rvsdg::SimpleNode callNode)
private

Definition at line 863 of file MemoryStateEncoder.cpp.

◆ EncodeDelta()

void jlm::llvm::aa::MemoryStateEncoder::EncodeDelta ( const rvsdg::DeltaNode deltaNode)
private

Definition at line 995 of file MemoryStateEncoder.cpp.

◆ EncodeFree()

void jlm::llvm::aa::MemoryStateEncoder::EncodeFree ( const rvsdg::SimpleNode freeNode)
private

Definition at line 842 of file MemoryStateEncoder.cpp.

◆ EncodeGamma()

void jlm::llvm::aa::MemoryStateEncoder::EncodeGamma ( rvsdg::GammaNode gammaNode)
private

Definition at line 1001 of file MemoryStateEncoder.cpp.

◆ EncodeGammaEntry()

void jlm::llvm::aa::MemoryStateEncoder::EncodeGammaEntry ( rvsdg::GammaNode gammaNode)
private

Definition at line 1018 of file MemoryStateEncoder.cpp.

◆ EncodeGammaExit()

void jlm::llvm::aa::MemoryStateEncoder::EncodeGammaExit ( rvsdg::GammaNode gammaNode)
private

Definition at line 1040 of file MemoryStateEncoder.cpp.

◆ EncodeLambda()

void jlm::llvm::aa::MemoryStateEncoder::EncodeLambda ( const rvsdg::LambdaNode lambda)
private

Definition at line 909 of file MemoryStateEncoder.cpp.

◆ EncodeLambdaEntry()

void jlm::llvm::aa::MemoryStateEncoder::EncodeLambdaEntry ( const rvsdg::LambdaNode lambdaNode)
private

Definition at line 917 of file MemoryStateEncoder.cpp.

◆ EncodeLambdaExit()

void jlm::llvm::aa::MemoryStateEncoder::EncodeLambdaExit ( const rvsdg::LambdaNode lambdaNode)
private

Definition at line 965 of file MemoryStateEncoder.cpp.

◆ EncodeLoad()

void jlm::llvm::aa::MemoryStateEncoder::EncodeLoad ( const rvsdg::SimpleNode node)
private

Definition at line 801 of file MemoryStateEncoder.cpp.

◆ EncodeMalloc()

void jlm::llvm::aa::MemoryStateEncoder::EncodeMalloc ( const rvsdg::SimpleNode mallocNode)
private

Definition at line 773 of file MemoryStateEncoder.cpp.

◆ EncodeMemcpy()

void jlm::llvm::aa::MemoryStateEncoder::EncodeMemcpy ( const rvsdg::SimpleNode memcpyNode)
private

Definition at line 895 of file MemoryStateEncoder.cpp.

◆ EncodePhi()

void jlm::llvm::aa::MemoryStateEncoder::EncodePhi ( const rvsdg::PhiNode phiNode)
private

Definition at line 989 of file MemoryStateEncoder.cpp.

◆ EncodeRegion()

void jlm::llvm::aa::MemoryStateEncoder::EncodeRegion ( rvsdg::Region region)
private

Definition at line 653 of file MemoryStateEncoder.cpp.

◆ EncodeSimpleNode()

void jlm::llvm::aa::MemoryStateEncoder::EncodeSimpleNode ( const rvsdg::SimpleNode simpleNode)
private

Definition at line 703 of file MemoryStateEncoder.cpp.

◆ EncodeStore()

void jlm::llvm::aa::MemoryStateEncoder::EncodeStore ( const rvsdg::SimpleNode node)
private

Definition at line 822 of file MemoryStateEncoder.cpp.

◆ EncodeStructuralNode()

void jlm::llvm::aa::MemoryStateEncoder::EncodeStructuralNode ( rvsdg::StructuralNode structuralNode)
private

Definition at line 674 of file MemoryStateEncoder.cpp.

◆ EncodeTheta()

void jlm::llvm::aa::MemoryStateEncoder::EncodeTheta ( rvsdg::ThetaNode thetaNode)
private

Definition at line 1062 of file MemoryStateEncoder.cpp.

◆ EncodeThetaEntry()

std::vector< rvsdg::Output * > jlm::llvm::aa::MemoryStateEncoder::EncodeThetaEntry ( rvsdg::ThetaNode thetaNode)
private

Definition at line 1074 of file MemoryStateEncoder.cpp.

◆ EncodeThetaExit()

void jlm::llvm::aa::MemoryStateEncoder::EncodeThetaExit ( rvsdg::ThetaNode thetaNode,
const std::vector< rvsdg::Output * > &  thetaStateOutputs 
)
private

Definition at line 1096 of file MemoryStateEncoder.cpp.

◆ operator=() [1/2]

MemoryStateEncoder& jlm::llvm::aa::MemoryStateEncoder::operator= ( const MemoryStateEncoder )
delete

◆ operator=() [2/2]

MemoryStateEncoder& jlm::llvm::aa::MemoryStateEncoder::operator= ( MemoryStateEncoder &&  )
delete

◆ ReplaceLoadNode()

rvsdg::SimpleNode & jlm::llvm::aa::MemoryStateEncoder::ReplaceLoadNode ( const rvsdg::SimpleNode node,
const std::vector< rvsdg::Output * > &  memoryStates 
)
staticprivate

Replace loadNode with a new copy that takes the provided memoryStates. All users of the outputs of loadNode are redirected to the respective outputs of the newly created copy.

Parameters
nodeA LoadNode.
memoryStatesThe memory states the new LoadNode should consume.
Returns
The newly created LoadNode.

Definition at line 1121 of file MemoryStateEncoder.cpp.

◆ ReplaceMemcpyNode()

std::vector< rvsdg::Output * > jlm::llvm::aa::MemoryStateEncoder::ReplaceMemcpyNode ( const rvsdg::SimpleNode memcpyNode,
const std::vector< rvsdg::Output * > &  memoryStates 
)
staticprivate

Replace memcpyNode with a new copy that takes the provided memoryStates. All users of the outputs of memcpyNode are redirected to the respective outputs of the newly created copy.

Parameters
memcpyNodeA rvsdg::SimpleNode representing a MemCpyOperation.
memoryStatesThe memory states the new memcpy node should consume.
Returns
A vector with the memory states of the newly created copy.

Definition at line 1196 of file MemoryStateEncoder.cpp.

◆ ReplaceStoreNode()

rvsdg::SimpleNode & jlm::llvm::aa::MemoryStateEncoder::ReplaceStoreNode ( const rvsdg::SimpleNode node,
const std::vector< rvsdg::Output * > &  memoryStates 
)
staticprivate

Replace storeNode with a new copy that takes the provided memoryStates. All users of the outputs of storeNode are redirected to the respective outputs of the newly created copy.

Parameters
nodeA StoreNode.
memoryStatesThe memory states the new StoreNode should consume.
Returns
The newly created StoreNode.

Definition at line 1163 of file MemoryStateEncoder.cpp.

Member Data Documentation

◆ Context_

std::unique_ptr<Context> jlm::llvm::aa::MemoryStateEncoder::Context_
private

Definition at line 187 of file MemoryStateEncoder.hpp.


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