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

Mod/Ref summary of region-aware mod/ref summarizer. More...

Inheritance diagram for jlm::llvm::aa::RegionAwareModRefSummary:
Inheritance graph
[legend]
Collaboration diagram for jlm::llvm::aa::RegionAwareModRefSummary:
Collaboration graph
[legend]

Public Member Functions

 RegionAwareModRefSummary (const PointsToGraph &pointsToGraph)
 
 RegionAwareModRefSummary (const RegionAwareModRefSummary &)=delete
 
RegionAwareModRefSummary & operator= (const RegionAwareModRefSummary &)=delete
 
const PointsToGraph & GetPointsToGraph () const noexcept override
 
size_t NumModRefSets () const noexcept
 
RegionAwareModRefSet & getModRefSet (ModRefSetIndex index)
 
const RegionAwareModRefSet & getModRefSet (ModRefSetIndex index) const
 
bool markSetAsReferencingExternal (ModRefSetIndex index, size_t minSize)
 
bool markSetAsModifyingExternal (ModRefSetIndex index, size_t minSize)
 
bool markSetAsCallingExternalFunction (ModRefSetIndex index)
 
bool addMemoryNodeToSet (ModRefSetIndex index, PointsToGraph::NodeIndex ptgNode, ModRefEffect modRefEffect)
 
bool addExplicitMemoryNodeToSet (ModRefSetIndex index, PointsToGraph::NodeIndex ptgNode, ModRefEffect modRefEffect)
 
ModRefSetIndex getExternModRefSet () const noexcept
 
bool hasSetForNode (const rvsdg::Node &node) const
 
ModRefSetIndex getSetForNode (const rvsdg::Node &node) const
 
ModRefSetIndex getOrCreateSetForNode (const rvsdg::Node &node, const rvsdg::LambdaNode &lambdaNode)
 
const std::vector< ModRefSetIndex > & getAllSetsInFunction (const rvsdg::LambdaNode &lambdaNode)
 
std::string getModRefSetDebugString (ModRefSetIndex index) const
 
const ModRefSet & GetSimpleNodeModRef (const rvsdg::SimpleNode &node) const override
 
const ModRefSet & GetGammaEntryModRef (const rvsdg::GammaNode &gamma) const override
 
const ModRefSet & GetGammaExitModRef (const rvsdg::GammaNode &gamma) const override
 
const ModRefSet & GetThetaModRef (const rvsdg::ThetaNode &theta) const override
 
const ModRefSet & GetLambdaEntryModRef (const rvsdg::LambdaNode &lambda) const override
 
const ModRefSet & GetLambdaExitModRef (const rvsdg::LambdaNode &lambda) const override
 
- Public Member Functions inherited from jlm::llvm::aa::ModRefSummary
virtual ~ModRefSummary () noexcept=default
 

Static Public Member Functions

static std::unique_ptr< RegionAwareModRefSummary > Create (const PointsToGraph &pointsToGraph)
 

Private Member Functions

ModRefSetIndex createModRefSet ()
 

Private Attributes

const PointsToGraph & pointsToGraph_
 
std::vector< RegionAwareModRefSet > modRefSets_
 
ModRefSetIndex externModRefSet_
 
std::unordered_map< const rvsdg::LambdaNode *, std::vector< ModRefSetIndex > > modRefSetsInFunction_
 
std::unordered_map< const rvsdg::Node *, ModRefSetIndex > nodeMap_
 

Detailed Description

Mod/Ref summary of region-aware mod/ref summarizer.

Definition at line 484 of file RegionAwareModRefSummarizer.cpp.

Constructor & Destructor Documentation

◆ RegionAwareModRefSummary() [1/2]

jlm::llvm::aa::RegionAwareModRefSummary::RegionAwareModRefSummary ( const PointsToGraph &  pointsToGraph)
inlineexplicit

Definition at line 487 of file RegionAwareModRefSummarizer.cpp.

◆ RegionAwareModRefSummary() [2/2]

jlm::llvm::aa::RegionAwareModRefSummary::RegionAwareModRefSummary ( const RegionAwareModRefSummary &  )
delete

Member Function Documentation

◆ addExplicitMemoryNodeToSet()

bool jlm::llvm::aa::RegionAwareModRefSummary::addExplicitMemoryNodeToSet ( ModRefSetIndex  index,
PointsToGraph::NodeIndex  ptgNode,
ModRefEffect  modRefEffect 
)
inline

Adds the given memory node to a ModRefSet with the given effect. Does not perform any checks against doubled-up memory nodes.

Parameters
indexthe index of the ModRefSet being added to
ptgNodethe index of the memory node in the points-to graph
modRefEffectthe effect the ModRefSet has on the memory node
See also
addMemoryNodeToSet

Definition at line 576 of file RegionAwareModRefSummarizer.cpp.

◆ addMemoryNodeToSet()

bool jlm::llvm::aa::RegionAwareModRefSummary::addMemoryNodeToSet ( ModRefSetIndex  index,
PointsToGraph::NodeIndex  ptgNode,
ModRefEffect  modRefEffect 
)
inline

