[PATCH] D120335: [llvm-profgen] Generating probe-based non-CS profile.

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 24 11:18:01 PST 2022


hoy added a comment.

In D120335#3339225 <https://reviews.llvm.org/D120335#3339225>, @wlei wrote:

> Thanks for adding support for probe-based non-CS profile.
>
>> 0.5% win for another large benchmark when combined with profi.
>
> is this because with probe, it now have a good support for the unknown(dangling) block, so PROFI can work well for this?

I think so. Profi should help probes more than line-based profile.



================
Comment at: llvm/test/tools/llvm-profgen/inline-pseudoprobe.test:4
+
+; CHECK:     main:88:0
+; CHECK-NEXT: 1: 0
----------------
wlei wrote:
> Out of curiosity, for the text profile, how do we know the profile is a CS nested profile or a non-CS nested profile?
CS nested profile comes with a "shouldInline" attribute for each nested profile, see test/tools/llvm-profdata/cs-sample-nested-profile.test. 


================
Comment at: llvm/tools/llvm-profgen/ProfileGenerator.cpp:444
+  ProbeCounterMap ProbeCounter;
+  extractProbesFromRange(preprocessRangeCounter(RangeCounter), ProbeCounter);
+
----------------
wlei wrote:
> So here we don't use the way like CS-profile to generate the zero-count(in ProfileGenerator.cpp: 981), instead we reuse the `preprocessRangeCounter` to initialize all function range with zero, the probe inside the function will naturally be added with zero count. I guess this is the same to the way of CS-profile, right?
Yes, we are using the non-CS way of reporting zero counted probes. There is a difference between CS and non-CS in that for CS, the non-executed probes are reported for its owner frame only, while for non-CS, such probes are reported for the whole inline nest. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120335



More information about the llvm-commits mailing list