LLVM  8.0.1
Public Member Functions | List of all members
llvm::SparseSolver< LatticeKey, LatticeVal, KeyInfo > Class Template Reference

SparseSolver - This class is a general purpose solver for Sparse Conditional Propagation with a programmable lattice function. More...

#include "llvm/Analysis/SparsePropagation.h"

Public Member Functions

 SparseSolver (AbstractLatticeFunction< LatticeKey, LatticeVal > *Lattice)
 
 SparseSolver (const SparseSolver &)=delete
 
SparseSolveroperator= (const SparseSolver &)=delete
 
void Solve ()
 Solve - Solve for constants and executable blocks. More...
 
void Print (raw_ostream &OS) const
 
LatticeVal getExistingValueState (LatticeKey Key) const
 getExistingValueState - Return the LatticeVal object corresponding to the given value from the ValueState map. More...
 
LatticeVal getValueState (LatticeKey Key)
 getValueState - Return the LatticeVal object corresponding to the given value from the ValueState map. More...
 
bool isEdgeFeasible (BasicBlock *From, BasicBlock *To, bool AggressiveUndef=false)
 isEdgeFeasible - Return true if the control flow edge from the 'From' basic block to the 'To' basic block is currently feasible. More...
 
bool isBlockExecutable (BasicBlock *BB) const
 isBlockExecutable - Return true if there are any known feasible edges into the basic block. More...
 
void MarkBlockExecutable (BasicBlock *BB)
 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. More...
 

Detailed Description

template<class LatticeKey, class LatticeVal, class KeyInfo>
class llvm::SparseSolver< LatticeKey, LatticeVal, KeyInfo >

SparseSolver - This class is a general purpose solver for Sparse Conditional Propagation with a programmable lattice function.

Definition at line 35 of file SparsePropagation.h.

Constructor & Destructor Documentation

◆ SparseSolver() [1/2]

template<class LatticeKey, class LatticeVal, class KeyInfo>
llvm::SparseSolver< LatticeKey, LatticeVal, KeyInfo >::SparseSolver ( AbstractLatticeFunction< LatticeKey, LatticeVal > *  Lattice)
inlineexplicit

Definition at line 137 of file SparsePropagation.h.

◆ SparseSolver() [2/2]

template<class LatticeKey, class LatticeVal, class KeyInfo>
llvm::SparseSolver< LatticeKey, LatticeVal, KeyInfo >::SparseSolver ( const SparseSolver< LatticeKey, LatticeVal, KeyInfo > &  )
delete

Member Function Documentation

◆ getExistingValueState()

template<class LatticeKey, class LatticeVal, class KeyInfo>
LatticeVal llvm::SparseSolver< LatticeKey, LatticeVal, KeyInfo >::getExistingValueState ( LatticeKey  Key) const
inline

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.

Definition at line 151 of file SparsePropagation.h.

References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), From, llvm::AbstractLatticeFunction< LatticeKey, LatticeVal >::getUntrackedVal(), and I.

Referenced by runCVP().

◆ getValueState()

template<class LatticeKey , class LatticeVal , class KeyInfo >
LatticeVal llvm::SparseSolver< LatticeKey, LatticeVal, KeyInfo >::getValueState ( LatticeKey  Key)

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.

Definition at line 229 of file SparsePropagation.h.

References I, and if().

◆ isBlockExecutable()

template<class LatticeKey, class LatticeVal, class KeyInfo>
bool llvm::SparseSolver< LatticeKey, LatticeVal, KeyInfo >::isBlockExecutable ( BasicBlock BB) const
inline

isBlockExecutable - Return true if there are any known feasible edges into the basic block.

This is generally only useful when querying the lattice.

Definition at line 172 of file SparsePropagation.h.

References llvm::SmallPtrSetImpl< PtrType >::count(), I, and llvm::Sched::Source.

◆ isEdgeFeasible()

template<class LatticeKey , class LatticeVal , class KeyInfo >
bool llvm::SparseSolver< LatticeKey, LatticeVal, KeyInfo >::isEdgeFeasible ( BasicBlock From,
BasicBlock To,
bool  AggressiveUndef = false 
)

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.

Definition at line 374 of file SparsePropagation.h.

References llvm::PHINode::getIncomingBlock(), llvm::PHINode::getIncomingValue(), llvm::PHINode::getNumIncomingValues(), llvm::Instruction::getNumSuccessors(), llvm::Instruction::getParent(), llvm::Instruction::getSuccessor(), llvm::BasicBlock::getTerminator(), I, llvm::Instruction::isTerminator(), and llvm::SmallVectorBase::size().

◆ MarkBlockExecutable()

template<class LatticeKey , class LatticeVal , class KeyInfo >
void llvm::SparseSolver< LatticeKey, LatticeVal, KeyInfo >::MarkBlockExecutable ( BasicBlock BB)

◆ operator=()

template<class LatticeKey, class LatticeVal, class KeyInfo>
SparseSolver& llvm::SparseSolver< LatticeKey, LatticeVal, KeyInfo >::operator= ( const SparseSolver< LatticeKey, LatticeVal, KeyInfo > &  )
delete

◆ Print()

template<class LatticeKey , class LatticeVal , class KeyInfo >
void llvm::SparseSolver< LatticeKey, LatticeVal, KeyInfo >::Print ( raw_ostream OS) const

Definition at line 507 of file SparsePropagation.h.

◆ Solve()

template<class LatticeKey , class LatticeVal , class KeyInfo >
void llvm::SparseSolver< LatticeKey, LatticeVal, KeyInfo >::Solve ( )

Solve - Solve for constants and executable blocks.

Definition at line 473 of file SparsePropagation.h.

References llvm::BasicBlock::back(), llvm::dbgs(), LLVM_DEBUG, and llvm::Value::users().

Referenced by runCVP().


The documentation for this class was generated from the following file: