[PATCH] D121643: [llvm-profgen] On-demand pseudo probe decoding
Lei Wang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 22 18:33:34 PDT 2022
wlei added inline comments.
================
Comment at: llvm/tools/llvm-profgen/ProfileGenerator.cpp:374
+void ProfileGeneratorBase::collectProfiledFunctions() {
+ std::unordered_set<const BinaryFunction *> ProfiledFunctions;
----------------
wlei wrote:
> For CS profile, the input contains CallStack + LBRStack, but here it only considers the addresses from LBRStack(Range + Branch) to compute profiledFunctions. Does it miss some functions whose address(frame) is only from CallStack?
>
> For example, if we only have one following entry:
> [main @ foo] : {rangeFrom : rangeTo}
>
> Supposing rangeFrom and rangeTo only belong to `foo`(foo is not inlined to main), then the result of ProfiledFunctions only contains `foo` and misses `main`, right?
>
> From the term "ProfiledFunctions", it should be `foo`, but for CS inlining, I guess we still need the frame `main`?
>
Sorry, I missed your notes on the summary.
> "Note that in on-demand mode, a calling context may be truncated at a caller which does not have sample. This is a discrepancy from the complete mode. However, with the CS preinliner such context will always be truncated from the compiler inlining point of view."
So in on-demand mode, it will implicitly trim some contexts, even before CS-preinliner or cold-context-trimming.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121643/new/
https://reviews.llvm.org/D121643
More information about the llvm-commits
mailing list