Go to the documentation of this file.
14 #ifndef LLVM_TRANSFORMS_UTILS_SCCPSOLVER_H
15 #define LLVM_TRANSFORMS_UTILS_SCCPSOLVER_H
33 class PostDominatorTree;
35 class TargetLibraryInfo;
37 class ValueLatticeElement;
54 class SCCPInstVisitor;
62 std::unique_ptr<SCCPInstVisitor> Visitor;
174 #endif // LLVM_TRANSFORMS_UTILS_SCCPSOLVER_H
This class represents an incoming formal argument to a Function.
This is an optimization pass for GlobalISel generic memory operations.
A parsed version of the target data layout string in and methods for querying it.
Helper struct for bundling up the analysis results per function for IPSCCP.
std::vector< ValueLatticeElement > getStructLatticeValueFor(Value *V) const
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
Constant * getConstant(const ValueLatticeElement &LV) const
Helper to return a Constant if LV is either a constant or a constant range with a single element.
This class implements a map that also provides access to all stored values in a deterministic order.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
bool markBlockExecutable(BasicBlock *BB)
markBlockExecutable - This method can be used by clients to mark all of the blocks that are known to ...
void visit(Instruction *I)
void addArgumentTrackedFunction(Function *F)
void markFunctionUnreachable(Function *F)
Mark all of the blocks in function F non-executable.
LLVM Basic Block Representation.
void markOverdefined(Value *V)
markOverdefined - Mark the specified value overdefined.
bool isArgumentTrackedFunction(Function *F)
Returns true if the given function is in the solver's set of argument-tracked functions.
void addAnalysis(Function &F, AnalysisResultsForFn A)
std::unique_ptr< PredicateInfo > PredInfo
bool isStructLatticeConstant(Function *F, StructType *STy)
const MapVector< Function *, ValueLatticeElement > & getTrackedRetVals()
getTrackedRetVals - Get the inferred return value map.
void visitCall(CallInst &I)
const ValueLatticeElement & getLatticeValueFor(Value *V) const
This is an important base class in LLVM.
ArgInfo(Argument *F, Constant *A)
This is an important class for using LLVM in a threaded context.
const PredicateBase * getPredicateInfoFor(Instruction *I)
SCCPSolver - This interface class is a general purpose solver for Sparse Conditional Constant Propaga...
const DenseMap< GlobalVariable *, ValueLatticeElement > & getTrackedGlobals()
getTrackedGlobals - Get and return the set of inferred initializers for global variables.
@ BasicBlock
Various leaf nodes.
print Print MemDeps of function
DomTreeUpdater getDTU(Function &F)
void markArgInFuncSpecialization(Function *F, const SmallVectorImpl< ArgInfo > &Args)
Mark the constant arguments of a new function specialization.
SCCPSolver(const DataLayout &DL, std::function< const TargetLibraryInfo &(Function &)> GetTLI, LLVMContext &Ctx)
Class to represent struct types.
PostDominatorTree Class - Concrete subclass of DominatorTree that is used to compute the post-dominat...
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
void removeLatticeValueFor(Value *V)
This class represents lattice values for constants.
bool mustPreserveReturn(Function *F)
Returns true if the return of the given function cannot be modified.
Helper struct shared between Function Specialization and SCCP Solver.
bool isBlockExecutable(BasicBlock *BB) const
bool isEdgeFeasible(BasicBlock *From, BasicBlock *To) const
Provides information about what library functions are available for the current target.
bool resolvedUndefsIn(Function &F)
resolvedUndefsIn - While solving the dataflow for a function, we assume that branches on undef values...
void addToMustPreserveReturnsInFunctions(Function *F)
Add function to the list of functions whose return cannot be modified.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void trackValueOfGlobalVariable(GlobalVariable *GV)
trackValueOfGlobalVariable - Clients can use this method to inform the SCCPSolver that it should trac...
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
This class represents a function call, abstracting a target machine's calling convention.
Common register allocation spilling lr str ldr sxth r3 ldr mla r4 can lr mov lr str ldr sxth r3 mla r4 and then merge mul and lr str ldr sxth r3 mla r4 It also increase the likelihood the store may become dead bb27 Successors according to LLVM BB
void solve()
Solve - Solve for constants and executable blocks.
BlockVerifier::State From
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
void addTrackedFunction(Function *F)
addTrackedFunction - If the SCCP solver is supposed to track calls into and out of the specified func...
LLVM Value Representation.
const SmallPtrSet< Function *, 16 > getMRVFunctionsTracked()
getMRVFunctionsTracked - Get the set of functions which return multiple values tracked by the pass.
SmallPtrSetImpl< Function * > & getArgumentTrackedFunctions()
Return a reference to the set of argument tracked functions.