Jlm
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
jlm::llvm::aa::RegionAwareModRefSet Class Referencefinal
Inheritance diagram for jlm::llvm::aa::RegionAwareModRefSet:
Inheritance graph
[legend]
Collaboration diagram for jlm::llvm::aa::RegionAwareModRefSet:
Collaboration graph
[legend]

Public Member Functions

 RegionAwareModRefSet ()=default
 
std::optional< size_t > getRefExternalMinSize () const
 
std::optional< size_t > getModExternalMinSize () const
 
bool markAsReferencingExternal (size_t minSize)
 
bool markAsModifyingExternal (size_t minSize)
 
ModRefEffect getImplicitModRefEffectForExternal (std::optional< size_t > size) const noexcept
 
bool mayCallExternalFunction () const
 
bool markAsCallingExternalFunction ()
 
bool addExplicitMemoryNode (PointsToGraph::NodeIndex memoryNode, ModRefEffect modRefEffect)
 
bool addMemoryNode (PointsToGraph::NodeIndex memoryNode, bool isExternallyAvailable, std::optional< size_t > memoryNodeSize, ModRefEffect modRefEffect)
 
void keepSubsetOfExplicitMemoryNodes (const util::HashSet< PointsToGraph::NodeIndex > &filter)
 
bool propagateFlags (const RegionAwareModRefSet &other)
 
- Public Member Functions inherited from jlm::llvm::aa::ModRefSet
const std::unordered_map< PointsToGraph::NodeIndex, ModRefEffect > & getModRefNodes () const
 

Static Public Attributes

static constexpr uint32_t NoneSize = std::numeric_limits<uint32_t>::max()
 

Private Attributes

uint32_t refExternalOfSize_ = NoneSize
 
uint32_t modExternalOfSize_ = NoneSize
 
bool callsExternalFunction_ = false
 

Additional Inherited Members

- Protected Member Functions inherited from jlm::llvm::aa::ModRefSet
 ModRefSet ()=default
 
 ModRefSet (const ModRefSet &other)=default
 
 ModRefSet (ModRefSet &&other)=default
 
ModRefSetoperator= (const ModRefSet &other)=default
 
ModRefSetoperator= (ModRefSet &&other)=default
 
- Protected Attributes inherited from jlm::llvm::aa::ModRefSet
std::unordered_map< PointsToGraph::NodeIndex, ModRefEffectmodRefNodes_
 

Detailed Description

ModRefSet subclass used by RegionAwareModRefSummarizer.

The class uses both implicit and explicit representations of memory nodes. The implicit representation is used for accesses to externally available memory, and calls (or structural nodes that contain calls) to functions in external modules. The explicit representation uses hash maps containing individual memory nodes.

After solving, implicit memory nodes are materialized into the explicit sets, with the exception of memory nodes that can be compressed into the external memory node. Constant memory is also left out of the final materialized sets.

See also
ModRefSet

Definition at line 248 of file RegionAwareModRefSummarizer.cpp.

Constructor & Destructor Documentation

◆ RegionAwareModRefSet()

jlm::llvm::aa::RegionAwareModRefSet::RegionAwareModRefSet ( )
default

Member Function Documentation

◆ addExplicitMemoryNode()

bool jlm::llvm::aa::RegionAwareModRefSet::addExplicitMemoryNode ( PointsToGraph::NodeIndex  memoryNode,
ModRefEffect  modRefEffect 
)
inline

Adds the given memoryNode as an explicit member of the ModRefSet. This function does not attempt to skip memory nodes that are already implicitly referenced.

Parameters
memoryNodethe index of the memory node in the points-to graph.
modRefEffectthe effect(s) that may be performed on the memory node
Returns
true if the ModRefSet was modified by this operation, otherwise false

Definition at line 387 of file RegionAwareModRefSummarizer.cpp.

◆ addMemoryNode()

bool jlm::llvm::aa::RegionAwareModRefSet::addMemoryNode ( PointsToGraph::NodeIndex  memoryNode,
bool  isExternallyAvailable,
std::optional< size_t >  memoryNodeSize,
ModRefEffect  modRefEffect 
)
inline

Adds the given memoryNode to the set, unless the memory node is already represented. Uses the external availability and byte size of the memory node to determine this.

Parameters
memoryNodethe index of the memory node in the points-to graph.
isExternallyAvailablea boolean indicating if the memory node is externally available.
memoryNodeSizethe byte size of the memory node, if known. Otherwise nullopt.
modRefEffectthe effect that may be performed on the added memory node.
Returns
true if the ModRefSet was modified by this operation, otherwise false

Definition at line 412 of file RegionAwareModRefSummarizer.cpp.

◆ getImplicitModRefEffectForExternal()

ModRefEffect jlm::llvm::aa::RegionAwareModRefSet::getImplicitModRefEffectForExternal ( std::optional< size_t >  size) const
inlinenoexcept

