struct CodeMetrics
Declaration
struct CodeMetrics { /* full declaration omitted */ };
Description
Utility to calculate the size and a few similar metrics for a set of basic blocks.
Declared at: llvm/include/llvm/Analysis/CodeMetrics.h:32
Member Variables
- public bool exposesReturnsTwice = false
- True if this function contains a call to setjmp or other functions with attribute "returns twice" without having the attribute itself.
- public bool isRecursive = false
- True if this function calls itself.
- public bool notDuplicatable = false
- True if this function contains one or more indirect branches, or it contains one or more 'noduplicate' instructions.
- public bool convergent = false
- True if this function contains a call to a convergent function.
- public bool usesDynamicAlloca = false
- True if this function calls alloca (in the C sense).
- public unsigned int NumInsts = false
- Number of instructions in the analyzed blocks.
- public unsigned int NumBlocks = false
- Number of analyzed blocks.
- public DenseMap<const llvm::BasicBlock*, unsigned int> NumBBInsts
- Keeps track of basic block code size estimates.
- public unsigned int NumCalls = false
- Keep track of the number of calls to 'big' functions.
- public unsigned int NumInlineCandidates = 0
- These are likely targets for future inlining, likely exposed by interleaved devirtualization.
- public unsigned int NumVectorInsts = 0
- The inliner is more aggressive with inlining vector kernels.
- public unsigned int NumRets = 0
- How many 'ret' instructions the blocks contain.
Method Overview
- public void analyzeBasicBlock(const llvm::BasicBlock * BB, const llvm::TargetTransformInfo & TTI, const SmallPtrSetImpl<const llvm::Value *> & EphValues)
- public static void collectEphemeralValues(const llvm::Loop * L, llvm::AssumptionCache * AC, SmallPtrSetImpl<const llvm::Value *> & EphValues)
- public static void collectEphemeralValues(const llvm::Function * L, llvm::AssumptionCache * AC, SmallPtrSetImpl<const llvm::Value *> & EphValues)
Methods
¶void analyzeBasicBlock(
const llvm::BasicBlock* BB,
const llvm::TargetTransformInfo& TTI,
const SmallPtrSetImpl<const llvm::Value*>&
EphValues)
void analyzeBasicBlock(
const llvm::BasicBlock* BB,
const llvm::TargetTransformInfo& TTI,
const SmallPtrSetImpl<const llvm::Value*>&
EphValues)
Description
Add information about a block to the current state.
Declared at: llvm/include/llvm/Analysis/CodeMetrics.h:79
Parameters
- const llvm::BasicBlock* BB
- const llvm::TargetTransformInfo& TTI
- const SmallPtrSetImpl<const llvm::Value*>& EphValues
¶static void collectEphemeralValues(
const llvm::Loop* L,
llvm::AssumptionCache* AC,
SmallPtrSetImpl<const llvm::Value*>&
EphValues)
static void collectEphemeralValues(
const llvm::Loop* L,
llvm::AssumptionCache* AC,
SmallPtrSetImpl<const llvm::Value*>&
EphValues)
Description
Collect a loop's ephemeral values (those used only by an assume or similar intrinsics in the loop).
Declared at: llvm/include/llvm/Analysis/CodeMetrics.h:84
Parameters
- const llvm::Loop* L
- llvm::AssumptionCache* AC
- SmallPtrSetImpl<const llvm::Value*>& EphValues
¶static void collectEphemeralValues(
const llvm::Function* L,
llvm::AssumptionCache* AC,
SmallPtrSetImpl<const llvm::Value*>&
EphValues)
static void collectEphemeralValues(
const llvm::Function* L,
llvm::AssumptionCache* AC,
SmallPtrSetImpl<const llvm::Value*>&
EphValues)
Description
Collect a functions's ephemeral values (those used only by an assume or similar intrinsics in the function).
Declared at: llvm/include/llvm/Analysis/CodeMetrics.h:89
Parameters
- const llvm::Function* L
- llvm::AssumptionCache* AC
- SmallPtrSetImpl<const llvm::Value*>& EphValues