[PATCH] D120335: [llvm-profgen] Generating probe-based non-CS profile.
Wenlei He via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 28 23:19:41 PST 2022
wenlei added inline comments.
================
Comment at: llvm/tools/llvm-profgen/ProfileGenerator.cpp:444
+ ProbeCounterMap ProbeCounter;
+ extractProbesFromRange(preprocessRangeCounter(RangeCounter), ProbeCounter);
+
----------------
hoy wrote:
> 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.
Both preprocessRangeCounter and extractProbesFromRange calls findDisjointRanges, which is duplicated.
> 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.
what does the term "owner frame" refer to? can you elaborate the above?
================
Comment at: llvm/tools/llvm-profgen/ProfileGenerator.cpp:497
FunctionProfile->addTotalSamples(Count);
+ if (WithProbe) {
+ const auto *FuncDesc = Binary->getFuncDescForGUID(Function::getGUID(FunctionProfile->getName()));
----------------
Perhaps we don't need a parameter for this, just use `Binary->usePseudoProbes()` instead.
================
Comment at: llvm/tools/llvm-profgen/ProfileGenerator.cpp:901
-void CSProfileGenerator::extractProbesFromRange(const RangeSample &RangeCounter,
+void ProfileGeneratorBase::extractProbesFromRange(const RangeSample &RangeCounter,
ProbeCounterMap &ProbeCounter) {
----------------
nit: move this closer to the functions definitions for ProfileGeneratorBase.
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