class SparseSolver
Declaration
template <class LatticeKey,
class LatticeVal,
class KeyInfo = LatticeKeyInfo<LatticeKey>>
class SparseSolver { /* full declaration omitted */ };
Description
SparseSolver - This class is a general purpose solver for Sparse Conditional Propagation with a programmable lattice function.
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:113
Templates
- LatticeKey
- LatticeVal
- KeyInfo = LatticeKeyInfo<LatticeKey>
Member Variables
- private AbstractLatticeFunction<LatticeKey, LatticeVal>* LatticeFunc
- LatticeFunc - This is the object that knows the lattice and how to compute transfer functions.
- private DenseMap<LatticeKey, LatticeVal> ValueState
- ValueState - Holds the LatticeVals associated with LatticeKeys.
- private SmallPtrSet<llvm::BasicBlock*, 16> BBExecutable
- BBExecutable - Holds the basic blocks that are executable.
- private SmallVector<llvm::Value*, 64> ValueWorkList
- ValueWorkList - Holds values that should be processed.
- private SmallVector<llvm::BasicBlock*, 64> BBWorkList
- BBWorkList - Holds basic blocks that should be processed.
- private std::set<Edge> KnownFeasibleEdges
- KnownFeasibleEdges - Entries in this set are edges which have already had PHI nodes retriggered.
Method Overview
- public void MarkBlockExecutable(llvm::BasicBlock * BB)
- public void Print(llvm::raw_ostream & OS) const
- public void Solve()
- public SparseSolver<LatticeKey, LatticeVal, KeyInfo>(AbstractLatticeFunction<LatticeKey, LatticeVal> * Lattice)
- public SparseSolver<LatticeKey, LatticeVal, KeyInfo>(const SparseSolver<LatticeKey, LatticeVal, KeyInfo> &)
- private void UpdateState(LatticeKey Key, LatticeVal LV)
- public LatticeVal getExistingValueState(LatticeKey Key) const
- private void getFeasibleSuccessors(llvm::Instruction & TI, SmallVectorImpl<bool> & Succs, bool AggressiveUndef)
- public LatticeVal getValueState(LatticeKey Key)
- public bool isBlockExecutable(llvm::BasicBlock * BB) const
- public bool isEdgeFeasible(llvm::BasicBlock * From, llvm::BasicBlock * To, bool AggressiveUndef = false)
- private void markEdgeExecutable(llvm::BasicBlock * Source, llvm::BasicBlock * Dest)
- private void visitInst(llvm::Instruction & I)
- private void visitPHINode(llvm::PHINode & I)
- private void visitTerminator(llvm::Instruction & TI)
Methods
¶void MarkBlockExecutable(llvm::BasicBlock* BB)
void MarkBlockExecutable(llvm::BasicBlock* BB)
Description
MarkBlockExecutable - This method can be used by clients to mark all of the blocks that are known to be intrinsically live in the processed unit.
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:179
Parameters
- llvm::BasicBlock* BB
¶void Print(llvm::raw_ostream& OS) const
void Print(llvm::raw_ostream& OS) const
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:147
Parameters
¶void Solve()
void Solve()
Description
Solve - Solve for constants and executable blocks.
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:145
¶SparseSolver<LatticeKey, LatticeVal, KeyInfo>(
AbstractLatticeFunction<LatticeKey,
LatticeVal>* Lattice)
SparseSolver<LatticeKey, LatticeVal, KeyInfo>(
AbstractLatticeFunction<LatticeKey,
LatticeVal>* Lattice)
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:138
Parameters
- AbstractLatticeFunction<LatticeKey, LatticeVal>* Lattice
¶SparseSolver<LatticeKey, LatticeVal, KeyInfo>(
const SparseSolver<LatticeKey,
LatticeVal,
KeyInfo>&)
SparseSolver<LatticeKey, LatticeVal, KeyInfo>(
const SparseSolver<LatticeKey,
LatticeVal,
KeyInfo>&)
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:141
Parameters
- const SparseSolver<LatticeKey, LatticeVal, KeyInfo>&
¶void UpdateState(LatticeKey Key, LatticeVal LV)
void UpdateState(LatticeKey Key, LatticeVal LV)
Description
UpdateState - When the state of some LatticeKey is potentially updated to the given LatticeVal, this function notices and adds the LLVM value corresponding the key to the work list, if needed.
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:185
Parameters
- LatticeKey Key
- LatticeVal LV
¶LatticeVal getExistingValueState(
LatticeKey Key) const
LatticeVal getExistingValueState(
LatticeKey Key) const
Description
getExistingValueState - Return the LatticeVal object corresponding to the given value from the ValueState map. If the value is not in the map, UntrackedVal is returned, unlike the getValueState method.
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:152
Parameters
- LatticeKey Key
¶void getFeasibleSuccessors(
llvm::Instruction& TI,
SmallVectorImpl<bool>& Succs,
bool AggressiveUndef)
void getFeasibleSuccessors(
llvm::Instruction& TI,
SmallVectorImpl<bool>& Succs,
bool AggressiveUndef)
Description
getFeasibleSuccessors - Return a vector of booleans to indicate which successors are reachable from a given terminator instruction.
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:193
Parameters
- llvm::Instruction& TI
- SmallVectorImpl<bool>& Succs
- bool AggressiveUndef
¶LatticeVal getValueState(LatticeKey Key)
LatticeVal getValueState(LatticeKey Key)
Description
getValueState - Return the LatticeVal object corresponding to the given value from the ValueState map. If the value is not in the map, its state is initialized.
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:160
Parameters
- LatticeKey Key
¶bool isBlockExecutable(llvm::BasicBlock* BB) const
bool isBlockExecutable(llvm::BasicBlock* BB) const
Description
isBlockExecutable - Return true if there are any known feasible edges into the basic block. This is generally only useful when querying the lattice.
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:173
Parameters
- llvm::BasicBlock* BB
¶bool isEdgeFeasible(llvm::BasicBlock* From,
llvm::BasicBlock* To,
bool AggressiveUndef = false)
bool isEdgeFeasible(llvm::BasicBlock* From,
llvm::BasicBlock* To,
bool AggressiveUndef = false)
Description
isEdgeFeasible - Return true if the control flow edge from the 'From' basic block to the 'To' basic block is currently feasible. If AggressiveUndef is true, then this treats values with unknown lattice values as undefined. This is generally only useful when solving the lattice, not when querying it.
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:167
Parameters
- llvm::BasicBlock* From
- llvm::BasicBlock* To
- bool AggressiveUndef = false
¶void markEdgeExecutable(llvm::BasicBlock* Source,
llvm::BasicBlock* Dest)
void markEdgeExecutable(llvm::BasicBlock* Source,
llvm::BasicBlock* Dest)
Description
markEdgeExecutable - Mark a basic block as executable, adding it to the BB work list if it is not already executable.
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:189
Parameters
- llvm::BasicBlock* Source
- llvm::BasicBlock* Dest
¶void visitInst(llvm::Instruction& I)
void visitInst(llvm::Instruction& I)
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:196
Parameters
¶void visitPHINode(llvm::PHINode& I)
void visitPHINode(llvm::PHINode& I)
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:197
Parameters
¶void visitTerminator(llvm::Instruction& TI)
void visitTerminator(llvm::Instruction& TI)
Declared at: llvm/include/llvm/Analysis/SparsePropagation.h:198