[InlineAdvisor] Add -inline-replay-scope=<Function|Module> to control replay scope
authormodimo <modimo@fb.com>
Mon, 18 Oct 2021 20:08:13 +0000 (13:08 -0700)
committermodimo <modimo@fb.com>
Mon, 18 Oct 2021 20:08:39 +0000 (13:08 -0700)
commit313c657fcea371a533ad5f3adcff44fabc6531ae
tree04505bb2ae4a88cdd9c302b78e7cf4b69bb95b52
parenta229a4aa6418bf34678a32f368324ae2c47051b7
[InlineAdvisor] Add -inline-replay-scope=<Function|Module> to control replay scope

The goal is to allow grafting an inline tree from Clang or GCC into a new compilation without affecting other functions. For GCC, we're doing this by extracting the inline tree from dwarf information and generating the equivalent remarks.

This allows easier side-by-side asm analysis and a trial way to see if a particular inlining setup provides benefits by itself.

Testing:
ninja check-all

Reviewed By: wenlei, mtrofin

Differential Revision: https://reviews.llvm.org/D110658
12 files changed:
llvm/include/llvm/Analysis/InlineAdvisor.h
llvm/include/llvm/Analysis/ReplayInlineAdvisor.h
llvm/include/llvm/Transforms/IPO/Inliner.h
llvm/lib/Analysis/InlineAdvisor.cpp
llvm/lib/Analysis/ReplayInlineAdvisor.cpp
llvm/lib/Transforms/IPO/Inliner.cpp
llvm/lib/Transforms/IPO/SampleProfile.cpp
llvm/test/Transforms/Inline/cgscc-inline-replay.ll
llvm/test/Transforms/SampleProfile/Inputs/inline-replay-function-scope.txt [new file with mode: 0644]
llvm/test/Transforms/SampleProfile/Inputs/inline-replay.txt
llvm/test/Transforms/SampleProfile/Inputs/inline-topdown-inline-all.prof [new file with mode: 0644]
llvm/test/Transforms/SampleProfile/inline-replay.ll