Jlm
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
jlm::llvm::aa::PointerObjectSet Class Referencefinal

#include <PointerObjectSet.hpp>

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

Classes

struct  PointerObject
 

Public Member Functions

 PointerObjectSet ()=default
 
size_t NumPointerObjects () const noexcept
 
size_t NumPointerObjectsOfKind (PointerObjectKind kind) const noexcept
 
size_t NumRegisterPointerObjects () const noexcept
 
size_t NumMemoryPointerObjects () const noexcept
 
size_t NumMemoryPointerObjectsCanPoint () const noexcept
 
PointerObjectIndex CreateRegisterPointerObject (const rvsdg::Output &rvsdgOutput)
 
PointerObjectIndex GetRegisterPointerObject (const rvsdg::Output &rvsdgOutput) const
 
std::optional< PointerObjectIndexTryGetRegisterPointerObject (const rvsdg::Output &rvsdgOutput) const
 
void MapRegisterToExistingPointerObject (const rvsdg::Output &rvsdgOutput, PointerObjectIndex pointerObject)
 
PointerObjectIndex CreateDummyRegisterPointerObject ()
 
PointerObjectIndex CreateAllocaMemoryObject (const rvsdg::SimpleNode &allocaNode, bool canPoint)
 
PointerObjectIndex CreateMallocMemoryObject (const rvsdg::SimpleNode &mallocNode, bool canPoint)
 
PointerObjectIndex CreateGlobalMemoryObject (const rvsdg::DeltaNode &deltaNode, bool canPoint)
 
PointerObjectIndex CreateFunctionMemoryObject (const rvsdg::LambdaNode &lambdaNode)
 
PointerObjectIndex GetFunctionMemoryObject (const rvsdg::LambdaNode &lambdaNode) const
 
const rvsdg::LambdaNodeGetLambdaNodeFromFunctionMemoryObject (PointerObjectIndex index) const
 
PointerObjectIndex CreateImportMemoryObject (const LlvmGraphImport &importNode, bool canPoint)
 
const std::unordered_map< const rvsdg::Output *, PointerObjectIndex > & GetRegisterMap () const noexcept
 
const std::unordered_map< const rvsdg::SimpleNode *, PointerObjectIndex > & GetAllocaMap () const noexcept
 
const std::unordered_map< const rvsdg::SimpleNode *, PointerObjectIndex > & GetMallocMap () const noexcept
 
const std::unordered_map< const rvsdg::DeltaNode *, PointerObjectIndex > & GetGlobalMap () const noexcept
 
const util::BijectiveMap< const rvsdg::LambdaNode *, PointerObjectIndex > & GetFunctionMap () const noexcept
 
const std::unordered_map< const LlvmGraphImport *, PointerObjectIndex > & GetImportMap () const noexcept
 
PointerObjectKind GetPointerObjectKind (PointerObjectIndex index) const noexcept
 
bool CanPoint (PointerObjectIndex index) const noexcept
 
bool IsPointerObjectRegister (PointerObjectIndex index) const noexcept
 
bool HasEscaped (PointerObjectIndex index) const noexcept
 
bool MarkAsEscaped (PointerObjectIndex index)
 
bool HasPointeesEscaping (PointerObjectIndex index) const noexcept
 
bool MarkAsPointeesEscaping (PointerObjectIndex index)
 
bool IsPointingToExternal (PointerObjectIndex index) const noexcept
 
bool MarkAsPointingToExternal (PointerObjectIndex index)
 
bool CanTrackPointeesImplicitly (PointerObjectIndex index) const noexcept
 
bool MarkAsStoringAsScalar (PointerObjectIndex index)
 
bool IsStoredAsScalar (PointerObjectIndex index) const noexcept
 
bool MarkAsLoadingAsScalar (PointerObjectIndex index)
 
bool IsLoadedAsScalar (PointerObjectIndex index) const noexcept
 
PointerObjectIndex GetUnificationRoot (PointerObjectIndex index) const noexcept
 
bool IsUnificationRoot (PointerObjectIndex index) const noexcept
 
PointerObjectIndex UnifyPointerObjects (PointerObjectIndex object1, PointerObjectIndex object2)
 
