class AbstractLatticeFunction
Declaration
template <class LatticeKey, class LatticeVal>
class AbstractLatticeFunction { /* full declaration omitted */ };
Description
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.
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:45
Templates
- LatticeKey
- LatticeVal
Method Overview
- public AbstractLatticeFunction<LatticeKey, LatticeVal>(LatticeVal undefVal, LatticeVal overdefinedVal, LatticeVal untrackedVal)
- public virtual void ComputeInstructionState(llvm::Instruction & I, DenseMap<LatticeKey, LatticeVal> & ChangedValues, SparseSolver<LatticeKey, LatticeVal> & SS)
- public virtual LatticeVal ComputeLatticeVal(LatticeKey Key)
- public virtual llvm::Value * GetValueFromLatticeVal(LatticeVal LV, llvm::Type * Ty = nullptr)
- public virtual bool IsSpecialCasedPHI(llvm::PHINode * PN)
- public virtual bool IsUntrackedValue(LatticeKey Key)
- public virtual LatticeVal MergeValues(LatticeVal X, LatticeVal Y)
- public virtual void PrintLatticeKey(LatticeKey Key, llvm::raw_ostream & OS)
- public virtual void PrintLatticeVal(LatticeVal LV, llvm::raw_ostream & OS)
- public LatticeVal getOverdefinedVal() const
- public LatticeVal getUndefVal() const
- public LatticeVal getUntrackedVal() const
- public virtual ~AbstractLatticeFunction<LatticeKey, LatticeVal>()
Methods
¶AbstractLatticeFunction<LatticeKey, LatticeVal>(
LatticeVal undefVal,
LatticeVal overdefinedVal,
LatticeVal untrackedVal)
AbstractLatticeFunction<LatticeKey, LatticeVal>(
LatticeVal undefVal,
LatticeVal overdefinedVal,
LatticeVal untrackedVal)
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:50
Parameters
- LatticeVal undefVal
- LatticeVal overdefinedVal
- LatticeVal untrackedVal
¶virtual void ComputeInstructionState(
llvm::Instruction& I,
DenseMap<LatticeKey, LatticeVal>&
ChangedValues,
SparseSolver<LatticeKey, LatticeVal>& SS)
virtual void ComputeInstructionState(
llvm::Instruction& I,
DenseMap<LatticeKey, LatticeVal>&
ChangedValues,
SparseSolver<LatticeKey, LatticeVal>& SS)
Description
ComputeInstructionState - Compute the LatticeKeys that change as a result of executing instruction \p I. Their associated LatticeVals are store in\p ChangedValues.
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:89
Parameters
- llvm::Instruction& I
- DenseMap<LatticeKey, LatticeVal>& ChangedValues
- SparseSolver<LatticeKey, LatticeVal>& SS
¶virtual LatticeVal ComputeLatticeVal(
LatticeKey Key)
virtual LatticeVal ComputeLatticeVal(
LatticeKey Key)
Description
ComputeLatticeVal - Compute and return a LatticeVal corresponding to the given LatticeKey.
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:70
Parameters
- LatticeKey Key
¶virtual llvm::Value* GetValueFromLatticeVal(
LatticeVal LV,
llvm::Type* Ty = nullptr)
virtual llvm::Value* GetValueFromLatticeVal(
LatticeVal LV,
llvm::Type* Ty = nullptr)
Description
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.
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:103
Parameters
- LatticeVal LV
- llvm::Type* Ty = nullptr
¶virtual bool IsSpecialCasedPHI(llvm::PHINode* PN)
virtual bool IsSpecialCasedPHI(llvm::PHINode* PN)
Description
IsSpecialCasedPHI - Given a PHI node, determine whether this PHI node is one that the we want to handle through ComputeInstructionState.
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:76
Parameters
- llvm::PHINode* PN
¶virtual bool IsUntrackedValue(LatticeKey Key)
virtual bool IsUntrackedValue(LatticeKey Key)
Description
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.
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:66
Parameters
- LatticeKey Key
¶virtual LatticeVal MergeValues(LatticeVal X,
LatticeVal Y)
virtual LatticeVal MergeValues(LatticeVal X,
LatticeVal Y)
Description
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).
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:81
Parameters
- LatticeVal X
- LatticeVal Y
¶virtual void PrintLatticeKey(
LatticeKey Key,
llvm::raw_ostream& OS)
virtual void PrintLatticeKey(
LatticeKey Key,
llvm::raw_ostream& OS)
Description
PrintLatticeKey - Render the given LatticeKey to the specified stream.
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:97
Parameters
- LatticeKey Key
- llvm::raw_ostream& OS
¶virtual void PrintLatticeVal(
LatticeVal LV,
llvm::raw_ostream& OS)
virtual void PrintLatticeVal(
LatticeVal LV,
llvm::raw_ostream& OS)
Description
PrintLatticeVal - Render the given LatticeVal to the specified stream.
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:94
Parameters
- LatticeVal LV
- llvm::raw_ostream& OS
¶LatticeVal getOverdefinedVal() const
LatticeVal getOverdefinedVal() const
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:60
¶LatticeVal getUndefVal() const
LatticeVal getUndefVal() const
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:59
¶LatticeVal getUntrackedVal() const
LatticeVal getUntrackedVal() const
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:61
¶virtual ~AbstractLatticeFunction<LatticeKey,
LatticeVal>()
virtual ~AbstractLatticeFunction<LatticeKey,
LatticeVal>()
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:57