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:47

Templates

LatticeKey
LatticeVal

Member Variables

private LatticeVal UndefVal
private LatticeVal OverdefinedVal
private LatticeVal UntrackedVal

Method Overview

Methods

AbstractLatticeFunction<LatticeKey, LatticeVal>(
    LatticeVal undefVal,
    LatticeVal overdefinedVal,
    LatticeVal untrackedVal)

Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:52

Parameters

LatticeVal undefVal
LatticeVal overdefinedVal
LatticeVal untrackedVal

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:91

Parameters

llvm::Instruction& I
DenseMap<LatticeKey, LatticeVal>& ChangedValues
SparseSolver<LatticeKey, LatticeVal>& SS

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:72

Parameters

LatticeKey Key

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:105

Parameters

LatticeVal LV
llvm::Type* Ty = nullptr

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:78

Parameters

llvm::PHINode* PN

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:68

Parameters

LatticeKey Key

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:83

Parameters

LatticeVal X
LatticeVal Y

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:99

Parameters

LatticeKey Key
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:96

Parameters

LatticeVal LV
llvm::raw_ostream& OS

LatticeVal getOverdefinedVal() const

Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:62

LatticeVal getUndefVal() const

Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:61

LatticeVal getUntrackedVal() const

Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:63

virtual ~AbstractLatticeFunction<LatticeKey,
                                 LatticeVal>()

Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:59