[PATCH] D110466: [llvm-profgen][CSSPGO] On-demand function size computation for preinliner

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 26 21:03:42 PDT 2021


wenlei added inline comments.


================
Comment at: llvm/tools/llvm-profgen/ProfileGenerator.cpp:430
+  if (Binary->getTrackFuncContextSize())
+    computeFuncSizeForSampleHitFunction();
+
----------------
hoy wrote:
> Can this be done when preinliner is enabled?
See ctor of ProfiledBinary, TrackFuncContextSize = EnableCSPreInliner && UseContextCostForPreInliner, 


================
Comment at: llvm/tools/llvm-profgen/ProfileGenerator.cpp:447
+      uint64_t RangeStartOffset = Item.first.first;
+      auto FuncRange = Binary->findFuncOffsetRange(RangeStartOffset);
+      if (FuncRange.second != 0)
----------------
hoy wrote:
> Does this include ranges not executed? Those ranges should also be counted for size calculation.
Yes, not executed range is included by findFuncOffsetRange - that gives the function start, end for the containing top level inliner.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110466



More information about the llvm-commits mailing list