LLVM API Documentation

Public Member Functions
llvm::SparseSolver Class Reference

#include <SparsePropagation.h>

List of all members.

Public Member Functions

 SparseSolver (AbstractLatticeFunction *Lattice)
 ~SparseSolver ()
void Solve (Function &F)
void Print (Function &F, raw_ostream &OS) const
LatticeVal getLatticeState (Value *V) const
LatticeVal getOrInitValueState (Value *V)
bool isEdgeFeasible (BasicBlock *From, BasicBlock *To, bool AggressiveUndef=false)
bool isBlockExecutable (BasicBlock *BB) const

Detailed Description

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

Definition at line 115 of file SparsePropagation.h.


Constructor & Destructor Documentation

llvm::SparseSolver::SparseSolver ( AbstractLatticeFunction Lattice) [inline, explicit]

Definition at line 137 of file SparsePropagation.h.

Definition at line 139 of file SparsePropagation.h.


Member Function Documentation

LatticeVal llvm::SparseSolver::getLatticeState ( Value V) const [inline]

getLatticeState - Return the LatticeVal object that corresponds to the value. If an value is not in the map, it is returned as untracked, unlike the getOrInitValueState method.

Definition at line 152 of file SparsePropagation.h.

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

Referenced by Print().

SparseSolver::LatticeVal SparseSolver::getOrInitValueState ( Value V)

getOrInitValueState - Return the LatticeVal object that corresponds to the value, initializing the value's state if it hasn't been entered into the map yet. This function is necessary because not all values should start out in the underdefined state... Arguments should be overdefined, and constants should be marked as constants.

Definition at line 53 of file SparsePropagation.cpp.

References llvm::ARM_PROC::A, llvm::CallingConv::C, llvm::AbstractLatticeFunction::ComputeArgument(), llvm::AbstractLatticeFunction::ComputeConstant(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find(), llvm::AbstractLatticeFunction::getOverdefinedVal(), llvm::AbstractLatticeFunction::getUndefVal(), llvm::AbstractLatticeFunction::getUntrackedVal(), I, if(), and llvm::AbstractLatticeFunction::IsUntrackedValue().

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

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

bool SparseSolver::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.

isEdgeFeasible - Return true if the control flow edge from the 'From' basic block to the 'To' basic block is currently feasible...

Definition at line 205 of file SparsePropagation.cpp.

References llvm::TerminatorInst::getNumSuccessors(), llvm::TerminatorInst::getSuccessor(), and llvm::BasicBlock::getTerminator().

void SparseSolver::Print ( Function F,
raw_ostream OS 
) const

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