const util::HashSet< PointerObjectIndex > & GetPointsToSet (PointerObjectIndex index) const
 
bool AddToPointsToSet (PointerObjectIndex pointer, PointerObjectIndex pointee)
 
bool MakePointsToSetSuperset (PointerObjectIndex superset, PointerObjectIndex subset)
 
bool MakePointsToSetSuperset (PointerObjectIndex superset, PointerObjectIndex subset, util::HashSet< PointerObjectIndex > &newPointees)
 
void RemoveAllPointees (PointerObjectIndex index)
 
bool IsPointingTo (PointerObjectIndex pointer, PointerObjectIndex pointee) const
 
std::unique_ptr< PointerObjectSetClone () const
 
bool HasIdenticalSolAs (const PointerObjectSet &other) const
 
size_t GetNumSetInsertionAttempts () const noexcept
 
size_t GetNumExplicitPointeesRemoved () const noexcept
 

Private Member Functions

PointerObjectIndex AddPointerObject (PointerObjectKind kind, bool canPoint)
 
template<typename NewPointeeFunctor >
bool PropagateNewPointees (PointerObjectIndex superset, PointerObjectIndex subset, NewPointeeFunctor &onNewPointee)
 

Private Attributes

std::vector< PointerObjectPointerObjects_
 
std::vector< PointerObjectIndexPointerObjectParents_
 
std::vector< uint8_t > PointerObjectRank_
 
std::vector< util::HashSet< PointerObjectIndex > > PointsToSets_
 
std::unordered_map< const rvsdg::Output *, PointerObjectIndexRegisterMap_
 
std::unordered_map< const rvsdg::SimpleNode *, PointerObjectIndexAllocaMap_
 
std::unordered_map< const rvsdg::SimpleNode *, PointerObjectIndexMallocMap_
 
std::unordered_map< const rvsdg::DeltaNode *, PointerObjectIndexGlobalMap_
 
util::BijectiveMap< const rvsdg::LambdaNode *, PointerObjectIndexFunctionMap_
 
std::unordered_map< const LlvmGraphImport *, PointerObjectIndexImportMap_
 
size_t NumSetInsertionAttempts_ = 0
 
size_t NumExplicitPointeesRemoved_ = 0
 

Detailed Description

A class containing a set of PointerObjects, and their points-to-sets, as well as mappings from RVSDG nodes/outputs to the PointerObjects. For brevity, P(x) denotes the points-to-set of a PointerObject x.

Definition at line 51 of file PointerObjectSet.hpp.

Constructor & Destructor Documentation

◆ PointerObjectSet()

jlm::llvm::aa::PointerObjectSet::PointerObjectSet ( )
default

Member Function Documentation

◆ AddPointerObject()

PointerObjectIndex jlm::llvm::aa::PointerObjectSet::AddPointerObject ( PointerObjectKind  kind,
bool  canPoint 
)
private

Internal helper function for adding PointerObjects, use the Create* methods instead

Definition at line 28 of file PointerObjectSet.cpp.

◆ AddToPointsToSet()

bool jlm::llvm::aa::PointerObjectSet::AddToPointsToSet ( PointerObjectIndex  pointer,
PointerObjectIndex  pointee 
)

Adds pointee to P(pointer)

Parameters
pointerthe index of the PointerObject that shall point to pointee
pointeethe index of the PointerObject that is pointed at, can not be a register.

If the pointer is of a PointerObjectKind that can't point, this is a no-op.

Returns
true if P(pointer) was changed by this operation

Definition at line 410 of file PointerObjectSet.cpp.

◆ CanPoint()

bool jlm::llvm::aa::PointerObjectSet::CanPoint ( PointerObjectIndex  index) const
noexcept
Returns
true if the PointerObject with the given index can point, otherwise false

Definition at line 225 of file PointerObjectSet.cpp.

◆ CanTrackPointeesImplicitly()

bool jlm::llvm::aa::PointerObjectSet::CanTrackPointeesImplicitly ( PointerObjectIndex  index) const
noexcept
Returns
true if the PointerObject with the given index is flagged as both PointsToExternal and PointeesEscaping. In that case, any explicit pointee will also be implicit, so it is better to avoid explicit.

