Jlm
Public Member Functions | Private Member Functions | Private Attributes | List of all members
jlm::llvm::aa::PointsToGraphAliasAnalysis Class Reference

#include <PointsToGraphAliasAnalysis.hpp>

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

Public Member Functions

 PointsToGraphAliasAnalysis (const PointsToGraph &pointsToGraph)
 
 ~PointsToGraphAliasAnalysis () noexcept override
 
std::string ToString () const override
 
AliasQueryResponse Query (const rvsdg::Output &p1, size_t s1, const rvsdg::Output &p2, size_t s2) override
 
- Public Member Functions inherited from jlm::llvm::aa::AliasAnalysis
 AliasAnalysis ()
 
virtual ~AliasAnalysis () noexcept
 

Private Member Functions

std::optional< PointsToGraph::NodeIndexTryGetSingleTarget (PointsToGraph::NodeIndex node, size_t size) const
 
bool IsRepresentingSingleMemoryLocation (PointsToGraph::NodeIndex node) const
 

Private Attributes

const PointsToGraphpointsToGraph_
 

Additional Inherited Members

- Public Types inherited from jlm::llvm::aa::AliasAnalysis
enum  AliasQueryResponse { NoAlias , MayAlias , MustAlias }
 

Detailed Description

Class for making alias analysis queries against a PointsToGraph

Definition at line 20 of file PointsToGraphAliasAnalysis.hpp.

Constructor & Destructor Documentation

◆ PointsToGraphAliasAnalysis()

jlm::llvm::aa::PointsToGraphAliasAnalysis::PointsToGraphAliasAnalysis ( const PointsToGraph pointsToGraph)
explicit

Definition at line 10 of file PointsToGraphAliasAnalysis.cpp.

◆ ~PointsToGraphAliasAnalysis()

jlm::llvm::aa::PointsToGraphAliasAnalysis::~PointsToGraphAliasAnalysis ( )
overridedefaultnoexcept

Member Function Documentation

◆ IsRepresentingSingleMemoryLocation()

bool jlm::llvm::aa::PointsToGraphAliasAnalysis::IsRepresentingSingleMemoryLocation ( PointsToGraph::NodeIndex  node) const
private

Determines if the given abstract memory location represent exactly one region in memory, such as imports and global variables. As a counterexample, an ALLOCA[i32] can represent multiple 4-byte locations.

Parameters
nodethe MemoryNode for the abstract memory location in question
Returns
true if node represents a single location

Definition at line 113 of file PointsToGraphAliasAnalysis.cpp.

◆ Query()

AliasAnalysis::AliasQueryResponse jlm::llvm::aa::PointsToGraphAliasAnalysis::Query ( const rvsdg::Output p1,
size_t  s1,
const rvsdg::Output p2,
size_t  s2 
)
overridevirtual

Queries the alias analysis about two memory regions represented as pointer + size pairs.

Parameters
p1the first pointer value
s1the byte size of the first pointer access
p2the second pointer value
s2the byte size of the second pointer access
Returns
the result of the alias query

Implements jlm::llvm::aa::AliasAnalysis.

Definition at line 23 of file PointsToGraphAliasAnalysis.cpp.

◆ ToString()

std::string jlm::llvm::aa::PointsToGraphAliasAnalysis::ToString ( ) const
overridevirtual
Returns
a string description of the alias analysis

Implements jlm::llvm::aa::AliasAnalysis.

Definition at line 17 of file PointsToGraphAliasAnalysis.cpp.

◆ TryGetSingleTarget()

std::optional< PointsToGraph::NodeIndex > jlm::llvm::aa::PointsToGraphAliasAnalysis::TryGetSingleTarget ( PointsToGraph::NodeIndex  node,
size_t  size 
) const
private

Determines if there is a single valid target memory node for a given register node. A target is only considered valid if it is large enough to hold the specified size. If there are multiple valid targets, nullptr is returned.

Parameters
nodeThe register node to check the targets of
sizeThe minimum size that the target memory node must be able to hold
Returns
a pointer to the single valid target memory node, or nullptr if there are zero or multiple valid targets

Definition at line 87 of file PointsToGraphAliasAnalysis.cpp.

Member Data Documentation

◆ pointsToGraph_

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

Definition at line 56 of file PointsToGraphAliasAnalysis.hpp.


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