Jlm
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
jlm::llvm::aa::MemoryStateEncoder::StateMap Class Referencefinal

Hash map for mapping points-to graph memory nodes to RVSDG memory states. More...

Public Member Functions

 StateMap ()=default
 
 StateMap (const StateMap &)=delete
 
 StateMap (StateMap &&)=delete
 
StateMap & operator= (const StateMap &)=delete
 
StateMap & operator= (StateMap &&)=delete
 
rvsdg::Output * tryGetState (const PointsToGraph::NodeIndex modRefNode) noexcept
 
rvsdg::Output & getState (const PointsToGraph::NodeIndex modRefNode)
 
std::vector< rvsdg::Output * > getOrCreateStates (const std::vector< MemoryNodeId > &modRefNodes, rvsdg::Region &region)
 
void updateState (const MemoryNodeId modRefNode, rvsdg::Output &memoryState)
 
void updateStates (const std::vector< MemoryNodeId > &modRefNodes, const rvsdg::Node::OutputIteratorRange &memoryStates)
 
void insertState (PointsToGraph::NodeIndex modRefNode, rvsdg::Output &state)
 

Private Attributes

std::unordered_map< PointsToGraph::NodeIndex, rvsdg::Output * > states_
 

Detailed Description

Hash map for mapping points-to graph memory nodes to RVSDG memory states.

Definition at line 327 of file MemoryStateEncoder.cpp.

Constructor & Destructor Documentation

◆ StateMap() [1/3]

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

◆ StateMap() [2/3]

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

◆ StateMap() [3/3]

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

Member Function Documentation

◆ getOrCreateStates()

std::vector< rvsdg::Output * > jlm::llvm::aa::MemoryStateEncoder::StateMap::getOrCreateStates ( const std::vector< MemoryNodeId > &  modRefNodes,
rvsdg::Region &  region 
)
inline

Gets the memory state for each of the given memory nodes. If no memory state output exists for a given memory node, an UndefValue node is created. This only happens when a ModRefSet contains alloca whose memory state is not routed in as a function argument, and the alloca operation has not been encoded yet. This can happen when alloca operations are inside subregions, or when the allocation count is a runtime value that depends on a load.

Parameters
modRefNodesthe set of memory nodes to retrieve states for.
regionthe region in which the states are needed
Returns
The memory states for each given memory nodes.

Definition at line 373 of file MemoryStateEncoder.cpp.

◆ getState()

rvsdg::Output & jlm::llvm::aa::MemoryStateEncoder::StateMap::getState ( const PointsToGraph::NodeIndex  modRefNode)
inline

Definition at line 352 of file MemoryStateEncoder.cpp.

◆ insertState()

void jlm::llvm::aa::MemoryStateEncoder::StateMap::insertState ( PointsToGraph::NodeIndex  modRefNode,
rvsdg::Output &  state 
)
inline

Inserts memory state state for memory node modRefNode in the state map. The memory node must not have an already associated state.

Parameters
modRefNodethe memory node
statethe output that produces the memory state associated with the memory node

Definition at line 433 of file MemoryStateEncoder.cpp.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ tryGetState()

rvsdg::Output * jlm::llvm::aa::MemoryStateEncoder::StateMap::tryGetState ( const PointsToGraph::NodeIndex  modRefNode)
inlinenoexcept

Definition at line 343 of file MemoryStateEncoder.cpp.

◆ updateState()

void jlm::llvm::aa::MemoryStateEncoder::StateMap::updateState ( const MemoryNodeId  modRefNode,
rvsdg::Output &  memoryState 
)
inline

Definition at line 400 of file MemoryStateEncoder.cpp.

◆ updateStates()

void jlm::llvm::aa::MemoryStateEncoder::StateMap::updateStates ( const std::vector< MemoryNodeId > &  modRefNodes,
const rvsdg::Node::OutputIteratorRange &  memoryStates 
)
inline

Definition at line 409 of file MemoryStateEncoder.cpp.

Member Data Documentation

◆ states_

std::unordered_map<PointsToGraph::NodeIndex, rvsdg::Output *> jlm::llvm::aa::MemoryStateEncoder::StateMap::states_
private

Definition at line 440 of file MemoryStateEncoder.cpp.


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