Jlm
Loading...
Searching...
No Matches
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>

Collaboration diagram for jlm::llvm::aa::MemoryStateEncoder:
Collaboration graph
[legend]

Classes

struct  EncodingCounter
 
struct  MemoryStateTypeCounters
 
class  StateMap
 Hash map for mapping points-to graph memory nodes to RVSDG memory states. More...
 
class  Statistics
 Statistics class for memory state encoder encoding. More...
 

Public Member Functions

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

Private Member Functions

void encodeInterProcedural (rvsdg::Region &region)
 
void encodeIntraProcedural (rvsdg::Region &region, StateMap &stateMap)
 
void encodeAlloca (const rvsdg::SimpleNode &allocaNode, StateMap &stateMap) const
 
void encodeMalloc (const rvsdg::SimpleNode &mallocNode, StateMap &stateMap) const
 
void encodeLoad (const rvsdg::SimpleNode &node, StateMap &stateMap)
 
void encodeStore (const rvsdg::SimpleNode &node, StateMap &stateMap)
 
void encodeFree (const rvsdg::SimpleNode &freeNode, StateMap &stateMap) const
 
void encodeCall (const rvsdg::SimpleNode &callNode, StateMap &stateMap) const
 
void encodeMemcpy (const rvsdg::SimpleNode &memcpyNode, StateMap &stateMap) const
 
void encodeMemset (const rvsdg::SimpleNode &memsetNode, StateMap &stateMap) const
 
void encodeMemmove (const rvsdg::SimpleNode &memmoveNode, StateMap &stateMap) const
 
void encodeLambda (const rvsdg::LambdaNode &lambda)
 
void encodeGamma (rvsdg::GammaNode &gammaNode, StateMap &stateMap)
 
void encodeTheta (rvsdg::ThetaNode &thetaNode, StateMap &stateMap)
 
std::unique_ptr< MemoryStateTypeCounters > gatherStatistics (const rvsdg::Region &region) const
 

Static Private Member Functions

static rvsdg::SimpleNode & replaceLoadNode (const rvsdg::SimpleNode &node, const std::vector< rvsdg::Output * > &memoryStates)
 
static rvsdg::SimpleNode & replaceStoreNode (const rvsdg::SimpleNode &node, const std::vector< rvsdg::Output * > &memoryStates)
 
static rvsdg::SimpleNode & replaceMemcpyNode (const rvsdg::SimpleNode &memCpyNode, const std::vector< rvsdg::Output * > &memoryStates)
 
static rvsdg::SimpleNode & replaceMemsetNode (const rvsdg::SimpleNode &memsetNode, const std::vector< rvsdg::Output * > &memoryStates)
 
static rvsdg::SimpleNode & replaceMemmoveNode (const rvsdg::SimpleNode &memmoveNode, const std::vector< rvsdg::Output * > &memoryStates)
 

Private Attributes

EncodingCounter encodingCounter_
 
std::unique_ptr< Statistics > statistics_
 
const ModRefSummary * modRefSummary_ = nullptr
 

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 47 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 460 of file MemoryStateEncoder.cpp.

◆ encodeAlloca()

void jlm::llvm::aa::MemoryStateEncoder::encodeAlloca ( const rvsdg::SimpleNode &  allocaNode,
StateMap &  stateMap 
) const
private

Definition at line 699 of file MemoryStateEncoder.cpp.

◆ encodeCall()

void jlm::llvm::aa::MemoryStateEncoder::encodeCall ( const rvsdg::SimpleNode &  callNode,
StateMap &  stateMap 
) const
private

Definition at line 853 of file MemoryStateEncoder.cpp.

◆ encodeFree()

void jlm::llvm::aa::MemoryStateEncoder::encodeFree ( const rvsdg::SimpleNode &  freeNode,
StateMap &  stateMap 
) const
private

Definition at line 824 of file MemoryStateEncoder.cpp.

◆ encodeGamma()

void jlm::llvm::aa::MemoryStateEncoder::encodeGamma ( rvsdg::GammaNode &  gammaNode,
StateMap &  stateMap 
)
private

