[PATCH] D108180: [CSSPGO] Track and use context-sensitive post-optimization function size to drive global pre-inliner in llvm-profgen

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 17 10:07:19 PDT 2021


wenlei added inline comments.


================
Comment at: llvm/tools/llvm-profgen/ProfiledBinary.cpp:55
 
+void BinarySizeContextTracker::addInstructionForContext(
+    const FrameLocationStack &Context, uint32_t InstrSize) {
----------------
wmi wrote:
> The function size computed for a certain context doesn't include the size of any function inlined into it. This matches well with top-down inline in sample loader, but may not match well with cgscc inliner. I forget how much inlining is done by the inliner in sample loader and how much is done by cgscc inliner for CSSPGO. Is it a problem right now?  
It's difficult for sample loader to capture all inlining since cgscc inliner uses difference heuristic, but most of the hot inlining should be done in sample loader. The size here is used for global top-down pre-inlining in llvm-profgen which would guide sample loader inlining. cgscc inliner will still be able to use context-less profile and current heuristic to estimate cost/benefit without being affected by what we're doing here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108180/new/

https://reviews.llvm.org/D108180



More information about the llvm-commits mailing list