[PATCH] D121651: [llvm-profdata] Convert nested profile to CS flat profile.

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 8 12:33:49 PDT 2022


hoy added inline comments.


================
Comment at: llvm/tools/llvm-profdata/llvm-profdata.cpp:831
+
+  if (ProfileIsCS && ProfileLayout == llvm::sampleprof::SPL_Nest) {
     CSProfileConverter CSConverter(ProfileMap);
----------------
wenlei wrote:
> The boolean conversion seem to point to hasValue? I think the convention is mostly `*ProfileIsCS`.
> 
> > constexpr explicit operator bool() const { return hasValue(); } 
Here `ProfileLayout` is a function parameter of type `SampleProfileLayout` . 


================
Comment at: llvm/tools/llvm-profdata/llvm-profdata.cpp:1027
       cl::desc("Path to binary from which the profile was collected."));
+  cl::opt<SampleProfileLayout> ProfileLayout(
+      "sample-profile-layout", cl::desc("Convert the generated profile to"),
----------------
wenlei wrote:
> nit: name this `convert-sample-profile-layout`. otherwise having `SPL_None` as default can be confusing as there's no None layout. But it makes sense for conversion to be None.
Sounds good.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121651



More information about the llvm-commits mailing list