Definition at line 979 of file MemoryStateEncoder.cpp.

◆ encodeInterProcedural()

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

Definition at line 486 of file MemoryStateEncoder.cpp.

◆ encodeIntraProcedural()

void jlm::llvm::aa::MemoryStateEncoder::encodeIntraProcedural ( rvsdg::Region &  region,
StateMap &  stateMap 
)
private

Definition at line 512 of file MemoryStateEncoder.cpp.

◆ encodeLambda()

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

Definition at line 914 of file MemoryStateEncoder.cpp.

◆ encodeLoad()

void jlm::llvm::aa::MemoryStateEncoder::encodeLoad ( const rvsdg::SimpleNode &  node,
StateMap &  stateMap 
)
private

Definition at line 758 of file MemoryStateEncoder.cpp.

◆ encodeMalloc()

void jlm::llvm::aa::MemoryStateEncoder::encodeMalloc ( const rvsdg::SimpleNode &  mallocNode,
StateMap &  stateMap 
) const
private

Definition at line 727 of file MemoryStateEncoder.cpp.

◆ encodeMemcpy()

void jlm::llvm::aa::MemoryStateEncoder::encodeMemcpy ( const rvsdg::SimpleNode &  memcpyNode,
StateMap &  stateMap 
) const
private

Definition at line 875 of file MemoryStateEncoder.cpp.

◆ encodeMemmove()

void jlm::llvm::aa::MemoryStateEncoder::encodeMemmove ( const rvsdg::SimpleNode &  memmoveNode,
StateMap &  stateMap 
) const
private

Definition at line 901 of file MemoryStateEncoder.cpp.

◆ encodeMemset()

void jlm::llvm::aa::MemoryStateEncoder::encodeMemset ( const rvsdg::SimpleNode &  memsetNode,
StateMap &  stateMap 
) const
private

Definition at line 888 of file MemoryStateEncoder.cpp.

◆ encodeStore()

void jlm::llvm::aa::MemoryStateEncoder::encodeStore ( const rvsdg::SimpleNode &  node,
StateMap &  stateMap 
)
private

Definition at line 791 of file MemoryStateEncoder.cpp.

◆ encodeTheta()

void jlm::llvm::aa::MemoryStateEncoder::encodeTheta ( rvsdg::ThetaNode &  thetaNode,
StateMap &  stateMap 
)
private

Definition at line 1025 of file MemoryStateEncoder.cpp.

◆ gatherStatistics()

std::unique_ptr< MemoryStateEncoder::MemoryStateTypeCounters > jlm::llvm::aa::MemoryStateEncoder::gatherStatistics ( const rvsdg::Region &  region) const
private

Definition at line 580 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 1065 of file MemoryStateEncoder.cpp.

◆ replaceMemcpyNode()

rvsdg::SimpleNode & 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 MemCpyOperation node should consume.
Returns
A vector with the memory states of the newly created copy.

Definition at line 1174 of file MemoryStateEncoder.cpp.

◆ replaceMemmoveNode()

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

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

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

Definition at line 1251 of file MemoryStateEncoder.cpp.

◆ replaceMemsetNode()

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

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

Parameters
memsetNodeA rvsdg::SimpleNode representing a MemSetOperation.
memoryStatesThe memory states the new memset node should consume.
Returns
A vector with the memory states of the newly created copy.

Definition at line 1224 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 1123 of file MemoryStateEncoder.cpp.

Member Data Documentation

◆ encodingCounter_

EncodingCounter jlm::llvm::aa::MemoryStateEncoder::encodingCounter_
private

Definition at line 202 of file MemoryStateEncoder.hpp.

◆ modRefSummary_

const ModRefSummary* jlm::llvm::aa::MemoryStateEncoder::modRefSummary_ = nullptr
private

Definition at line 204 of file MemoryStateEncoder.hpp.

◆ statistics_

std::unique_ptr<Statistics> jlm::llvm::aa::MemoryStateEncoder::statistics_
private

Definition at line 203 of file MemoryStateEncoder.hpp.


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