[CSSPGO] Factor out common part for CSSPGO inline and AFDO inline
authorWenlei He <aktoon@gmail.com>
Wed, 20 Jan 2021 07:29:14 +0000 (23:29 -0800)
committerWenlei He <aktoon@gmail.com>
Tue, 2 Feb 2021 08:34:06 +0000 (00:34 -0800)
commit9a03058d6322edb8abc803ba3e436cc62647d979
tree973bab7f6ac9527d7191bf85e190d516f58404b0
parent677a3529d3e65f687155218cb318726906bdccf2
[CSSPGO] Factor out common part for CSSPGO inline and AFDO inline

Refactoring SampleProfileLoader::inlineHotFunctions to use helpers from CSSPGO inlining and reduce similar code in the inlining loop, plus minor cleanup for AFDO path.

Test Plan:

Differential Revision: https://reviews.llvm.org/D95024
llvm/lib/Transforms/IPO/SampleProfile.cpp
llvm/test/Transforms/SampleProfile/pseudo-probe-inline.ll
llvm/test/Transforms/SampleProfile/remarks.ll