LLVM API Documentation

Public Member Functions | Static Public Member Functions | Public Attributes
llvm::CodeMetrics Struct Reference

Utility to calculate the size and a few similar metrics for a set of basic blocks. More...

#include <CodeMetrics.h>

Collaboration diagram for llvm::CodeMetrics:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CodeMetrics ()
void analyzeBasicBlock (const BasicBlock *BB, const TargetTransformInfo &TTI, SmallPtrSetImpl< const Value * > &EphValues)
 Add information about a block to the current state.

Static Public Member Functions

static void collectEphemeralValues (const Loop *L, AssumptionTracker *AT, SmallPtrSetImpl< const Value * > &EphValues)
 Collect a loop's ephemeral values (those used only by an assume or similar intrinsics in the loop).
static void collectEphemeralValues (const Function *L, AssumptionTracker *AT, SmallPtrSetImpl< const Value * > &EphValues)
 Collect a functions's ephemeral values (those used only by an assume or similar intrinsics in the function).

Public Attributes

bool exposesReturnsTwice
 True if this function contains a call to setjmp or other functions with attribute "returns twice" without having the attribute itself.
bool isRecursive
 True if this function calls itself.
bool notDuplicatable
 True if this function cannot be duplicated.
bool usesDynamicAlloca
 True if this function calls alloca (in the C sense).
unsigned NumInsts
 Number of instructions in the analyzed blocks.
unsigned NumBlocks
 Number of analyzed blocks.
DenseMap< const BasicBlock
*, unsigned
NumBBInsts
 Keeps track of basic block code size estimates.
unsigned NumCalls
 Keep track of the number of calls to 'big' functions.
unsigned NumInlineCandidates
 The number of calls to internal functions with a single caller.
unsigned NumVectorInsts
 How many instructions produce vector values.
unsigned NumRets
 How many 'ret' instructions the blocks contain.

Detailed Description

Utility to calculate the size and a few similar metrics for a set of basic blocks.

Definition at line 42 of file CodeMetrics.h.


Constructor & Destructor Documentation

Definition at line 85 of file CodeMetrics.h.


Member Function Documentation

void CodeMetrics::collectEphemeralValues ( const Loop L,
AssumptionTracker AT,
SmallPtrSetImpl< const Value * > &  EphValues 
) [static]
void CodeMetrics::collectEphemeralValues ( const Function L,
AssumptionTracker AT,
SmallPtrSetImpl< const Value * > &  EphValues 
) [static]

Collect a functions's ephemeral values (those used only by an assume or similar intrinsics in the function).

Definition at line 84 of file CodeMetrics.cpp.

References llvm::AssumptionTracker::assumptions(), completeEphemeralValues(), I, and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back().


Member Data Documentation

True if this function contains a call to setjmp or other functions with attribute "returns twice" without having the attribute itself.

Definition at line 45 of file CodeMetrics.h.

True if this function calls itself.

Definition at line 48 of file CodeMetrics.h.

Referenced by analyzeBasicBlock().

True if this function cannot be duplicated.

True if this function contains one or more indirect branches, or it contains one or more 'noduplicate' instructions.

Definition at line 54 of file CodeMetrics.h.

Referenced by analyzeBasicBlock(), and ApproximateLoopSize().

Keeps track of basic block code size estimates.

Definition at line 66 of file CodeMetrics.h.

Referenced by analyzeBasicBlock().

Number of analyzed blocks.

Definition at line 63 of file CodeMetrics.h.

Referenced by analyzeBasicBlock().

Keep track of the number of calls to 'big' functions.

Definition at line 69 of file CodeMetrics.h.

Referenced by analyzeBasicBlock().

The number of calls to internal functions with a single caller.

These are likely targets for future inlining, likely exposed by interleaved devirtualization.

Definition at line 75 of file CodeMetrics.h.

Referenced by analyzeBasicBlock(), and ApproximateLoopSize().

Number of instructions in the analyzed blocks.

Definition at line 60 of file CodeMetrics.h.

Referenced by analyzeBasicBlock(), and ApproximateLoopSize().

How many 'ret' instructions the blocks contain.

Definition at line 83 of file CodeMetrics.h.

Referenced by analyzeBasicBlock().

How many instructions produce vector values.

The inliner is more aggressive with inlining vector kernels.

Definition at line 80 of file CodeMetrics.h.

Referenced by analyzeBasicBlock().

True if this function calls alloca (in the C sense).

Definition at line 57 of file CodeMetrics.h.

Referenced by analyzeBasicBlock().


The documentation for this struct was generated from the following files: