LLVM 20.0.0git
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.
 
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.
 
LatticeVal getValueState (LatticeKey Key)
 getValueState - Return the LatticeVal object corresponding to the given value from the ValueState map.
 
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.
 
bool isBlockExecutable (BasicBlock *BB) const
 isBlockExecutable - Return true if there are any known feasible edges into the basic block.
 
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.
 

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 113 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 138 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 152 of file SparsePropagation.h.

References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), 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 230 of file SparsePropagation.h.

References I.

◆ 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 173 of file SparsePropagation.h.

References llvm::SmallPtrSetImpl< PtrType >::count().

◆ 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 371 of file SparsePropagation.h.

References From, llvm::Instruction::getNumSuccessors(), and llvm::Instruction::getSuccessor().

◆ MarkBlockExecutable()

template<class LatticeKey , class LatticeVal , class KeyInfo >
void llvm::SparseSolver< LatticeKey, LatticeVal, KeyInfo >::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.

Definition at line 260 of file SparsePropagation.h.

References llvm::dbgs(), llvm::Value::getName(), and LLVM_DEBUG.

Referenced by runCVP().

◆ 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 502 of file SparsePropagation.h.

References OS.

◆ 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 470 of file SparsePropagation.h.

References llvm::dbgs(), I, and LLVM_DEBUG.

Referenced by runCVP().


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