LLVM 17.0.0git
|
#include "llvm/Transforms/IPO/FunctionSpecialization.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/CodeMetrics.h"
#include "llvm/Analysis/ConstantFolding.h"
#include "llvm/Analysis/InlineCost.h"
#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/Analysis/ValueLattice.h"
#include "llvm/Analysis/ValueLatticeUtils.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/ConstantFold.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/Transforms/Scalar/SCCP.h"
#include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/Transforms/Utils/SCCPSolver.h"
#include "llvm/Transforms/Utils/SizeOpts.h"
#include <cmath>
Go to the source code of this file.
Classes | |
struct | llvm::DenseMapInfo< SpecSig > |
Macros | |
#define | DEBUG_TYPE "function-specialization" |
Functions | |
STATISTIC (NumSpecsCreated, "Number of specializations created") | |
static Cost | estimateBasicBlocks (SmallVectorImpl< BasicBlock * > &WorkList, ConstMap &KnownConstants, SCCPSolver &Solver, BlockFrequencyInfo &BFI, TargetTransformInfo &TTI) |
static Constant * | findConstantFor (Value *V, ConstMap &KnownConstants) |
static void | removeSSACopy (Function &F) |
static Function * | cloneCandidateFunction (Function *F) |
Clone the function F and remove the ssa_copy intrinsics added by the SCCPSolver in the cloned version. | |
Variables | |
static cl::opt< bool > | ForceSpecialization ("force-specialization", cl::init(false), cl::Hidden, cl::desc("Force function specialization for every call site with a constant " "argument")) |
static cl::opt< unsigned > | BlockFreqMultiplier ("funcspec-block-freq-multiplier", cl::init(8), cl::Hidden, cl::desc("Multiplier to scale block frequency of user instructions during " "specialization bonus estimation")) |
static cl::opt< unsigned > | MinEntryFreq ("funcspec-min-entry-freq", cl::init(450), cl::Hidden, cl::desc("Do not specialize functions with entry block frequency lower than " "this value")) |
static cl::opt< unsigned > | MinScore ("funcspec-min-score", cl::init(2), cl::Hidden, cl::desc("Do not specialize functions with score lower than this value " "(the ratio of specialization bonus over specialization cost)")) |
static cl::opt< unsigned > | MaxClones ("funcspec-max-clones", cl::init(3), cl::Hidden, cl::desc("The maximum number of clones allowed for a single function " "specialization")) |
static cl::opt< unsigned > | MinFunctionSize ("funcspec-min-function-size", cl::init(100), cl::Hidden, cl::desc("Don't specialize functions that have less than this number of " "instructions")) |
static cl::opt< bool > | SpecializeOnAddress ("funcspec-on-address", cl::init(false), cl::Hidden, cl::desc("Enable function specialization on the address of global values")) |
static cl::opt< bool > | SpecializeLiteralConstant ("funcspec-for-literal-constant", cl::init(true), cl::Hidden, cl::desc("Enable specialization of functions that take a literal constant as an " "argument")) |
#define DEBUG_TYPE "function-specialization" |
Definition at line 68 of file FunctionSpecialization.cpp.
Clone the function F
and remove the ssa_copy intrinsics added by the SCCPSolver in the cloned version.
Definition at line 646 of file FunctionSpecialization.cpp.
References llvm::CloneFunction(), F, and removeSSACopy().
|
static |
Definition at line 123 of file FunctionSpecialization.cpp.
References BlockFreqMultiplier, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::contains(), llvm::dbgs(), llvm::SmallVectorBase< Size_T >::empty(), llvm::TargetTransformInfo::getInstructionCost(), I, llvm::SCCPSolver::isBlockExecutable(), LLVM_DEBUG, llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::successors(), and llvm::TargetTransformInfo::TCK_SizeAndLatency.
Definition at line 165 of file FunctionSpecialization.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find().
|
static |
Definition at line 439 of file FunctionSpecialization.cpp.
References F, and llvm::make_early_inc_range().
Referenced by cloneCandidateFunction().
STATISTIC | ( | NumSpecsCreated | , |
"Number of specializations created" | |||
) |
|
static |
|
static |
|
static |
Referenced by llvm::FunctionSpecializer::run().
|
static |
|
static |
|
static |
|
static |
|
static |