Helper function for finding the implicitly flagged ModRefEffect on a hypothetical externally available memory node, optionally of a specific size.

Parameters
sizethe size of the hypothetical memory node, or nullopt if unknown
Returns
the implicitly encoded ModRefEffect on the hypothetical memory node

Definition at line 335 of file RegionAwareModRefSummarizer.cpp.

◆ getModExternalMinSize()

std::optional< size_t > jlm::llvm::aa::RegionAwareModRefSet::getModExternalMinSize ( ) const
inline

The set can be flagged as possibly modifying all externally available memory locations with a byte size >= some minimum. (Also includes all memory nodes of unknown size.) If the set is flagged as possibly calling external functions, the size will be 0, indicating that all externally available memory is possibly modified by this set.

Returns
the minimum size where all externally available memory is modified by this set. If the set is not flagged, nullopt is returned.

Definition at line 283 of file RegionAwareModRefSummarizer.cpp.

◆ getRefExternalMinSize()

std::optional< size_t > jlm::llvm::aa::RegionAwareModRefSet::getRefExternalMinSize ( ) const
inline

The set can be flagged as possibly referencing all externally available memory locations with a byte size >= some minimum. (Also includes all memory nodes of unknown size.) If the set is flagged as possibly calling external functions, its size will always be 0, indicating that all externally available memory is possibly referenced by this set.

Returns
the minimum size where all externally available memory is referenced by this set. If the set is not flagged, nullopt is returned.

Definition at line 266 of file RegionAwareModRefSummarizer.cpp.

◆ keepSubsetOfExplicitMemoryNodes()

void jlm::llvm::aa::RegionAwareModRefSet::keepSubsetOfExplicitMemoryNodes ( const util::HashSet< PointsToGraph::NodeIndex > &  filter)
inline

Removes all explicit memory nodes that are not included in the given filter.

Definition at line 435 of file RegionAwareModRefSummarizer.cpp.

◆ markAsCallingExternalFunction()

bool jlm::llvm::aa::RegionAwareModRefSet::markAsCallingExternalFunction ( )
inline

Marks the ModRefSet as possibly containing calls to externally defined functions.

Returns
true if the ModRefSet was modified by this operation, otherwise false

Definition at line 365 of file RegionAwareModRefSummarizer.cpp.

◆ markAsModifyingExternal()

bool jlm::llvm::aa::RegionAwareModRefSet::markAsModifyingExternal ( size_t  minSize)
inline

Marks the set as possibly modifying all externally available memory of size >= minSize.

Parameters
minSizethe minimum byte size of the memory locations. 0 means all sizes.
Returns
true if the ModRefSet was modified by this operation, otherwise false

Definition at line 315 of file RegionAwareModRefSummarizer.cpp.

◆ markAsReferencingExternal()

bool jlm::llvm::aa::RegionAwareModRefSet::markAsReferencingExternal ( size_t  minSize)
inline

Marks the ModRefSet as referencing all externally available memory of size >= minSize.

Parameters
minSizethe minimum byte size of the memory locations. 0 means all sizes.
Returns
true if the ModRefSet was modified by this operation, otherwise false

Definition at line 296 of file RegionAwareModRefSummarizer.cpp.

◆ mayCallExternalFunction()

bool jlm::llvm::aa::RegionAwareModRefSet::mayCallExternalFunction ( ) const
inline
Returns
true if the ModRefSet represents possible calls to externally defined functions.

Definition at line 355 of file RegionAwareModRefSummarizer.cpp.

◆ propagateFlags()

bool jlm::llvm::aa::RegionAwareModRefSet::propagateFlags ( const RegionAwareModRefSet other)
inline

Propagates all flags from the given set other to this set.

Returns
true if any flags in this ModRefSet changed, false otherwise

Definition at line 452 of file RegionAwareModRefSummarizer.cpp.

Member Data Documentation

◆ callsExternalFunction_

bool jlm::llvm::aa::RegionAwareModRefSet::callsExternalFunction_ = false
private

Definition at line 493 of file RegionAwareModRefSummarizer.cpp.

◆ modExternalOfSize_

uint32_t jlm::llvm::aa::RegionAwareModRefSet::modExternalOfSize_ = NoneSize
private

Definition at line 490 of file RegionAwareModRefSummarizer.cpp.

◆ NoneSize

constexpr uint32_t jlm::llvm::aa::RegionAwareModRefSet::NoneSize = std::numeric_limits<uint32_t>::max()
staticconstexpr

Definition at line 252 of file RegionAwareModRefSummarizer.cpp.

◆ refExternalOfSize_

uint32_t jlm::llvm::aa::RegionAwareModRefSet::refExternalOfSize_ = NoneSize
private

Definition at line 487 of file RegionAwareModRefSummarizer.cpp.


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