[PATCH] D138893: [llvm-profdata] Use flattening sample profile in profile supplementation

Rong Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 29 14:29:19 PST 2022


xur added inline comments.


================
Comment at: llvm/tools/llvm-profdata/llvm-profdata.cpp:691
+                            &InstrProfileMap](const FunctionSamples &FS,
+                                              const StringRef &RootName) {
+    auto BuildMaxSampleMapImpl = [&](const FunctionSamples &FS,
----------------
davidxl wrote:
> I am not sure if RootName parameter is actually needed here. In the code below, it is either be overwritten (with newroot), or used in cases we don't care -- i.e., function not found in instr profile.
It's used in line 696 (set as the default value) of NewRootName.
If we find the Name is in InstrProfile, it will be overwriteen.

If we don't find the Name, we don't care this function (we treat it as inline function), but we still interested in the max body count and we will update the RootName entry from the parameter. 

In the example, when get the goo's FS, it's max count will used to update bar.c:bar() (this is the RootName).


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

https://reviews.llvm.org/D138893



More information about the llvm-commits mailing list