LLVM 20.0.0git
|
AbstractLatticeFunction - This class is implemented by the dataflow instance to specify what the lattice values are and how they handle merges etc. More...
#include "llvm/Analysis/SparsePropagation.h"
Public Member Functions | |
AbstractLatticeFunction (LatticeVal undefVal, LatticeVal overdefinedVal, LatticeVal untrackedVal) | |
virtual | ~AbstractLatticeFunction ()=default |
LatticeVal | getUndefVal () const |
LatticeVal | getOverdefinedVal () const |
LatticeVal | getUntrackedVal () const |
virtual bool | IsUntrackedValue (LatticeKey Key) |
IsUntrackedValue - If the specified LatticeKey is obviously uninteresting to the analysis (i.e., it would always return UntrackedVal), this function can return true to avoid pointless work. | |
virtual LatticeVal | ComputeLatticeVal (LatticeKey Key) |
ComputeLatticeVal - Compute and return a LatticeVal corresponding to the given LatticeKey. | |
virtual bool | IsSpecialCasedPHI (PHINode *PN) |
IsSpecialCasedPHI - Given a PHI node, determine whether this PHI node is one that the we want to handle through ComputeInstructionState. | |
virtual LatticeVal | MergeValues (LatticeVal X, LatticeVal Y) |
MergeValues - Compute and return the merge of the two specified lattice values. | |
virtual void | ComputeInstructionState (Instruction &I, SmallDenseMap< LatticeKey, LatticeVal, 16 > &ChangedValues, SparseSolver< LatticeKey, LatticeVal > &SS)=0 |
ComputeInstructionState - Compute the LatticeKeys that change as a result of executing instruction I . | |
virtual void | PrintLatticeVal (LatticeVal LV, raw_ostream &OS) |
PrintLatticeVal - Render the given LatticeVal to the specified stream. | |
virtual void | PrintLatticeKey (LatticeKey Key, raw_ostream &OS) |
PrintLatticeKey - Render the given LatticeKey to the specified stream. | |
virtual Value * | GetValueFromLatticeVal (LatticeVal LV, Type *Ty=nullptr) |
GetValueFromLatticeVal - If the given LatticeVal is representable as an LLVM value, return it; otherwise, return nullptr. | |
AbstractLatticeFunction - This class is implemented by the dataflow instance to specify what the lattice values are and how they handle merges etc.
This gives the client the power to compute lattice values from instructions, constants, etc. The current requirement is that lattice values must be copyable. At the moment, nothing tries to avoid copying. Additionally, lattice keys must be able to be used as keys of a mapping data structure. Internally, the generic solver currently uses a DenseMap to map lattice keys to lattice values. If the lattice key is a non-standard type, a specialization of DenseMapInfo must be provided.
Definition at line 47 of file SparsePropagation.h.
|
inline |
Definition at line 52 of file SparsePropagation.h.
|
virtualdefault |
|
pure virtual |
ComputeInstructionState - Compute the LatticeKeys that change as a result of executing instruction I
.
Their associated LatticeVals are store in ChangedValues
.
|
inlinevirtual |
ComputeLatticeVal - Compute and return a LatticeVal corresponding to the given LatticeKey.
Definition at line 72 of file SparsePropagation.h.
References llvm::AbstractLatticeFunction< LatticeKey, LatticeVal >::getOverdefinedVal().
|
inline |
Definition at line 62 of file SparsePropagation.h.
Referenced by llvm::AbstractLatticeFunction< LatticeKey, LatticeVal >::ComputeLatticeVal(), and llvm::AbstractLatticeFunction< LatticeKey, LatticeVal >::MergeValues().
|
inline |
Definition at line 61 of file SparsePropagation.h.
|
inline |
Definition at line 63 of file SparsePropagation.h.
Referenced by llvm::SparseSolver< LatticeKey, LatticeVal, KeyInfo >::getExistingValueState().
|
inlinevirtual |
GetValueFromLatticeVal - If the given LatticeVal is representable as an LLVM value, return it; otherwise, return nullptr.
If a type is given, the returned value must have the same type. This function is used by the generic solver in attempting to resolve branch and switch conditions.
Definition at line 104 of file SparsePropagation.h.
|
inlinevirtual |
IsSpecialCasedPHI - Given a PHI node, determine whether this PHI node is one that the we want to handle through ComputeInstructionState.
Definition at line 78 of file SparsePropagation.h.
|
inlinevirtual |
IsUntrackedValue - If the specified LatticeKey is obviously uninteresting to the analysis (i.e., it would always return UntrackedVal), this function can return true to avoid pointless work.
Definition at line 68 of file SparsePropagation.h.
|
inlinevirtual |
MergeValues - Compute and return the merge of the two specified lattice values.
Merging should only move one direction down the lattice to guarantee convergence (toward overdefined).
Definition at line 83 of file SparsePropagation.h.
References llvm::AbstractLatticeFunction< LatticeKey, LatticeVal >::getOverdefinedVal().
|
virtual |
PrintLatticeKey - Render the given LatticeKey to the specified stream.
Definition at line 218 of file SparsePropagation.h.
References OS.
|
virtual |
PrintLatticeVal - Render the given LatticeVal to the specified stream.
Definition at line 205 of file SparsePropagation.h.
References OS.