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

Methods

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)

Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:71

Parameters

llvm::Function& F
llvm::AnalysisResultsForFn A

void addArgumentTrackedFunction(llvm::Function* F)

Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:99

Parameters

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

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

llvm::Function* F

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

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)

Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:80

Parameters

llvm::Function& F

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()

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)

Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:78

Parameters

llvm::Instruction* I

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()

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()

Description

getTrackedRetVals - Get the inferred return value map.

Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:128

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

llvm::Function* F

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

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)

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)

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)

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)

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

llvm::Function* F

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)

Description

Returns true if the return of the given function cannot be modified.

Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:97

Parameters

llvm::Function* F

void removeLatticeValueFor(llvm::Value* V)

Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:123

Parameters

llvm::Value* V

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

llvm::Function& F

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)

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

llvm::GlobalVariable* GV

void visit(llvm::Instruction* I)

Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:168

Parameters

llvm::Instruction* I

void visitCall(llvm::CallInst& I)

Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:169

Parameters

llvm::CallInst& I

~SCCPSolver()

Declared at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:69