26 template <
typename CallGraphType>
28 const SccTy &SCC, GetProfCountTy GetProfCount, AddCountTy AddCount) {
33 for (
auto &Node : SCC)
38 for (
const auto &Node : SCCNodes) {
39 for (
auto &
E : children_edges<CallGraphType>(Node)) {
40 if (SCCNodes.count(CGT::edge_dest(
E)))
56 for (
auto &
E : SCCEdges) {
57 auto OptProfCount = GetProfCount(
E.first,
E.second);
60 auto Callee = CGT::edge_dest(
E.second);
61 AdditionalCounts[
Callee] += OptProfCount.getValue();
65 for (
auto &
Entry : AdditionalCounts)
69 for (
auto &
E : NonSCCEdges) {
70 auto OptProfCount = GetProfCount(
E.first,
E.second);
73 auto Callee = CGT::edge_dest(
E.second);
74 AddCount(Callee, OptProfCount.getValue());
86 template <
typename CallGraphType>
90 std::vector<SccTy> SCCs;
100 propagateFromSCC(SCC, GetProfCount, AddCount);
This builds on the llvm/ADT/GraphTraits.h file to find the strongly connected components (SCCs) of a ...
reference emplace_back(ArgTypes &&... Args)
This class represents lattice values for constants.
Implements a dense probed hash-table based set.
An efficient, type-erasing, non-owning reference to a callable.
scc_iterator< T > scc_begin(const T &G)
Construct the begin iterator for a deduced graph type T.
auto reverse(ContainerTy &&C, typename std::enable_if< has_rbegin< ContainerTy >::value >::type *=nullptr) -> decltype(make_range(C.rbegin(), C.rend()))
This file provides interfaces used to build and manipulate a call graph, which is a very useful tool ...
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
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)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
amdgpu Simplify well known AMD library false FunctionCallee Callee
ModuleSummaryIndex.h This file contains the declarations the classes that hold the module index and s...
Class with methods to propagate synthetic entry counts.