Definition at line 295 of file PointerObjectSet.cpp.

◆ Clone()

std::unique_ptr< PointerObjectSet > jlm::llvm::aa::PointerObjectSet::Clone ( ) const

Creates a clone of this PointerObjectSet, with all the same PointerObjects, flags, unifications and points-to sets.

Returns
an owned clone of this

Definition at line 509 of file PointerObjectSet.cpp.

◆ CreateAllocaMemoryObject()

PointerObjectIndex jlm::llvm::aa::PointerObjectSet::CreateAllocaMemoryObject ( const rvsdg::SimpleNode allocaNode,
bool  canPoint 
)

Definition at line 123 of file PointerObjectSet.cpp.

◆ CreateDummyRegisterPointerObject()

PointerObjectIndex jlm::llvm::aa::PointerObjectSet::CreateDummyRegisterPointerObject ( )

Creates a PointerObject of Register kind, without any association to any node in the program. It can not be pointed to, and will not be included in the final PointsToGraph, but it can be used as a temporary object to string together constraints.

See also
Andersen::AnalyzeMemcpy.
Returns
the index of the new PointerObject

Definition at line 117 of file PointerObjectSet.cpp.

◆ CreateFunctionMemoryObject()

PointerObjectIndex jlm::llvm::aa::PointerObjectSet::CreateFunctionMemoryObject ( const rvsdg::LambdaNode lambdaNode)

Creates a PointerObject of Function kind associated with the given lambdaNode. The lambda node can not be associated with a PointerObject already.

Parameters
lambdaNodethe RVSDG node defining the function,
Returns
the index of the new PointerObject in the PointerObjectSet

Definition at line 146 of file PointerObjectSet.cpp.

◆ CreateGlobalMemoryObject()

PointerObjectIndex jlm::llvm::aa::PointerObjectSet::CreateGlobalMemoryObject ( const rvsdg::DeltaNode deltaNode,
bool  canPoint 
)

Definition at line 139 of file PointerObjectSet.cpp.

◆ CreateImportMemoryObject()

PointerObjectIndex jlm::llvm::aa::PointerObjectSet::CreateImportMemoryObject ( const LlvmGraphImport importNode,
bool  canPoint 
)

Definition at line 169 of file PointerObjectSet.cpp.

◆ CreateMallocMemoryObject()

PointerObjectIndex jlm::llvm::aa::PointerObjectSet::CreateMallocMemoryObject ( const rvsdg::SimpleNode mallocNode,
bool  canPoint 
)

Definition at line 131 of file PointerObjectSet.cpp.

◆ CreateRegisterPointerObject()

PointerObjectIndex jlm::llvm::aa::PointerObjectSet::CreateRegisterPointerObject ( const rvsdg::Output rvsdgOutput)

Creates a PointerObject of Register kind and maps the rvsdg output to the new PointerObject. The rvsdg output can not already be associated with a PointerObject.

Parameters
rvsdgOutputthe rvsdg output associated with the register PointerObject
Returns
the index of the new PointerObject in the PointerObjectSet

Definition at line 84 of file PointerObjectSet.cpp.

◆ GetAllocaMap()

const std::unordered_map< const rvsdg::SimpleNode *, PointerObjectIndex > & jlm::llvm::aa::PointerObjectSet::GetAllocaMap ( ) const
noexcept

Definition at line 188 of file PointerObjectSet.cpp.

◆ GetFunctionMap()

const util::BijectiveMap< const rvsdg::LambdaNode *, PointerObjectIndex > & jlm::llvm::aa::PointerObjectSet::GetFunctionMap ( ) const
noexcept

Definition at line 206 of file PointerObjectSet.cpp.

◆ GetFunctionMemoryObject()

PointerObjectIndex jlm::llvm::aa::PointerObjectSet::GetFunctionMemoryObject ( const rvsdg::LambdaNode lambdaNode) const

Retrieves the PointerObject of Function kind associated with the given lambda node

Parameters
lambdaNodethe lambda node associated with the existing PointerObject
Returns
the index of the associated PointerObject