Adds the given ptgNode the ModRefSet with the given index. Performs checks to avoid adding doubled-up memory nodes.

Parameters
indexthe index of the ModRefSet being added to
ptgNodethe index of the memory node in the points-to graph
modRefEffectthe effect the ModRefSet has on the memory node
Returns
true if the ModRefSet grew, false otherwise.

Definition at line 555 of file RegionAwareModRefSummarizer.cpp.

◆ Create()

static std::unique_ptr< RegionAwareModRefSummary > jlm::llvm::aa::RegionAwareModRefSummary::Create ( const PointsToGraph &  pointsToGraph)
inlinestatic

Definition at line 722 of file RegionAwareModRefSummarizer.cpp.

◆ createModRefSet()

ModRefSetIndex jlm::llvm::aa::RegionAwareModRefSummary::createModRefSet ( )
inlineprivate

Definition at line 729 of file RegionAwareModRefSummarizer.cpp.

◆ getAllSetsInFunction()

const std::vector< ModRefSetIndex > & jlm::llvm::aa::RegionAwareModRefSummary::getAllSetsInFunction ( const rvsdg::LambdaNode &  lambdaNode)
inline

Definition at line 637 of file RegionAwareModRefSummarizer.cpp.

◆ getExternModRefSet()

ModRefSetIndex jlm::llvm::aa::RegionAwareModRefSummary::getExternModRefSet ( ) const
inlinenoexcept

The ModRefSummary has one set representing external functions, containing all memory nodes that can be referenced or modified by external functions. This set also includes memory operations performed in functions that can be called from external functions, so will in practice contain most memory operations in the module. The exceptions are allocas that are provably not involved in recursion, since any such alloca that is affected by a call to an external function will be dead by the time the call returns.

Returns
the index of the ModRefSet representing external functions

Definition at line 596 of file RegionAwareModRefSummarizer.cpp.

◆ GetGammaEntryModRef()

const ModRefSet & jlm::llvm::aa::RegionAwareModRefSummary::GetGammaEntryModRef ( const rvsdg::GammaNode &  gamma) const
inlineoverridevirtual

Provides the set of memory nodes that should be routed into a given gamma node

Parameters
gammathe gamma node
Returns
the entry Mod/Ref set for the gamma

Implements jlm::llvm::aa::ModRefSummary.

Definition at line 692 of file RegionAwareModRefSummarizer.cpp.

◆ GetGammaExitModRef()

const ModRefSet & jlm::llvm::aa::RegionAwareModRefSummary::GetGammaExitModRef ( const rvsdg::GammaNode &  gamma) const
inlineoverridevirtual

Provides the set of memory nodes that should be routed out of a given gamma node

Parameters
gammathe gamma node
Returns
the exit Mod/Ref set for the gamma

Implements jlm::llvm::aa::ModRefSummary.

Definition at line 698 of file RegionAwareModRefSummarizer.cpp.

◆ GetLambdaEntryModRef()

const ModRefSet & jlm::llvm::aa::RegionAwareModRefSummary::GetLambdaEntryModRef ( const rvsdg::LambdaNode &  lambda) const
inlineoverridevirtual

Provides the set of memory nodes that are routed in to the given lambda's subregion

Parameters
lambdathe lambda node
Returns
the entry Mod/Ref set for the lambda

Implements jlm::llvm::aa::ModRefSummary.

Definition at line 710 of file RegionAwareModRefSummarizer.cpp.

◆ GetLambdaExitModRef()

const ModRefSet & jlm::llvm::aa::RegionAwareModRefSummary::GetLambdaExitModRef ( const rvsdg::LambdaNode &  lambda) const
inlineoverridevirtual

Provides the set of memory nodes that are routed out of the given lambda's subregion

Parameters
lambdathe lambda node
Returns
the exit Mod/Ref set for the lambda

Implements jlm::llvm::aa::ModRefSummary.

Definition at line 716 of file RegionAwareModRefSummarizer.cpp.

◆ getModRefSet() [1/2]

RegionAwareModRefSet & jlm::llvm::aa::RegionAwareModRefSummary::getModRefSet ( ModRefSetIndex  index)
inline

Definition at line 514 of file RegionAwareModRefSummarizer.cpp.

◆ getModRefSet() [2/2]

const RegionAwareModRefSet & jlm::llvm::aa::RegionAwareModRefSummary::getModRefSet ( ModRefSetIndex  index) const
inline

Definition at line 521 of file RegionAwareModRefSummarizer.cpp.

◆ getModRefSetDebugString()

std::string jlm::llvm::aa::RegionAwareModRefSummary::getModRefSetDebugString ( ModRefSetIndex  index) const
inline

Definition at line 643 of file RegionAwareModRefSummarizer.cpp.

◆ getOrCreateSetForNode()

ModRefSetIndex jlm::llvm::aa::RegionAwareModRefSummary::getOrCreateSetForNode ( const rvsdg::Node &  node,
const rvsdg::LambdaNode &  lambdaNode 
)
inline

