[NPM][Inliner] Factor ImportedFunctionStats in the InlineAdvisor
authorMircea Trofin <mtrofin@google.com>
Tue, 19 Jan 2021 18:05:25 +0000 (10:05 -0800)
committerMircea Trofin <mtrofin@google.com>
Wed, 20 Jan 2021 19:07:36 +0000 (11:07 -0800)
commite8aec763a57e211420dfceb2a8dc6b88574924f3
tree37b6a614426f02e539e0a8b14e29964477224fe9
parenta51226057fc30510ac86b32a36a9769ddbf4c318
[NPM][Inliner] Factor ImportedFunctionStats in the InlineAdvisor

When using 2 InlinePass instances in the same CGSCC - one for other
mandatory inlinings, the other for the heuristic-driven ones - the order
in which the ImportedFunctionStats would be output-ed would depend on
the destruction order of the inline passes, which is not deterministic.

This patch moves the ImportedFunctionStats responsibility to the
InlineAdvisor to address this problem.

Differential Revision: https://reviews.llvm.org/D94982
12 files changed:
llvm/include/llvm/Analysis/InlineAdvisor.h
llvm/include/llvm/Analysis/MLInlineAdvisor.h
llvm/include/llvm/Analysis/ReplayInlineAdvisor.h
llvm/include/llvm/Transforms/IPO/Inliner.h
llvm/include/llvm/Transforms/Utils/ImportedFunctionsInliningStatistics.h
llvm/lib/Analysis/InlineAdvisor.cpp
llvm/lib/Analysis/MLInlineAdvisor.cpp
llvm/lib/Analysis/ReplayInlineAdvisor.cpp
llvm/lib/Transforms/IPO/Inliner.cpp
llvm/lib/Transforms/IPO/SampleProfile.cpp
llvm/lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp
llvm/test/Transforms/Inline/inline_stats.ll