32 "cost-kind",
cl::desc(
"Target cost kind"),
35 "throughput",
"Reciprocal throughput"),
37 "latency",
"Instruction latency"),
39 "code-size",
"Code size"),
41 "size-latency",
"Code size and latency")));
44 cl::desc(
"Calculate intrinsics cost based only on argument types"),
47#define CM_NAME "cost-model"
48#define DEBUG_TYPE CM_NAME
53 OS <<
"Printing analysis 'Cost Model Analysis' for function '" <<
F.getName() <<
"':\n";
59 auto *
II = dyn_cast<IntrinsicInst>(&Inst);
70 OS <<
"Cost Model: Found an estimated cost of " << *CostVal;
72 OS <<
"Cost Model: Invalid cost";
74 OS <<
" for instruction: " << Inst <<
"\n";
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
#define clEnumValN(ENUMVAL, FLAGNAME, DESC)
static cl::opt< TargetTransformInfo::TargetCostKind > CostKind("cost-kind", cl::desc("Target cost kind"), cl::init(TargetTransformInfo::TCK_RecipThroughput), cl::values(clEnumValN(TargetTransformInfo::TCK_RecipThroughput, "throughput", "Reciprocal throughput"), clEnumValN(TargetTransformInfo::TCK_Latency, "latency", "Instruction latency"), clEnumValN(TargetTransformInfo::TCK_CodeSize, "code-size", "Code size"), clEnumValN(TargetTransformInfo::TCK_SizeAndLatency, "size-latency", "Code size and latency")))
static cl::opt< bool > TypeBasedIntrinsicCost("type-based-intrinsic-cost", cl::desc("Calculate intrinsics cost based only on argument types"), cl::init(false))
uint64_t IntrinsicInst * II
This header defines various interfaces for pass management in LLVM.
A container for analyses that lazily runs them and caches their results.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
LLVM Basic Block Representation.
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
static InstructionCost getInvalid(CostType Val=0)
std::optional< CostType > getValue() const
This function is intended to be used as sparingly as possible, since the class provides the full rang...
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
Analysis pass providing the TargetTransformInfo.
ValuesClass values(OptsTy... Options)
Helper to build a ValuesClass by forwarding a variable number of arguments as an initializer list to ...
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.