Keep import function list for inlinee profile update
authorWenlei He <aktoon@gmail.com>
Fri, 1 Nov 2019 19:57:23 +0000 (12:57 -0700)
committerWenlei He <aktoon@gmail.com>
Thu, 7 Nov 2019 02:36:00 +0000 (18:36 -0800)
commitba1dfae054b4c9a8b11aabd62fd0dcb792366206
treeb0f13b3c633b816bb59557d33ab0a01cef9478f5
parente55b536d7d810393f0a03c800e8263d83926090c
Keep import function list for inlinee profile update

Summary:
When adjusting function entry counts after inlining, Funciton::setEntryCount is called without providing an import function list. The side effect of that is the previously set import function list will be dropped. The import function list is used by ThinLTO to help import hot cross module callee for LTO inlining, so dropping that during ThinLTO pre-link may adversely affect LTO inlining. The fix is to keep the list while updating entry counts for inlining.

Reviewers: wmi, davidxl, tejohnson

Subscribers: mehdi_amini, hiraditya, dexonsmith, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69736
llvm/lib/IR/Function.cpp
llvm/lib/Transforms/Utils/InlineFunction.cpp
llvm/test/Transforms/SampleProfile/Inputs/inline-callee-update.prof [new file with mode: 0644]
llvm/test/Transforms/SampleProfile/inline-callee-update.ll [new file with mode: 0644]