Definition at line 155 of file PointerObjectSet.cpp.

◆ GetGlobalMap()

const std::unordered_map< const rvsdg::DeltaNode *, PointerObjectIndex > & jlm::llvm::aa::PointerObjectSet::GetGlobalMap ( ) const
noexcept

Definition at line 200 of file PointerObjectSet.cpp.

◆ GetImportMap()

const std::unordered_map< const LlvmGraphImport *, PointerObjectIndex > & jlm::llvm::aa::PointerObjectSet::GetImportMap ( ) const
noexcept

Definition at line 212 of file PointerObjectSet.cpp.

◆ GetLambdaNodeFromFunctionMemoryObject()

const rvsdg::LambdaNode & jlm::llvm::aa::PointerObjectSet::GetLambdaNodeFromFunctionMemoryObject ( PointerObjectIndex  index) const

Gets the lambda node associated with a given PointerObject.

Parameters
indexthe index of the PointerObject
Returns
the lambda node associated with the PointerObject

Definition at line 162 of file PointerObjectSet.cpp.

◆ GetMallocMap()

const std::unordered_map< const rvsdg::SimpleNode *, PointerObjectIndex > & jlm::llvm::aa::PointerObjectSet::GetMallocMap ( ) const
noexcept

Definition at line 194 of file PointerObjectSet.cpp.

◆ GetNumExplicitPointeesRemoved()

size_t jlm::llvm::aa::PointerObjectSet::GetNumExplicitPointeesRemoved ( ) const
noexcept
Returns
the number of pointees that have been removed from points-to sets, due to either unification, or the RemoveAllPointees() method.

Definition at line 553 of file PointerObjectSet.cpp.

◆ GetNumSetInsertionAttempts()

size_t jlm::llvm::aa::PointerObjectSet::GetNumSetInsertionAttempts ( ) const
noexcept
Returns
the number of pointees that have been inserted, or were attempted inserted but already existed, among all points-to sets in this PointerObjectSet. Unioning a set x into another makes |x| insertion attempts.

Definition at line 547 of file PointerObjectSet.cpp.

◆ GetPointerObjectKind()

PointerObjectKind jlm::llvm::aa::PointerObjectSet::GetPointerObjectKind ( PointerObjectIndex  index) const
noexcept
Returns
the kind of the PointerObject with the given index

Definition at line 218 of file PointerObjectSet.cpp.

◆ GetPointsToSet()

const util::HashSet< PointerObjectIndex > & jlm::llvm::aa::PointerObjectSet::GetPointsToSet ( PointerObjectIndex  index) const

Looks up the pointees of the given PointerObject index. If index is part of a unification, the unification root's points-to set is returned.

Returns
the PointsToSet of the PointerObject.

Definition at line 403 of file PointerObjectSet.cpp.

◆ GetRegisterMap()

const std::unordered_map< const rvsdg::Output *, PointerObjectIndex > & jlm::llvm::aa::PointerObjectSet::GetRegisterMap ( ) const
noexcept

Definition at line 182 of file PointerObjectSet.cpp.

◆ GetRegisterPointerObject()

PointerObjectIndex jlm::llvm::aa::PointerObjectSet::GetRegisterPointerObject ( const rvsdg::Output rvsdgOutput) const

Retrieves a previously created PointerObject of Register kind.

Parameters
rvsdgOutputan rvsdg::output that already corresponds to a PointerObject in the set
Returns
the index of the PointerObject associated with the rvsdg::output

Definition at line 91 of file PointerObjectSet.cpp.

◆ GetUnificationRoot()

PointerObjectIndex jlm::llvm::aa::PointerObjectSet::GetUnificationRoot ( PointerObjectIndex  index) const
noexcept
Returns
the root in the unification the PointerObject with the given index belongs to. PointerObjects that have not been unified will always be their own root.

Definition at line 334 of file PointerObjectSet.cpp.

◆ HasEscaped()

bool jlm::llvm::aa::PointerObjectSet::HasEscaped ( PointerObjectIndex  index) const
noexcept
Returns
true if the PointerObject with the given index has its address escaped

Definition at line 239 of file PointerObjectSet.cpp.

◆ HasIdenticalSolAs()

