LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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 ResolvedUndefsIn (Function &F)
bool isBlockExecutable (BasicBlock *BB) const
std::map< Value *, LatticeVal > & getValueMapping ()
const DenseMap< Function *,
LatticeVal > & 
getTrackedRetVals ()
const DenseMap< GlobalVariable *,
LatticeVal > & 
getTrackedGlobals ()
void markOverdefined (Value *V)

Friends

class InstVisitor<SCCPSolver>

Detailed Description

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

Definition at line 140 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 205 of file SCCP.cpp.

References llvm::StructType::getNumElements(), llvm::Function::getReturnType(), llvm::GlobalValue::hasInternalLinkage(), and LatticeVal.

Referenced by IPSCCP::runOnModule().

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

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

Definition at line 245 of file SCCP.cpp.

Referenced by IPSCCP::runOnModule().

const DenseMap<Function*, LatticeVal>& SCCPSolver::getTrackedRetVals  )  [inline]
 

getTrackedRetVals - Get the inferred return value map.

Definition at line 239 of file SCCP.cpp.

Referenced by IPSCCP::runOnModule().

std::map<Value*, LatticeVal>& SCCPSolver::getValueMapping  )  [inline]
 

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

Definition at line 233 of file SCCP.cpp.

Referenced by SCCP::runOnFunction(), and IPSCCP::runOnModule().

bool SCCPSolver::isBlockExecutable BasicBlock BB  )  const [inline]
 

Definition at line 227 of file SCCP.cpp.

Referenced by SCCP::runOnFunction(), and IPSCCP::runOnModule().

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

References DOUT, and llvm::Value::getNameStart().

Referenced by SCCP::runOnFunction(), and IPSCCP::runOnModule().

void SCCPSolver::markOverdefined Value V  )  [inline]
 

Definition at line 249 of file SCCP.cpp.

Referenced by ResolvedUndefsIn(), SCCP::runOnFunction(), and IPSCCP::runOnModule().

bool SCCPSolver::ResolvedUndefsIn Function F  ) 
 

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

References llvm::Function::begin(), llvm::DenseSet< ValueT, ValueInfoT >::count(), llvm::Function::end(), llvm::SwitchInst::getCaseValue(), llvm::SwitchInst::getCondition(), llvm::BranchInst::getCondition(), llvm::SwitchInst::getNumSuccessors(), llvm::TerminatorInst::getSuccessor(), llvm::BranchInst::isConditional(), LatticeVal, markOverdefined(), llvm::SwitchInst::setCondition(), and llvm::BranchInst::setCondition().

Referenced by SCCP::runOnFunction(), and IPSCCP::runOnModule().

void SCCPSolver::Solve  ) 
 

Solve - Solve for constants and executable blocks.

Definition at line 1261 of file SCCP.cpp.

References llvm::SmallVectorImpl< T >::back(), DOUT, llvm::SmallVectorImpl< T >::empty(), llvm::SmallVectorImpl< T >::pop_back(), llvm::Value::use_iterator, and llvm::InstVisitor< SCCPSolver >::visit().

Referenced by SCCP::runOnFunction(), and IPSCCP::runOnModule().

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

References llvm::SequentialType::getElementType(), llvm::GlobalVariable::getInitializer(), llvm::GlobalValue::getType(), llvm::Type::isFirstClassType(), and LatticeVal.

Referenced by IPSCCP::runOnModule().


Friends And Related Function Documentation

friend class InstVisitor<SCCPSolver> [friend]
 

Definition at line 373 of file SCCP.cpp.


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


This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.