[PATCH] D69736: Keep import function list for inlinee profile update

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 1 13:25:00 PDT 2019


wenlei created this revision.
wenlei added reviewers: wmi, davidxl, tejohnson.
Herald added subscribers: llvm-commits, dexonsmith, hiraditya, mehdi_amini.
Herald added a project: LLVM.

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.

Separate but related, we don't need to update/scale profile for callee or cloned inlinee if we decided to inline a callee from sample profile loader with context-sensitive profile. This is fixed by passing a flag through InlineFunctionInfo to tell inliner when not to update profile.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D69736

Files:
  llvm/include/llvm/IR/Function.h
  llvm/include/llvm/Transforms/Utils/Cloning.h
  llvm/lib/IR/Function.cpp
  llvm/lib/Transforms/IPO/SampleProfile.cpp
  llvm/lib/Transforms/Utils/InlineFunction.cpp
  llvm/test/Transforms/SampleProfile/Inputs/inline-callee-update.prof
  llvm/test/Transforms/SampleProfile/inline-callee-update.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69736.227522.patch
Type: text/x-patch
Size: 8269 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191101/b8e7dbfd/attachment.bin>


More information about the llvm-commits mailing list