OSDN Git Service

Added ThinLTO inlining statistics
authorPiotr Padlewski <piotr.padlewski@gmail.com>
Fri, 29 Jul 2016 00:27:16 +0000 (00:27 +0000)
committerPiotr Padlewski <piotr.padlewski@gmail.com>
Fri, 29 Jul 2016 00:27:16 +0000 (00:27 +0000)
commitd7e3771d59db368019d8341e590b2a4044001323
tree8486896014e14f083a517346a58bff97109354a7
parent24dbd38b83dc2277afcd7c3bf91b2aaecc81ef66
Added ThinLTO inlining statistics

Summary:
copypasta doc of ImportedFunctionsInliningStatistics class
 \brief 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

Reviewers: eraman, tejohnson, mehdi_amini

Subscribers: mehdi_amini, llvm-commits

Differential Revision: https://reviews.llvm.org/D22491

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277089 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/IPO/InlinerPass.h
include/llvm/Transforms/Utils/ImportedFunctionsInliningStatistics.h [new file with mode: 0644]
lib/Transforms/IPO/Inliner.cpp
lib/Transforms/Utils/CMakeLists.txt
lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp [new file with mode: 0644]
test/Transforms/Inline/inline_stats.ll [new file with mode: 0644]