bool jlm::llvm::aa::PointerObjectSet::HasIdenticalSolAs ( const PointerObjectSet other) const

Compares the Sol sets of all PointerObjects between two PointerObjectSets. Assumes that this and other represent the same set of PointerObjects, and in the same order. Only the final Sol set of each PointerObject matters, so unifications do not need to match. The set of escaped PointerObjects must match.

Parameters
otherthe set being compared to
Returns
true if this and other are identical, false otherwise

Definition at line 515 of file PointerObjectSet.cpp.

◆ HasPointeesEscaping()

bool jlm::llvm::aa::PointerObjectSet::HasPointeesEscaping ( PointerObjectIndex  index) const
noexcept
Returns
true if the PointerObject with the given index makes all its pointees escape

Definition at line 263 of file PointerObjectSet.cpp.

◆ IsLoadedAsScalar()

bool jlm::llvm::aa::PointerObjectSet::IsLoadedAsScalar ( PointerObjectIndex  index) const
noexcept
Returns
true if the PointerObject with the given index is the target of a scalar load, false otherwise. If it is, any pointee of index will be marked as making its pointees escape.

Definition at line 328 of file PointerObjectSet.cpp.

◆ IsPointerObjectRegister()

bool jlm::llvm::aa::PointerObjectSet::IsPointerObjectRegister ( PointerObjectIndex  index) const
noexcept
Returns
true if the PointerObject with the given index is a Register

Definition at line 232 of file PointerObjectSet.cpp.

◆ IsPointingTo()

bool jlm::llvm::aa::PointerObjectSet::IsPointingTo ( PointerObjectIndex  pointer,
PointerObjectIndex  pointee 
) const
Parameters
pointerthe PointerObject possibly pointing to pointee
pointeethe PointerObject possibly being pointed at
Returns
true if pointer points to pointee, either explicitly, implicitly, or both.

Definition at line 491 of file PointerObjectSet.cpp.

◆ IsPointingToExternal()

bool jlm::llvm::aa::PointerObjectSet::IsPointingToExternal ( PointerObjectIndex  index) const
noexcept
Returns
true if the PointerObject with the given index points to external, otherwise false

Definition at line 279 of file PointerObjectSet.cpp.

◆ IsStoredAsScalar()

bool jlm::llvm::aa::PointerObjectSet::IsStoredAsScalar ( PointerObjectIndex  index) const
noexcept
Returns
true if the PointerObject with the given index is the target of a scalar store, false otherwise. If it is, any pointee of index will be marked as pointing to external.

Definition at line 312 of file PointerObjectSet.cpp.

◆ IsUnificationRoot()

bool jlm::llvm::aa::PointerObjectSet::IsUnificationRoot ( PointerObjectIndex  index) const
noexcept
Returns
true if the PointerObject with the given index is its own unification root

Definition at line 353 of file PointerObjectSet.cpp.

◆ MakePointsToSetSuperset() [1/2]

bool jlm::llvm::aa::PointerObjectSet::MakePointsToSetSuperset ( PointerObjectIndex  superset,
PointerObjectIndex  subset 
)

Makes P(superset) a superset of P(subset), by adding any elements in the set difference. Also propagates the PointsToExternal flag.

Parameters
supersetthe index of the PointerObject that shall point to everything subset points to
subsetthe index of the PointerObject whose pointees shall all be pointed to by superset as well
Returns
true if P(superset) or any flags were modified by this operation

Definition at line 460 of file PointerObjectSet.cpp.

◆ MakePointsToSetSuperset() [2/2]

bool jlm::llvm::aa::PointerObjectSet::MakePointsToSetSuperset ( PointerObjectIndex  superset,
PointerObjectIndex  subset,
util::HashSet< PointerObjectIndex > &  newPointees 
)

A version of MakePointsToSetSuperset that adds any new pointees of superset, to the set newPointees.

Definition at line 470 of file PointerObjectSet.cpp.

◆ MapRegisterToExistingPointerObject()

void jlm::llvm::aa::PointerObjectSet::MapRegisterToExistingPointerObject ( const rvsdg::Output rvsdgOutput,
PointerObjectIndex  pointerObject 
)