Get the ModRefSet associated with the given node, or creates one if none exists.

Parameters
nodethe RVSDG node to be represented by a ModRefSet
lambdaNodethe function the RVSDG node belongs to.
Returns
the index of the exisiting or created ModRefSet representing the node

Definition at line 622 of file RegionAwareModRefSummarizer.cpp.

◆ GetPointsToGraph()

const PointsToGraph & jlm::llvm::aa::RegionAwareModRefSummary::GetPointsToGraph ( ) const
inlineoverridevirtualnoexcept

Implements jlm::llvm::aa::ModRefSummary.

Definition at line 502 of file RegionAwareModRefSummarizer.cpp.

◆ getSetForNode()

ModRefSetIndex jlm::llvm::aa::RegionAwareModRefSummary::getSetForNode ( const rvsdg::Node &  node) const
inline

Definition at line 608 of file RegionAwareModRefSummarizer.cpp.

◆ GetSimpleNodeModRef()

const ModRefSet & jlm::llvm::aa::RegionAwareModRefSummary::GetSimpleNodeModRef ( const rvsdg::SimpleNode &  node) const
inlineoverridevirtual

Provides the ModRefSet containing memory nodes that may be modified or referenced by the given simple node.

The simple node can be any operation that reads from memory, or produces value of memory, e.g.:

Parameters
nodethe node operating on memory
Returns
the Mod/Ref set of the node.

Implements jlm::llvm::aa::ModRefSummary.

Definition at line 686 of file RegionAwareModRefSummarizer.cpp.

◆ GetThetaModRef()

const ModRefSet & jlm::llvm::aa::RegionAwareModRefSummary::GetThetaModRef ( const rvsdg::ThetaNode &  theta) const
inlineoverridevirtual

Provides the set of memory nodes that should be routed in and out of a theta node

Parameters
thetathe theta node
Returns
the Mod/Ref set for the theta

Implements jlm::llvm::aa::ModRefSummary.

Definition at line 704 of file RegionAwareModRefSummarizer.cpp.

◆ hasSetForNode()

bool jlm::llvm::aa::RegionAwareModRefSummary::hasSetForNode ( const rvsdg::Node &  node) const
inline

Definition at line 602 of file RegionAwareModRefSummarizer.cpp.

◆ markSetAsCallingExternalFunction()

bool jlm::llvm::aa::RegionAwareModRefSummary::markSetAsCallingExternalFunction ( ModRefSetIndex  index)
inline

Definition at line 540 of file RegionAwareModRefSummarizer.cpp.

◆ markSetAsModifyingExternal()

bool jlm::llvm::aa::RegionAwareModRefSummary::markSetAsModifyingExternal ( ModRefSetIndex  index,
size_t  minSize 
)
inline

Definition at line 534 of file RegionAwareModRefSummarizer.cpp.

◆ markSetAsReferencingExternal()

bool jlm::llvm::aa::RegionAwareModRefSummary::markSetAsReferencingExternal ( ModRefSetIndex  index,
size_t  minSize 
)
inline

Definition at line 528 of file RegionAwareModRefSummarizer.cpp.

◆ NumModRefSets()

size_t jlm::llvm::aa::RegionAwareModRefSummary::NumModRefSets ( ) const
inlinenoexcept

Definition at line 508 of file RegionAwareModRefSummarizer.cpp.

◆ operator=()

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

Member Data Documentation

◆ externModRefSet_

ModRefSetIndex jlm::llvm::aa::RegionAwareModRefSummary::externModRefSet_
private

The ModRefSet representing every effect external function calls may have on memory nodes. These effects include the possibility of external functions calling into local functions.

See also
getExternModRefSet()

Definition at line 747 of file RegionAwareModRefSummarizer.cpp.

◆ modRefSets_

std::vector<RegionAwareModRefSet> jlm::llvm::aa::RegionAwareModRefSummary::modRefSets_
private

All sets of ModRef information in the summary

Definition at line 740 of file RegionAwareModRefSummarizer.cpp.

◆ modRefSetsInFunction_

std::unordered_map<const rvsdg::LambdaNode *, std::vector<ModRefSetIndex> > jlm::llvm::aa::RegionAwareModRefSummary::modRefSetsInFunction_
private

Lists ModRefSets grouped by the function of node they belong to.

Definition at line 752 of file RegionAwareModRefSummarizer.cpp.

◆ nodeMap_

std::unordered_map<const rvsdg::Node *, ModRefSetIndex> jlm::llvm::aa::RegionAwareModRefSummary::nodeMap_
private

Map from nodes that have memory side effects, to their ModRefSet. Includes nodes like loads, stores, memcpy, free and calls. Also includes structural nodes like gamma, theta and lambda.

Definition at line 759 of file RegionAwareModRefSummarizer.cpp.

◆ pointsToGraph_

const PointsToGraph& jlm::llvm::aa::RegionAwareModRefSummary::pointsToGraph_
private

Definition at line 735 of file RegionAwareModRefSummarizer.cpp.


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