LLVM  8.0.0svn
Public Types | Static Public Member Functions | List of all members
llvm::SyntheticCountsUtils< CallGraphType > Class Template Reference

Class with methods to propagate synthetic entry counts. More...

#include "llvm/Analysis/SyntheticCountsUtils.h"

Public Types

using Scaled64 = ScaledNumber< uint64_t >
 
using CGT = GraphTraits< CallGraphType >
 
using NodeRef = typename CGT::NodeRef
 
using EdgeRef = typename CGT::EdgeRef
 
using SccTy = std::vector< NodeRef >
 
using GetRelBBFreqTy = function_ref< Optional< Scaled64 >(EdgeRef)>
 
using GetCountTy = function_ref< uint64_t(NodeRef)>
 
using AddCountTy = function_ref< void(NodeRef, uint64_t)>
 

Static Public Member Functions

static void propagate (const CallGraphType &CG, GetRelBBFreqTy GetRelBBFreq, GetCountTy GetCount, AddCountTy AddCount)
 Propgate synthetic entry counts on a callgraph CG. More...
 

Detailed Description

template<typename CallGraphType>
class llvm::SyntheticCountsUtils< CallGraphType >

Class with methods to propagate synthetic entry counts.

This class is templated on the type of the call graph and designed to work with the traditional per-module callgraph and the summary callgraphs used in ThinLTO. This contains only static methods and alias templates.

Definition at line 31 of file SyntheticCountsUtils.h.

Member Typedef Documentation

◆ AddCountTy

template<typename CallGraphType >
using llvm::SyntheticCountsUtils< CallGraphType >::AddCountTy = function_ref<void(NodeRef, uint64_t)>

Definition at line 41 of file SyntheticCountsUtils.h.

◆ CGT

template<typename CallGraphType >
using llvm::SyntheticCountsUtils< CallGraphType >::CGT = GraphTraits<CallGraphType>

Definition at line 34 of file SyntheticCountsUtils.h.

◆ EdgeRef

template<typename CallGraphType >
using llvm::SyntheticCountsUtils< CallGraphType >::EdgeRef = typename CGT::EdgeRef

Definition at line 36 of file SyntheticCountsUtils.h.

◆ GetCountTy

template<typename CallGraphType >
using llvm::SyntheticCountsUtils< CallGraphType >::GetCountTy = function_ref<uint64_t(NodeRef)>

Definition at line 40 of file SyntheticCountsUtils.h.

◆ GetRelBBFreqTy

template<typename CallGraphType >
using llvm::SyntheticCountsUtils< CallGraphType >::GetRelBBFreqTy = function_ref<Optional<Scaled64>(EdgeRef)>

Definition at line 39 of file SyntheticCountsUtils.h.

◆ NodeRef

template<typename CallGraphType >
using llvm::SyntheticCountsUtils< CallGraphType >::NodeRef = typename CGT::NodeRef

Definition at line 35 of file SyntheticCountsUtils.h.

◆ Scaled64

template<typename CallGraphType >
using llvm::SyntheticCountsUtils< CallGraphType >::Scaled64 = ScaledNumber<uint64_t>

Definition at line 33 of file SyntheticCountsUtils.h.

◆ SccTy

template<typename CallGraphType >
using llvm::SyntheticCountsUtils< CallGraphType >::SccTy = std::vector<NodeRef>

Definition at line 37 of file SyntheticCountsUtils.h.

Member Function Documentation

◆ propagate()

template<typename CallGraphType >
void SyntheticCountsUtils::propagate ( const CallGraphType &  CG,
GetRelBBFreqTy  GetRelBBFreq,
GetCountTy  GetCount,
AddCountTy  AddCount 
)
static

Propgate synthetic entry counts on a callgraph CG.

This performs a reverse post-order traversal of the callgraph SCC. For each SCC, it first propagates the entry counts to the nodes within the SCC through call edges and updates them in one shot. Then the entry counts are propagated to nodes outside the SCC. This requires GraphTraits to have a specialization for CallGraphType.

Definition at line 96 of file SyntheticCountsUtils.cpp.

References I, llvm::reverse(), and llvm::scc_begin().

Referenced by llvm::SyntheticCountsPropagation::run().


The documentation for this class was generated from the following files: