LLVM  16.0.0git
Classes | Public Member Functions | List of all members
llvm::ImportedFunctionsInliningStatistics Class Reference

Calculate and dump ThinLTO specific inliner stats. More...

#include "llvm/Analysis/Utils/ImportedFunctionsInliningStatistics.h"

Public Member Functions

 ImportedFunctionsInliningStatistics ()=default
 ImportedFunctionsInliningStatistics (const ImportedFunctionsInliningStatistics &)=delete
void setModuleInfo (const Module &M)
 Set information like AllFunctions, ImportedFunctions, ModuleName. More...
void recordInline (const Function &Caller, const Function &Callee)
 Record inline of. More...
void dump (bool Verbose)
 Dump stats computed with InlinerStatistics class. More...

Detailed 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

Definition at line 44 of file ImportedFunctionsInliningStatistics.h.

Constructor & Destructor Documentation

◆ ImportedFunctionsInliningStatistics() [1/2]

llvm::ImportedFunctionsInliningStatistics::ImportedFunctionsInliningStatistics ( )

◆ ImportedFunctionsInliningStatistics() [2/2]

llvm::ImportedFunctionsInliningStatistics::ImportedFunctionsInliningStatistics ( const ImportedFunctionsInliningStatistics )

Member Function Documentation

◆ dump()

void ImportedFunctionsInliningStatistics::dump ( bool  Verbose)

Dump stats computed with InlinerStatistics class.


Verboseis true then separate statistics for every inlined function will be printed.

Definition at line 99 of file ImportedFunctionsInliningStatistics.cpp.

References llvm::Verbose.

Referenced by llvm::LegacyInlinerBase::doFinalization().

◆ recordInline()

void ImportedFunctionsInliningStatistics::recordInline ( const Function Caller,
const Function Callee 

Record inline of.

Callerfor statistis.

Definition at line 48 of file ImportedFunctionsInliningStatistics.cpp.

References assert(), Callee, llvm::StringMap< ValueTy, AllocatorTy >::end(), and llvm::StringMap< ValueTy, AllocatorTy >::find().

Referenced by inlineCallIfPossible().

◆ setModuleInfo()

void ImportedFunctionsInliningStatistics::setModuleInfo ( const Module M)

Set information like AllFunctions, ImportedFunctions, ModuleName.

Definition at line 75 of file ImportedFunctionsInliningStatistics.cpp.

References F, int, and M.

Referenced by llvm::LegacyInlinerBase::doInitialization().

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