14#ifndef LLVM_ANALYSIS_CODEMETRICS_H
15#define LLVM_ANALYSIS_CODEMETRICS_H
25template <
class T>
class SmallPtrSetImpl;
26class TargetTransformInfo;
82 bool PrepareForLTO =
false,
const Loop *L =
nullptr);
This file defines the DenseMap class.
This file defines an InstructionCost class that is used when calculating the cost of an instruction,...
A cache of @llvm.assume calls within a function.
LLVM Basic Block Representation.
Represents a single loop in the control flow graph.
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
@ BasicBlock
Various leaf nodes.
This is an optimization pass for GlobalISel generic memory operations.
Utility to calculate the size and a few similar metrics for a set of basic blocks.
bool usesDynamicAlloca
True if this function calls alloca (in the C sense).
unsigned NumBlocks
Number of analyzed blocks.
ConvergenceKind Convergence
The kind of convergence specified in this function.
bool notDuplicatable
True if this function cannot be duplicated.
unsigned NumInlineCandidates
The number of calls to internal functions with a single caller.
bool isRecursive
True if this function calls itself.
static void collectEphemeralValues(const Loop *L, AssumptionCache *AC, SmallPtrSetImpl< const Value * > &EphValues)
Collect a loop's ephemeral values (those used only by an assume or similar intrinsics in the loop).
unsigned NumRets
How many 'ret' instructions the blocks contain.
bool exposesReturnsTwice
True if this function contains a call to setjmp or other functions with attribute "returns twice" wit...
DenseMap< const BasicBlock *, InstructionCost > NumBBInsts
Keeps track of basic block code size estimates.
void analyzeBasicBlock(const BasicBlock *BB, const TargetTransformInfo &TTI, const SmallPtrSetImpl< const Value * > &EphValues, bool PrepareForLTO=false, const Loop *L=nullptr)
Add information about a block to the current state.
unsigned NumCalls
Keep track of the number of calls to 'big' functions.
unsigned NumVectorInsts
How many instructions produce vector values.
InstructionCost NumInsts
Code size cost of the analyzed blocks.