Reuses an existing PointerObject of register type for an additional rvsdg output. This is useful when values are passed from outer regions to inner regions.

Parameters
rvsdgOutputthe new rvsdg output providing the register value
pointerObjectthe index of the existing PointerObject, must be of register kind

Definition at line 107 of file PointerObjectSet.cpp.

◆ MarkAsEscaped()

bool jlm::llvm::aa::PointerObjectSet::MarkAsEscaped ( PointerObjectIndex  index)

Marks the PointerObject with the given index as having escaped the module. Can only be called on non-register PointerObjects. Implies both the PointeesEscaping flag, and the PointsToExternal flag.

Returns
true if the flag was changed by this operation, false otherwise

Definition at line 246 of file PointerObjectSet.cpp.

◆ MarkAsLoadingAsScalar()

bool jlm::llvm::aa::PointerObjectSet::MarkAsLoadingAsScalar ( PointerObjectIndex  index)

Marks the PointerObject with the given index as holding the target of a scalar load.

Returns
true if the flags was changed by this operation, false otherwise

Definition at line 318 of file PointerObjectSet.cpp.

◆ MarkAsPointeesEscaping()

bool jlm::llvm::aa::PointerObjectSet::MarkAsPointeesEscaping ( PointerObjectIndex  index)

Marks the PointerObject with the given index as having all pointees escaping. The flag is applied to the unification root.

Returns
true if the flag was changed by this operation, false otherwise

Definition at line 269 of file PointerObjectSet.cpp.

◆ MarkAsPointingToExternal()

bool jlm::llvm::aa::PointerObjectSet::MarkAsPointingToExternal ( PointerObjectIndex  index)

Marks the PointerObject with the given index as pointing to external. The flag is applied to the unification root.

Returns
true if the flag was changed by this operation, false otherwise

Definition at line 285 of file PointerObjectSet.cpp.

◆ MarkAsStoringAsScalar()

bool jlm::llvm::aa::PointerObjectSet::MarkAsStoringAsScalar ( PointerObjectIndex  index)

Marks the PointerObject with the given index as holding the target of a scalar store.

Returns
true if the flags was changed by this operation, false otherwise

Definition at line 302 of file PointerObjectSet.cpp.

◆ NumMemoryPointerObjects()

size_t jlm::llvm::aa::PointerObjectSet::NumMemoryPointerObjects ( ) const
noexcept

Definition at line 67 of file PointerObjectSet.cpp.

◆ NumMemoryPointerObjectsCanPoint()

size_t jlm::llvm::aa::PointerObjectSet::NumMemoryPointerObjectsCanPoint ( ) const
noexcept

Definition at line 73 of file PointerObjectSet.cpp.

◆ NumPointerObjects()

size_t jlm::llvm::aa::PointerObjectSet::NumPointerObjects ( ) const
noexcept

Definition at line 44 of file PointerObjectSet.cpp.

◆ NumPointerObjectsOfKind()

size_t jlm::llvm::aa::PointerObjectSet::NumPointerObjectsOfKind ( PointerObjectKind  kind) const
noexcept
Returns
the number of PointerObjects in the set matching the specified kind.

Definition at line 50 of file PointerObjectSet.cpp.

◆ NumRegisterPointerObjects()

size_t jlm::llvm::aa::PointerObjectSet::NumRegisterPointerObjects ( ) const
noexcept
Returns
the number of PointerObjects in the set representing virtual registers

Definition at line 61 of file PointerObjectSet.cpp.

◆ PropagateNewPointees()

template<typename NewPointeeFunctor >
bool jlm::llvm::aa::PointerObjectSet::PropagateNewPointees ( PointerObjectIndex  superset,
PointerObjectIndex  subset,
NewPointeeFunctor &  onNewPointee 
)
private

Internal helper function for making P(superset) a superset of P(subset), with a callback.

See also
MakePointsToSetSuperset

Definition at line 426 of file PointerObjectSet.cpp.

◆ RemoveAllPointees()

void jlm::llvm::aa::PointerObjectSet::RemoveAllPointees ( PointerObjectIndex  index)

