LLVM API Documentation

SCCPSolver Class Reference

Inheritance diagram for SCCPSolver:

Inheritance graph
[legend]
Collaboration diagram for SCCPSolver:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void MarkBlockExecutable (BasicBlock *BB)
void TrackValueOfGlobalVariable (GlobalVariable *GV)
void AddTrackedFunction (Function *F)
void Solve ()
bool ResolveBranchesIn (Function &F)
std::set< BasicBlock * > & getExecutableBlocks ()
hash_map< Value *, LatticeVal > & getValueMapping ()
const hash_map< Function *,
LatticeVal > & 
getTrackedFunctionRetVals ()
const hash_map< GlobalVariable *,
LatticeVal > & 
getTrackedGlobals ()

Friends

class InstVisitor< SCCPSolver >

Detailed Description

SCCPSolver - This class is a general purpose solver for Sparse Conditional Constant Propagation.

Definition at line 97 of file SCCP.cpp.


Member Function Documentation

void SCCPSolver::AddTrackedFunction ( Function F  )  [inline]

AddTrackedFunction - If the SCCP solver is supposed to track calls into and out of the specified function (which cannot have its address taken), this method must be called.

Definition at line 158 of file SCCP.cpp.

References F.

std::set<BasicBlock*>& SCCPSolver::getExecutableBlocks (  )  [inline]

getExecutableBlocks - Once we have solved for constants, return the set of blocks that is known to be executable.

Definition at line 177 of file SCCP.cpp.

const hash_map<Function*, LatticeVal>& SCCPSolver::getTrackedFunctionRetVals (  )  [inline]

getTrackedFunctionRetVals - Get the inferred return value map.

Definition at line 189 of file SCCP.cpp.

const hash_map<GlobalVariable*, LatticeVal>& SCCPSolver::getTrackedGlobals (  )  [inline]

getTrackedGlobals - Get and return the set of inferred initializers for global variables.

Definition at line 195 of file SCCP.cpp.

hash_map<Value*, LatticeVal>& SCCPSolver::getValueMapping (  )  [inline]

getValueMapping - Once we have solved for constants, return the mapping of LLVM values to LatticeVals.

Definition at line 183 of file SCCP.cpp.

void SCCPSolver::MarkBlockExecutable ( BasicBlock BB  )  [inline]

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 136 of file SCCP.cpp.

References BB, DEBUG, and llvm::Value::getName().

bool SCCPSolver::ResolveBranchesIn ( Function F  ) 

ResolveBranchesIn - While solving the dataflow for a function, we assume that branches on undef values cannot reach any of their successors. However, this is not a safe assumption. After we solve dataflow, this method should be use to handle this. If this returns true, the solver should be rerun.

Definition at line 1029 of file SCCP.cpp.

References BB, F, llvm::Value::getType(), True, and llvm::InstVisitor< SubClass, RetTy >::visit().

void SCCPSolver::Solve (  ) 

Solve - Solve for constants and executable blocks.

Definition at line 968 of file SCCP.cpp.

References BB, DEBUG, llvm::Value::use_begin(), llvm::Value::use_end(), and llvm::InstVisitor< SubClass, RetTy >::visit().

void SCCPSolver::TrackValueOfGlobalVariable ( GlobalVariable GV  )  [inline]

TrackValueOfGlobalVariable - Clients can use this method to inform the SCCPSolver that it should track loads and stores to the specified global variable if it can. This is only legal to call if performing Interprocedural SCCP.

Definition at line 146 of file SCCP.cpp.

References llvm::SequentialType::getElementType(), llvm::GlobalValue::getType(), GV, and llvm::Type::isFirstClassType().


Friends And Related Function Documentation

friend class InstVisitor< SCCPSolver > [friend]

Definition at line 315 of file SCCP.cpp.


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