LLVM 17.0.0git
|
#include "llvm/Transforms/IPO/FunctionSpecialization.h"
Public Member Functions | |
FunctionSpecializer (SCCPSolver &Solver, Module &M, FunctionAnalysisManager *FAM, std::function< BlockFrequencyInfo &(Function &)> GetBFI, std::function< const TargetLibraryInfo &(Function &)> GetTLI, std::function< TargetTransformInfo &(Function &)> GetTTI, std::function< AssumptionCache &(Function &)> GetAC) | |
~FunctionSpecializer () | |
bool | isClonedFunction (Function *F) |
bool | run () |
Attempt to specialize functions in the module to enable constant propagation across function boundaries. | |
InstCostVisitor | getInstCostVisitorFor (Function *F) |
Cost | getSpecializationBonus (Argument *A, Constant *C, InstCostVisitor &Visitor) |
Compute a bonus for replacing argument A with constant C . | |
Static Public Member Functions | |
static unsigned | getBlockFreqMultiplier () |
Definition at line 155 of file FunctionSpecialization.h.
|
inline |
Definition at line 176 of file FunctionSpecialization.h.
References FAM.
FunctionSpecializer::~FunctionSpecializer | ( | ) |
Definition at line 474 of file FunctionSpecialization.cpp.
References llvm::dbgs(), and LLVM_DEBUG.
|
static |
Definition at line 112 of file FunctionSpecialization.cpp.
References BlockFreqMultiplier.
|
inline |
Definition at line 193 of file FunctionSpecialization.h.
References F.
Cost FunctionSpecializer::getSpecializationBonus | ( | Argument * | A, |
Constant * | C, | ||
InstCostVisitor & | Visitor | ||
) |
Compute a bonus for replacing argument A
with constant C
.
Definition at line 830 of file FunctionSpecialization.cpp.
References A, llvm::CallingConv::C, llvm::dbgs(), llvm::InlineCost::getCostDelta(), llvm::Function::getFunctionType(), llvm::getInlineCost(), llvm::getInlineParams(), llvm::InstCostVisitor::getUserBonus(), llvm::InlineConstants::IndirectCallThreshold, llvm::InlineCost::isAlways(), llvm::SCCPSolver::isBlockExecutable(), llvm::InlineCost::isVariable(), and LLVM_DEBUG.
bool FunctionSpecializer::run | ( | ) |
Attempt to specialize functions in the module to enable constant propagation across function boundaries.
Definition at line 488 of file FunctionSpecialization.cpp.
References Arg, llvm::SpecSig::Args, assert(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::Spec::CallSites, llvm::Spec::Clone, llvm::dbgs(), llvm::SmallVectorTemplateCommon< T, typename >::end(), End, llvm::Spec::F, F, llvm::Value::getName(), llvm::SCCPSolver::getTrackedRetVals(), I, llvm::SCCPSolver::isOverdefined(), llvm::SCCPSolver::isStructLatticeConstant(), llvm::InstructionCost::isValid(), LLVM_DEBUG, MaxClones, N, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SCCPSolver::resetLatticeValueFor(), llvm::Spec::Score, llvm::Spec::Sig, llvm::SmallVectorBase< Size_T >::size(), llvm::SCCPSolver::solveWhileResolvedUndefs(), and llvm::SCCPSolver::solveWhileResolvedUndefsIn().
Referenced by runIPSCCP().