class SCCPSolver
Declaration
class SCCPSolver { /* full declaration omitted */ };
Description
SCCPSolver - This interface class is a general purpose solver for Sparse Conditional Constant Propagation (SCCP).
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:61
Member Variables
- private std::unique_ptr<SCCPInstVisitor> Visitor
Method Overview
- public SCCPSolver(const llvm::DataLayout & DL, std::function<const TargetLibraryInfo &(Function &)> GetTLI, llvm::LLVMContext & Ctx)
- public void addAnalysis(llvm::Function & F, llvm::AnalysisResultsForFn A)
- public void addArgumentTrackedFunction(llvm::Function * F)
- public void addToMustPreserveReturnsInFunctions(llvm::Function * F)
- public void addTrackedFunction(llvm::Function * F)
- public SmallPtrSetImpl<llvm::Function *> & getArgumentTrackedFunctions()
- public llvm::Constant * getConstant(const llvm::ValueLatticeElement & LV) const
- public llvm::DomTreeUpdater getDTU(llvm::Function & F)
- public const llvm::ValueLatticeElement & getLatticeValueFor(llvm::Value * V) const
- public const SmallPtrSet<llvm::Function *, 16> getMRVFunctionsTracked()
- public const llvm::PredicateBase * getPredicateInfoFor(llvm::Instruction * I)
- public std::vector<ValueLatticeElement> getStructLatticeValueFor(llvm::Value * V) const
- public const DenseMap<llvm::GlobalVariable *, llvm::ValueLatticeElement> & getTrackedGlobals()
- public const MapVector<llvm::Function *, llvm::ValueLatticeElement> & getTrackedRetVals()
- public bool isArgumentTrackedFunction(llvm::Function * F)
- public bool isBlockExecutable(llvm::BasicBlock * BB) const
- public bool isEdgeFeasible(llvm::BasicBlock * From, llvm::BasicBlock * To) const
- public bool isStructLatticeConstant(llvm::Function * F, llvm::StructType * STy)
- public void markArgInFuncSpecialization(llvm::Function * F, const SmallVectorImpl<llvm::ArgInfo> & Args)
- public bool markBlockExecutable(llvm::BasicBlock * BB)
- public void markFunctionUnreachable(llvm::Function * F)
- public void markOverdefined(llvm::Value * V)
- public bool mustPreserveReturn(llvm::Function * F)
- public void removeLatticeValueFor(llvm::Value * V)
- public bool resolvedUndefsIn(llvm::Function & F)
- public void solve()
- public void trackValueOfGlobalVariable(llvm::GlobalVariable * GV)
- public void visit(llvm::Instruction * I)
- public void visitCall(llvm::CallInst & I)
- public ~SCCPSolver()
Methods
¶SCCPSolver(const llvm::DataLayout& DL,
std::function<const TargetLibraryInfo&(
Function&)> GetTLI,
llvm::LLVMContext& Ctx)
SCCPSolver(const llvm::DataLayout& DL,
std::function<const TargetLibraryInfo&(
Function&)> GetTLI,
llvm::LLVMContext& Ctx)
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:65
Parameters
- const llvm::DataLayout& DL
- std::function<const TargetLibraryInfo&(Function&)> GetTLI
- llvm::LLVMContext& Ctx
¶void addAnalysis(llvm::Function& F,
llvm::AnalysisResultsForFn A)
void addAnalysis(llvm::Function& F,
llvm::AnalysisResultsForFn A)
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:71
Parameters
¶void addArgumentTrackedFunction(llvm::Function* F)
void addArgumentTrackedFunction(llvm::Function* F)
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:99
Parameters
¶void addToMustPreserveReturnsInFunctions(
llvm::Function* F)
void addToMustPreserveReturnsInFunctions(
llvm::Function* F)
Description
Add function to the list of functions whose return cannot be modified.
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:94
Parameters
¶void addTrackedFunction(llvm::Function* F)
void addTrackedFunction(llvm::Function* F)
Description
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.
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:91
Parameters
¶SmallPtrSetImpl<llvm::Function*>&
getArgumentTrackedFunctions()
SmallPtrSetImpl<llvm::Function*>&
getArgumentTrackedFunctions()
Description
Return a reference to the set of argument tracked functions.
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:152
¶llvm::Constant* getConstant(
const llvm::ValueLatticeElement& LV) const
llvm::Constant* getConstant(
const llvm::ValueLatticeElement& LV) const
Description
Helper to return a Constant if \p LV is either a constant or a constant range with a single element.
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:149
Parameters
- const llvm::ValueLatticeElement& LV
¶llvm::DomTreeUpdater getDTU(llvm::Function& F)
llvm::DomTreeUpdater getDTU(llvm::Function& F)
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:80
Parameters
¶const llvm::ValueLatticeElement&
getLatticeValueFor(llvm::Value* V) const
const llvm::ValueLatticeElement&
getLatticeValueFor(llvm::Value* V) const
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:125
Parameters
- llvm::Value* V
¶const SmallPtrSet<llvm::Function*, 16>
getMRVFunctionsTracked()
const SmallPtrSet<llvm::Function*, 16>
getMRVFunctionsTracked()
Description
getMRVFunctionsTracked - Get the set of functions which return multiple values tracked by the pass.
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:136
¶const llvm::PredicateBase* getPredicateInfoFor(
llvm::Instruction* I)
const llvm::PredicateBase* getPredicateInfoFor(
llvm::Instruction* I)
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:78
Parameters
¶std::vector<ValueLatticeElement>
getStructLatticeValueFor(llvm::Value* V) const
std::vector<ValueLatticeElement>
getStructLatticeValueFor(llvm::Value* V) const
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:121
Parameters
- llvm::Value* V
¶const DenseMap<llvm::GlobalVariable*,
llvm::ValueLatticeElement>&
getTrackedGlobals()
const DenseMap<llvm::GlobalVariable*,
llvm::ValueLatticeElement>&
getTrackedGlobals()
Description
getTrackedGlobals - Get and return the set of inferred initializers for global variables.
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:132
¶const MapVector<llvm::Function*,
llvm::ValueLatticeElement>&
getTrackedRetVals()
const MapVector<llvm::Function*,
llvm::ValueLatticeElement>&
getTrackedRetVals()
Description
getTrackedRetVals - Get the inferred return value map.
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:128
¶bool isArgumentTrackedFunction(llvm::Function* F)
bool isArgumentTrackedFunction(llvm::Function* F)
Description
Returns true if the given function is in the solver's set of argument-tracked functions.
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:103
Parameters
¶bool isBlockExecutable(llvm::BasicBlock* BB) const
bool isBlockExecutable(llvm::BasicBlock* BB) const
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:115
Parameters
- llvm::BasicBlock* BB
¶bool isEdgeFeasible(llvm::BasicBlock* From,
llvm::BasicBlock* To) const
bool isEdgeFeasible(llvm::BasicBlock* From,
llvm::BasicBlock* To) const
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:119
Parameters
- llvm::BasicBlock* From
- llvm::BasicBlock* To
¶bool isStructLatticeConstant(
llvm::Function* F,
llvm::StructType* STy)
bool isStructLatticeConstant(
llvm::Function* F,
llvm::StructType* STy)
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:145
Parameters
- llvm::Function* F
- llvm::StructType* STy
¶void markArgInFuncSpecialization(
llvm::Function* F,
const SmallVectorImpl<llvm::ArgInfo>& Args)
void markArgInFuncSpecialization(
llvm::Function* F,
const SmallVectorImpl<llvm::ArgInfo>& Args)
Description
Mark the constant arguments of a new function specialization. \p F points to the cloned function and \p Args contains a list of constant arguments represented as pairs of {formal,actual} values (the formal argument is associated with the original function definition). All other arguments of the specialization inherit the lattice state of their corresponding values in the original function.
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:160
Parameters
- llvm::Function* F
- const SmallVectorImpl<llvm::ArgInfo>& Args
¶bool markBlockExecutable(llvm::BasicBlock* BB)
bool markBlockExecutable(llvm::BasicBlock* BB)
Description
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. This returns true if the block was not considered live before.
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:76
Parameters
- llvm::BasicBlock* BB
¶void markFunctionUnreachable(llvm::Function* F)
void markFunctionUnreachable(llvm::Function* F)
Description
Mark all of the blocks in function \p F non-executable. Clients can used this method to erase a function from the module (e.g., if it has been completely specialized and is no longer needed).
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:166
Parameters
¶void markOverdefined(llvm::Value* V)
void markOverdefined(llvm::Value* V)
Description
markOverdefined - Mark the specified value overdefined. This works with both scalars and structs.
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:140
Parameters
- llvm::Value* V
¶bool mustPreserveReturn(llvm::Function* F)
bool mustPreserveReturn(llvm::Function* F)
Description
Returns true if the return of the given function cannot be modified.
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:97
Parameters
¶void removeLatticeValueFor(llvm::Value* V)
void removeLatticeValueFor(llvm::Value* V)
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:123
Parameters
- llvm::Value* V
¶bool resolvedUndefsIn(llvm::Function& F)
bool resolvedUndefsIn(llvm::Function& F)
Description
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.
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:113
Parameters
¶void solve()
void solve()
Description
Solve - Solve for constants and executable blocks.
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:106
¶void trackValueOfGlobalVariable(
llvm::GlobalVariable* GV)
void trackValueOfGlobalVariable(
llvm::GlobalVariable* GV)
Description
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.
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:86
Parameters
¶void visit(llvm::Instruction* I)
void visit(llvm::Instruction* I)
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:168
Parameters
¶void visitCall(llvm::CallInst& I)
void visitCall(llvm::CallInst& I)
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:169
Parameters
¶~SCCPSolver()
~SCCPSolver()
Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:69