[PATCH] D28331: Improve PGO support for the new inliner

Easwaran Raman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 4 15:07:10 PST 2017


eraman created this revision.
eraman added reviewers: chandlerc, davidxl.
eraman added a subscriber: llvm-commits.

This adds the following to the new PM based inliner in PGO mode:

- Use block frequency analysis to derive callsite's profile count and use that to adjust thresholds of hot and cold callsites.
- Incrementally update the BFI of the caller after a callee gets inlined into it. This incremental update is only within an invocation of the run method - BFI is not preserved across calls to run.
- Update the function entry count of the callee after inlining it into a caller.

I've tuned the thresholds for the hot and cold callsites using a hacked up version of the old inliner that explicitly computes BFI on a set of internal benchmarks and spec. Once the new PM based pipeline stabilizes (IIRC Chandler mentioned there are known issues) I'll benchmark this again and adjust the thresholds if required.


https://reviews.llvm.org/D28331

Files:
  include/llvm/Analysis/InlineCost.h
  include/llvm/Transforms/Utils/Cloning.h
  lib/Analysis/InlineCost.cpp
  lib/Transforms/IPO/InlineSimple.cpp
  lib/Transforms/IPO/Inliner.cpp
  lib/Transforms/Utils/CloneFunction.cpp
  lib/Transforms/Utils/InlineFunction.cpp
  test/Transforms/Inline/function-count-update-2.ll
  test/Transforms/Inline/function-count-update-3.ll
  test/Transforms/Inline/function-count-update.ll
  test/Transforms/Inline/inline-cold-callsite.ll
  test/Transforms/Inline/inline-hot-callee.ll
  test/Transforms/Inline/inline-hot-callsite-2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28331.83147.patch
Type: text/x-patch
Size: 28257 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170104/1f6d9ed3/attachment.bin>


More information about the llvm-commits mailing list