Removes all pointees from the PointerObject with the given index. Can be used, e.g., when the PointerObject already points to all its pointees implicitly.

Definition at line 483 of file PointerObjectSet.cpp.

◆ TryGetRegisterPointerObject()

std::optional< PointerObjectIndex > jlm::llvm::aa::PointerObjectSet::TryGetRegisterPointerObject ( const rvsdg::Output rvsdgOutput) const

Retrieves a previously created PointerObject of Register kind, associated with an rvsdg output. If no PointerObject is associated with the given output, nullopt is returned.

Parameters
rvsdgOutputthe rvsdg::output that might correspond to a PointerObject in the set
Returns
the index of the PointerObject associated with rvsdgOutput, if it exists

Definition at line 99 of file PointerObjectSet.cpp.

◆ UnifyPointerObjects()

PointerObjectIndex jlm::llvm::aa::PointerObjectSet::UnifyPointerObjects ( PointerObjectIndex  object1,
PointerObjectIndex  object2 
)

Unifies two PointerObjects, such that they will forever share their set of pointees. If any object in the unification points to external, they will all point to external. The HasEscaped flags are not shared, and can still be set individually. If the objects already belong to the same disjoint set, this is a no-op.

Parameters
object1the index of the first PointerObject to unify
object2the index of the second PointerObject to unify
Returns
the index of the root PointerObject in the unification

Definition at line 359 of file PointerObjectSet.cpp.

Member Data Documentation

◆ AllocaMap_

std::unordered_map<const rvsdg::SimpleNode *, PointerObjectIndex> jlm::llvm::aa::PointerObjectSet::AllocaMap_
private

Definition at line 170 of file PointerObjectSet.hpp.

◆ FunctionMap_

util::BijectiveMap<const rvsdg::LambdaNode *, PointerObjectIndex> jlm::llvm::aa::PointerObjectSet::FunctionMap_
private

Definition at line 176 of file PointerObjectSet.hpp.

◆ GlobalMap_

std::unordered_map<const rvsdg::DeltaNode *, PointerObjectIndex> jlm::llvm::aa::PointerObjectSet::GlobalMap_
private

Definition at line 174 of file PointerObjectSet.hpp.

◆ ImportMap_

std::unordered_map<const LlvmGraphImport *, PointerObjectIndex> jlm::llvm::aa::PointerObjectSet::ImportMap_
private

Definition at line 178 of file PointerObjectSet.hpp.

◆ MallocMap_

std::unordered_map<const rvsdg::SimpleNode *, PointerObjectIndex> jlm::llvm::aa::PointerObjectSet::MallocMap_
private

Definition at line 172 of file PointerObjectSet.hpp.

◆ NumExplicitPointeesRemoved_

size_t jlm::llvm::aa::PointerObjectSet::NumExplicitPointeesRemoved_ = 0
private

Definition at line 185 of file PointerObjectSet.hpp.

◆ NumSetInsertionAttempts_

size_t jlm::llvm::aa::PointerObjectSet::NumSetInsertionAttempts_ = 0
private

Definition at line 181 of file PointerObjectSet.hpp.

◆ PointerObjectParents_

std::vector<PointerObjectIndex> jlm::llvm::aa::PointerObjectSet::PointerObjectParents_
mutableprivate

Definition at line 155 of file PointerObjectSet.hpp.

◆ PointerObjectRank_

std::vector<uint8_t> jlm::llvm::aa::PointerObjectSet::PointerObjectRank_
private

Definition at line 159 of file PointerObjectSet.hpp.

◆ PointerObjects_

std::vector<PointerObject> jlm::llvm::aa::PointerObjectSet::PointerObjects_
private

Definition at line 151 of file PointerObjectSet.hpp.

◆ PointsToSets_

std::vector<util::HashSet<PointerObjectIndex> > jlm::llvm::aa::PointerObjectSet::PointsToSets_
private

Definition at line 164 of file PointerObjectSet.hpp.

◆ RegisterMap_

std::unordered_map<const rvsdg::Output *, PointerObjectIndex> jlm::llvm::aa::PointerObjectSet::RegisterMap_
private

Definition at line 168 of file PointerObjectSet.hpp.


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