[PATCH] D122609: [llvm-profgen] An option to update callsite body samples by summing up all call target samples.

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 28 12:05:31 PDT 2022


hoy created this revision.
Herald added subscribers: modimo, wenlei.
Herald added a project: All.
hoy requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Current profile generation caculcates callsite body samples and call target samples separately. The former is done based on LBR range samples while the latter is done based on branch samples. Note that there's a subtle difference. LBR ranges is formed from two consecutive branch samples. Therefore the last entry in a LBR record will not be counted towards body samples while there's still a chance for it to be counted towards call targets if it is a function call. I'm making sense of the call body samples by updating it to the aggregation of call targets.

Given that other profie generators have more-or-less the same behavior, I'm making the change off by default. The work is useful when we need a strictly right profile, i.e, when doing a round-trip conversion between CS and non-CS profiles.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D122609

Files:
  llvm/include/llvm/ProfileData/SampleProf.h
  llvm/test/tools/llvm-profgen/update-samples.test
  llvm/tools/llvm-profgen/ProfileGenerator.cpp
  llvm/tools/llvm-profgen/ProfileGenerator.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122609.418672.patch
Type: text/x-patch
Size: 5918 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220328/a0a3129c/attachment.bin>


More information about the llvm-commits mailing list