[PATCH] D119494: [CSSPGO] Do not recount callee samples when computing profile summary for nested CS profile.

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 10 18:29:07 PST 2022


wenlei added inline comments.


================
Comment at: llvm/lib/ProfileData/ProfileSummaryBuilder.cpp:124
+  // profiles. This can happen during the generation of CS nested profile.
+  if (!GenCSNestedProfile || !GenerateMergedBaseProfiles)
+    for (const auto &I : FS.getCallsiteSamples())
----------------
We should not have ProfileSummaryBuilder depending on profile generation flags from llvm-profgen. You moved the flags out off llvm-profgen to avoid cyclic dependency, but this is still hacky. 

If we want to this specific behavior of ProfileSummaryBuilder, i.e. whether callee samples should be counted, we can have ProfileSummaryBuilder expose a proper knob for that. 

In this case, maybe we could also consider actually setting a duplicated bit/attribute for those duplicated callee profile, then ProfileSummaryBuilder can naturally skip the duplicated one, which should be equivalent. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119494



More information about the llvm-commits mailing list