|
Jlm
|
#include <PointerObjectSet.hpp>

Classes | |
| struct | PointerObject |
Private Member Functions | |
| PointerObjectIndex | AddPointerObject (PointerObjectKind kind, bool canPoint) |
| template<typename NewPointeeFunctor > | |
| bool | PropagateNewPointees (PointerObjectIndex superset, PointerObjectIndex subset, NewPointeeFunctor &onNewPointee) |
Private Attributes | |
| std::vector< PointerObject > | PointerObjects_ |
| std::vector< PointerObjectIndex > | PointerObjectParents_ |
| std::vector< uint8_t > | PointerObjectRank_ |
| std::vector< util::HashSet< PointerObjectIndex > > | PointsToSets_ |
| std::unordered_map< const rvsdg::Output *, PointerObjectIndex > | RegisterMap_ |
| std::unordered_map< const rvsdg::SimpleNode *, PointerObjectIndex > | AllocaMap_ |
| std::unordered_map< const rvsdg::SimpleNode *, PointerObjectIndex > | MallocMap_ |
| std::unordered_map< const rvsdg::DeltaNode *, PointerObjectIndex > | GlobalMap_ |
| util::BijectiveMap< const rvsdg::LambdaNode *, PointerObjectIndex > | FunctionMap_ |
| std::unordered_map< const LlvmGraphImport *, PointerObjectIndex > | ImportMap_ |
| size_t | NumSetInsertionAttempts_ = 0 |
| size_t | NumExplicitPointeesRemoved_ = 0 |
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.
|
default |
|
private |
Internal helper function for adding PointerObjects, use the Create* methods instead
Definition at line 28 of file PointerObjectSet.cpp.
| bool jlm::llvm::aa::PointerObjectSet::AddToPointsToSet | ( | PointerObjectIndex | pointer, |
| PointerObjectIndex | pointee | ||
| ) |
Adds pointee to P(pointer)
| pointer | the index of the PointerObject that shall point to pointee |
| pointee | the 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.
pointer) was changed by this operation Definition at line 410 of file PointerObjectSet.cpp.
|
noexcept |
index can point, otherwise false Definition at line 225 of file PointerObjectSet.cpp.
|
noexcept |
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.
| 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.
Definition at line 509 of file PointerObjectSet.cpp.
| PointerObjectIndex jlm::llvm::aa::PointerObjectSet::CreateAllocaMemoryObject | ( | const rvsdg::SimpleNode & | allocaNode, |
| bool | canPoint | ||
| ) |
Definition at line 123 of file PointerObjectSet.cpp.
| 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.
Definition at line 117 of file PointerObjectSet.cpp.
| 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.
| lambdaNode | the RVSDG node defining the function, |
Definition at line 146 of file PointerObjectSet.cpp.
| PointerObjectIndex jlm::llvm::aa::PointerObjectSet::CreateGlobalMemoryObject | ( | const rvsdg::DeltaNode & | deltaNode, |
| bool | canPoint | ||
| ) |
Definition at line 139 of file PointerObjectSet.cpp.
| PointerObjectIndex jlm::llvm::aa::PointerObjectSet::CreateImportMemoryObject | ( | const LlvmGraphImport & | importNode, |
| bool | canPoint | ||
| ) |
Definition at line 169 of file PointerObjectSet.cpp.
| PointerObjectIndex jlm::llvm::aa::PointerObjectSet::CreateMallocMemoryObject | ( | const rvsdg::SimpleNode & | mallocNode, |
| bool | canPoint | ||
| ) |
Definition at line 131 of file PointerObjectSet.cpp.
| 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.
| rvsdgOutput | the rvsdg output associated with the register PointerObject |
Definition at line 84 of file PointerObjectSet.cpp.
|
noexcept |
Definition at line 188 of file PointerObjectSet.cpp.
|
noexcept |
Definition at line 206 of file PointerObjectSet.cpp.
| PointerObjectIndex jlm::llvm::aa::PointerObjectSet::GetFunctionMemoryObject | ( | const rvsdg::LambdaNode & | lambdaNode | ) | const |
Retrieves the PointerObject of Function kind associated with the given lambda node
| lambdaNode | the lambda node associated with the existing PointerObject |
Definition at line 155 of file PointerObjectSet.cpp.
|
noexcept |
Definition at line 200 of file PointerObjectSet.cpp.
|
noexcept |
Definition at line 212 of file PointerObjectSet.cpp.
| const rvsdg::LambdaNode & jlm::llvm::aa::PointerObjectSet::GetLambdaNodeFromFunctionMemoryObject | ( | PointerObjectIndex | index | ) | const |
Gets the lambda node associated with a given PointerObject.
| index | the index of the PointerObject |
Definition at line 162 of file PointerObjectSet.cpp.
|
noexcept |
Definition at line 194 of file PointerObjectSet.cpp.
|
noexcept |
Definition at line 553 of file PointerObjectSet.cpp.
|
noexcept |
Definition at line 547 of file PointerObjectSet.cpp.
|
noexcept |
index Definition at line 218 of file PointerObjectSet.cpp.
| 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.
Definition at line 403 of file PointerObjectSet.cpp.
|
noexcept |
Definition at line 182 of file PointerObjectSet.cpp.
| PointerObjectIndex jlm::llvm::aa::PointerObjectSet::GetRegisterPointerObject | ( | const rvsdg::Output & | rvsdgOutput | ) | const |
Retrieves a previously created PointerObject of Register kind.
| rvsdgOutput | an rvsdg::output that already corresponds to a PointerObject in the set |
Definition at line 91 of file PointerObjectSet.cpp.
|
noexcept |
index belongs to. PointerObjects that have not been unified will always be their own root. Definition at line 334 of file PointerObjectSet.cpp.
|
noexcept |
index has its address escaped Definition at line 239 of file PointerObjectSet.cpp.
| 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.
| other | the set being compared to |
other are identical, false otherwise Definition at line 515 of file PointerObjectSet.cpp.
|
noexcept |
index makes all its pointees escape Definition at line 263 of file PointerObjectSet.cpp.
|
noexcept |
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.
|
noexcept |
index is a Register Definition at line 232 of file PointerObjectSet.cpp.
| bool jlm::llvm::aa::PointerObjectSet::IsPointingTo | ( | PointerObjectIndex | pointer, |
| PointerObjectIndex | pointee | ||
| ) | const |
| pointer | the PointerObject possibly pointing to pointee |
| pointee | the PointerObject possibly being pointed at |
pointer points to pointee, either explicitly, implicitly, or both. Definition at line 491 of file PointerObjectSet.cpp.
|
noexcept |
index points to external, otherwise false Definition at line 279 of file PointerObjectSet.cpp.
|
noexcept |
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.
|
noexcept |
index is its own unification root Definition at line 353 of file PointerObjectSet.cpp.
| 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.
| superset | the index of the PointerObject that shall point to everything subset points to |
| subset | the index of the PointerObject whose pointees shall all be pointed to by superset as well |
superset) or any flags were modified by this operation Definition at line 460 of file PointerObjectSet.cpp.
| 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.
| 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.
| rvsdgOutput | the new rvsdg output providing the register value |
| pointerObject | the index of the existing PointerObject, must be of register kind |
Definition at line 107 of file PointerObjectSet.cpp.
| 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.
Definition at line 246 of file PointerObjectSet.cpp.
| bool jlm::llvm::aa::PointerObjectSet::MarkAsLoadingAsScalar | ( | PointerObjectIndex | index | ) |
Marks the PointerObject with the given index as holding the target of a scalar load.
Definition at line 318 of file PointerObjectSet.cpp.
| 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.
Definition at line 269 of file PointerObjectSet.cpp.
| 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.
Definition at line 285 of file PointerObjectSet.cpp.
| bool jlm::llvm::aa::PointerObjectSet::MarkAsStoringAsScalar | ( | PointerObjectIndex | index | ) |
Marks the PointerObject with the given index as holding the target of a scalar store.
Definition at line 302 of file PointerObjectSet.cpp.
|
noexcept |
Definition at line 67 of file PointerObjectSet.cpp.
|
noexcept |
Definition at line 73 of file PointerObjectSet.cpp.
|
noexcept |
Definition at line 44 of file PointerObjectSet.cpp.
|
noexcept |
kind. Definition at line 50 of file PointerObjectSet.cpp.
|
noexcept |
Definition at line 61 of file PointerObjectSet.cpp.
|
private |
Internal helper function for making P(superset) a superset of P(subset), with a callback.
Definition at line 426 of file PointerObjectSet.cpp.
| 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.
| 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.
| rvsdgOutput | the rvsdg::output that might correspond to a PointerObject in the set |
Definition at line 99 of file PointerObjectSet.cpp.
| 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.
| object1 | the index of the first PointerObject to unify |
| object2 | the index of the second PointerObject to unify |
Definition at line 359 of file PointerObjectSet.cpp.
|
private |
Definition at line 170 of file PointerObjectSet.hpp.
|
private |
Definition at line 176 of file PointerObjectSet.hpp.
|
private |
Definition at line 174 of file PointerObjectSet.hpp.
|
private |
Definition at line 178 of file PointerObjectSet.hpp.
|
private |
Definition at line 172 of file PointerObjectSet.hpp.
|
private |
Definition at line 185 of file PointerObjectSet.hpp.
|
private |
Definition at line 181 of file PointerObjectSet.hpp.
|
mutableprivate |
Definition at line 155 of file PointerObjectSet.hpp.
|
private |
Definition at line 159 of file PointerObjectSet.hpp.
|
private |
Definition at line 151 of file PointerObjectSet.hpp.
|
private |
Definition at line 164 of file PointerObjectSet.hpp.
|
private |
Definition at line 168 of file PointerObjectSet.hpp.