22template <
typename CallGraphType>
24 const SccTy &SCC, GetProfCountTy GetProfCount, AddCountTy AddCount) {
29 for (
auto &
Node : SCC)
34 for (
const auto &
Node : SCCNodes) {
35 for (
auto &E : children_edges<CallGraphType>(
Node)) {
36 if (SCCNodes.count(CGT::edge_dest(E)))
52 for (
auto &E : SCCEdges) {
53 auto OptProfCount = GetProfCount(E.first, E.second);
56 auto Callee = CGT::edge_dest(E.second);
57 AdditionalCounts[
Callee] += *OptProfCount;
61 for (
auto &Entry : AdditionalCounts)
65 for (
auto &E : NonSCCEdges) {
66 auto OptProfCount = GetProfCount(E.first, E.second);
69 auto Callee = CGT::edge_dest(E.second);
70 AddCount(Callee, *OptProfCount);
82template <
typename CallGraphType>
86 std::vector<SccTy> SCCs;
96 propagateFromSCC(SCC, GetProfCount, AddCount);
This file provides interfaces used to build and manipulate a call graph, which is a very useful tool ...
This file defines the DenseSet and SmallDenseSet classes.
ModuleSummaryIndex.h This file contains the declarations the classes that hold the module index and s...
This builds on the llvm/ADT/GraphTraits.h file to find the strongly connected components (SCCs) of a ...
Implements a dense probed hash-table based set.
reference emplace_back(ArgTypes &&... Args)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Class with methods to propagate synthetic entry counts.
static void propagate(const CallGraphType &CG, GetProfCountTy GetProfCount, AddCountTy AddCount)
Propgate synthetic entry counts on a callgraph CG.
std::pair< iterator, bool > insert(const ValueT &V)
An efficient, type-erasing, non-owning reference to a callable.
This is an optimization pass for GlobalISel generic memory operations.
scc_iterator< T > scc_begin(const T &G)
Construct the begin iterator for a deduced graph type T.
auto reverse(ContainerTy &&C)