[PATCH] D147013: [CSSPGO][Preinliner] Trim cold call edges of the profiled call graph for a more stable profile generation.
Wenlei He via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 27 16:51:51 PDT 2023
wenlei added inline comments.
================
Comment at: llvm/include/llvm/Transforms/IPO/ProfiledCallGraph.h:157
+ // Accumulate weight to the existing edge.
+ Edge.Weight += EdgeIt->Weight;
Edges.erase(EdgeIt);
----------------
good catch
================
Comment at: llvm/tools/llvm-profgen/CSPreInliner.cpp:84
+ // profile from run to run.
+ uint64_t ColdCountThreshold = ProfileSummaryBuilder::getColdCountThreshold(
+ (Summary->getDetailedSummary()));
----------------
I understand that you want to do this only for preinliner, not for sample loader in compiler. But the current way of doing this - exposing internals of profiled calll graph only for users to tweak the actual graph, is less than idea as it breaks the abstraction.
Can we have a separate parameter (i.e. hotCallonly) for ctor of ProfiledCallGraph, so this is all self contained? And perhaps slight more efficient as it avoids add and then removal.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D147013/new/
https://reviews.llvm.org/D147013
More information about the llvm-commits
mailing list