class ImportedFunctionsInliningStatistics

Declaration

class ImportedFunctionsInliningStatistics { /* full declaration omitted */ };

Description

Calculate and dump ThinLTO specific inliner stats. The main statistics are: (1) Number of inlined imported functions, (2) Number of imported functions inlined into importing module (indirect), (3) Number of non imported functions inlined into importing module (indirect). The difference between first and the second is that first stat counts all performed inlines on imported functions, but the second one only the functions that have been eventually inlined to a function in the importing module (by a chain of inlines). Because llvm uses bottom-up inliner, it is possible to e.g. import function `A`, `B` and then inline `B` to `A`, and after this `A` might be too big to be inlined into some other function that calls it. It calculates this statistic by building graph, where the nodes are functions, and edges are performed inlines and then by marking the edges starting from not imported function. If `Verbose` is set to true, then it also dumps statistics per each inlined function, sorted by the greatest inlines count like - number of performed inlines - number of performed inlines to importing module

Declared at: llvm/include/llvm/Analysis/Utils/ImportedFunctionsInliningStatistics.h:44

Member Variables

private llvm::ImportedFunctionsInliningStatistics:: NodesMapTy NodesMap
This map manage life of all InlineGraphNodes. Unique pointer to InlineGraphNode used since the node pointers are also saved in the InlinedCallees vector. If it would store InlineGraphNode instead then the address of the node would not be invariant.
private std::vector<StringRef> NonImportedCallers
Non external functions that have some other function inlined inside.
private int AllFunctions = 0
private int ImportedFunctions = 0
private llvm::StringRef ModuleName

Method Overview

Methods

ImportedFunctionsInliningStatistics()

Declared at: llvm/include/llvm/Analysis/Utils/ImportedFunctionsInliningStatistics.h:64

ImportedFunctionsInliningStatistics(
    const llvm::
        ImportedFunctionsInliningStatistics&)

Declared at: llvm/include/llvm/Analysis/Utils/ImportedFunctionsInliningStatistics.h:65

Parameters

const llvm::ImportedFunctionsInliningStatistics&

void calculateRealInlines()

Declared at: llvm/include/llvm/Analysis/Utils/ImportedFunctionsInliningStatistics.h:80

llvm::ImportedFunctionsInliningStatistics::
    InlineGraphNode&
    createInlineGraphNode(const llvm::Function&)

Description

Creates new Node in NodeMap and sets attributes, or returns existed one.

Declared at: llvm/include/llvm/Analysis/Utils/ImportedFunctionsInliningStatistics.h:79

Parameters

const llvm::Function&

void dfs(
    llvm::ImportedFunctionsInliningStatistics::
        InlineGraphNode& GraphNode)

Declared at: llvm/include/llvm/Analysis/Utils/ImportedFunctionsInliningStatistics.h:81

Parameters

llvm::ImportedFunctionsInliningStatistics:: InlineGraphNode& GraphNode

void dump(bool Verbose)

Description

Dump stats computed with InlinerStatistics class. If

Declared at: llvm/include/llvm/Analysis/Utils/ImportedFunctionsInliningStatistics.h:75

Parameters

bool Verbose
is true then separate statistics for every inlined function will be printed.

llvm::ImportedFunctionsInliningStatistics::
    SortedNodesTy
    getSortedNodes()

Description

Returns vector of elements sorted by (-NumberOfInlines, -NumberOfRealInlines, FunctionName).

Declared at: llvm/include/llvm/Analysis/Utils/ImportedFunctionsInliningStatistics.h:89

void recordInline(const llvm::Function& Caller,
                  const llvm::Function& Callee)

Description

Record inline of

Declared at: llvm/include/llvm/Analysis/Utils/ImportedFunctionsInliningStatistics.h:71

Parameters

const llvm::Function& Caller
for statistis.
const llvm::Function& Callee
to

void setModuleInfo(const llvm::Module& M)

Description

Set information like AllFunctions, ImportedFunctions, ModuleName.

Declared at: llvm/include/llvm/Analysis/Utils/ImportedFunctionsInliningStatistics.h:69

Parameters

const llvm::Module& M