LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
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]

Public Member Functions

 CodeMetrics ()
 
void analyzeBasicBlock (const BasicBlock *BB, const TargetTransformInfo &TTI)
 Add information about a block to the current state. More...
 

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. More...
 
bool isRecursive
 True if this function calls itself. More...
 
bool notDuplicatable
 True if this function cannot be duplicated. More...
 
bool usesDynamicAlloca
 True if this function calls alloca (in the C sense). More...
 
unsigned NumInsts
 Number of instructions in the analyzed blocks. More...
 
unsigned NumBlocks
 Number of analyzed blocks. More...
 
DenseMap< const BasicBlock
*, unsigned
NumBBInsts
 Keeps track of basic block code size estimates. More...
 
unsigned NumCalls
 Keep track of the number of calls to 'big' functions. More...
 
unsigned NumInlineCandidates
 The number of calls to internal functions with a single caller. More...
 
unsigned NumVectorInsts
 How many instructions produce vector values. More...
 
unsigned NumRets
 How many 'ret' instructions the blocks contain. More...
 

Detailed Description

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

Definition at line 39 of file CodeMetrics.h.

Constructor & Destructor Documentation

llvm::CodeMetrics::CodeMetrics ( )
inline

Definition at line 82 of file CodeMetrics.h.

Member Function Documentation

void CodeMetrics::analyzeBasicBlock ( const BasicBlock BB,
const TargetTransformInfo TTI 
)

Member Data Documentation

bool llvm::CodeMetrics::exposesReturnsTwice

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

Definition at line 42 of file CodeMetrics.h.

bool llvm::CodeMetrics::isRecursive

True if this function calls itself.

Definition at line 45 of file CodeMetrics.h.

Referenced by analyzeBasicBlock().

bool llvm::CodeMetrics::notDuplicatable

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 51 of file CodeMetrics.h.

Referenced by analyzeBasicBlock(), and ApproximateLoopSize().

DenseMap<const BasicBlock *, unsigned> llvm::CodeMetrics::NumBBInsts

Keeps track of basic block code size estimates.

Definition at line 63 of file CodeMetrics.h.

Referenced by analyzeBasicBlock().

unsigned llvm::CodeMetrics::NumBlocks

Number of analyzed blocks.

Definition at line 60 of file CodeMetrics.h.

Referenced by analyzeBasicBlock().

unsigned llvm::CodeMetrics::NumCalls

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

Definition at line 66 of file CodeMetrics.h.

Referenced by analyzeBasicBlock().

unsigned llvm::CodeMetrics::NumInlineCandidates

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 72 of file CodeMetrics.h.

Referenced by analyzeBasicBlock(), and ApproximateLoopSize().

unsigned llvm::CodeMetrics::NumInsts

Number of instructions in the analyzed blocks.

Definition at line 57 of file CodeMetrics.h.

Referenced by analyzeBasicBlock(), and ApproximateLoopSize().

unsigned llvm::CodeMetrics::NumRets

How many 'ret' instructions the blocks contain.

Definition at line 80 of file CodeMetrics.h.

Referenced by analyzeBasicBlock().

unsigned llvm::CodeMetrics::NumVectorInsts

How many instructions produce vector values.

The inliner is more aggressive with inlining vector kernels.

Definition at line 77 of file CodeMetrics.h.

Referenced by analyzeBasicBlock().

bool llvm::CodeMetrics::usesDynamicAlloca

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

Definition at line 54 of file CodeMetrics.h.

Referenced by analyzeBasicBlock().


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