[CSSPGO][PriorityInliner] Do not use block weight to drive callsite inlining.
authorHongtao Yu <hoy@fb.com>
Sun, 27 Feb 2022 19:40:11 +0000 (11:40 -0800)
committerHongtao Yu <hoy@fb.com>
Wed, 2 Mar 2022 02:43:19 +0000 (18:43 -0800)
commit07846e3387a6aa323d28c79ff055f1ad5622386c
treef3eb8db2a03ea3411d315f2793b8f172cafbe1af
parentc007a17af616c9f6f62f71b8ae765241d0fec32f
[CSSPGO][PriorityInliner] Do not use block weight to drive callsite inlining.

The priority-based inliner currenlty uses block count combined with callee entry count to drive callsite inlining. This doesn't work well with LTO where postlink inlining is driven by prelink-annotated block count which could be based on the merge of all context profiles. I'm fixing it by using callee profile entry count only which should be context-sensitive.

I'm seeing 0.2% perf improvment for one of our internal large benchmarks with probe-based non-CS profile.

Reviewed By: wenlei

Differential Revision: https://reviews.llvm.org/D120784
llvm/lib/Transforms/IPO/SampleProfile.cpp
llvm/test/Transforms/SampleProfile/Inputs/profile-context-order-scc.prof
llvm/test/Transforms/SampleProfile/Inputs/profile-context-order.prof
llvm/test/Transforms/SampleProfile/csspgo-inline-icall.ll
llvm/test/Transforms/SampleProfile/csspgo-inline.ll