LLVM  15.0.0git
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
llvm::SampleProfileLoaderBaseImpl< BT > Class Template Reference

#include "llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h"

Inheritance diagram for llvm::SampleProfileLoaderBaseImpl< BT >:
Inheritance graph
[legend]
Collaboration diagram for llvm::SampleProfileLoaderBaseImpl< BT >:
Collaboration graph
[legend]

Public Types

using InstructionT = typename afdo_detail::IRTraits< BT >::InstructionT
 
using BasicBlockT = typename afdo_detail::IRTraits< BT >::BasicBlockT
 
using BlockFrequencyInfoT = typename afdo_detail::IRTraits< BT >::BlockFrequencyInfoT
 
using FunctionT = typename afdo_detail::IRTraits< BT >::FunctionT
 
using LoopT = typename afdo_detail::IRTraits< BT >::LoopT
 
using LoopInfoPtrT = typename afdo_detail::IRTraits< BT >::LoopInfoPtrT
 
using DominatorTreePtrT = typename afdo_detail::IRTraits< BT >::DominatorTreePtrT
 
using PostDominatorTreePtrT = typename afdo_detail::IRTraits< BT >::PostDominatorTreePtrT
 
using PostDominatorTreeT = typename afdo_detail::IRTraits< BT >::PostDominatorTreeT
 
using OptRemarkEmitterT = typename afdo_detail::IRTraits< BT >::OptRemarkEmitterT
 
using OptRemarkAnalysisT = typename afdo_detail::IRTraits< BT >::OptRemarkAnalysisT
 
using PredRangeT = typename afdo_detail::IRTraits< BT >::PredRangeT
 
using SuccRangeT = typename afdo_detail::IRTraits< BT >::SuccRangeT
 
using BlockWeightMap = DenseMap< const BasicBlockT *, uint64_t >
 
using EquivalenceClassMap = DenseMap< const BasicBlockT *, const BasicBlockT * >
 
using Edge = std::pair< const BasicBlockT *, const BasicBlockT * >
 
using EdgeWeightMap = DenseMap< Edge, uint64_t >
 
using BlockEdgeMap = DenseMap< const BasicBlockT *, SmallVector< const BasicBlockT *, 8 > >
 

Public Member Functions

 SampleProfileLoaderBaseImpl (std::string Name, std::string RemapName)
 
void dump ()
 

Protected Member Functions

 ~SampleProfileLoaderBaseImpl ()=default
 
FunctiongetFunction (FunctionT &F)
 
const BasicBlockTgetEntryBB (const FunctionT *F)
 
PredRangeT getPredecessors (BasicBlockT *BB)
 
SuccRangeT getSuccessors (BasicBlockT *BB)
 
unsigned getFunctionLoc (FunctionT &Func)
 Get the line number for the function header. More...
 
virtual ErrorOr< uint64_tgetInstWeight (const InstructionT &Inst)
 Get the weight for an instruction. More...
 
ErrorOr< uint64_tgetInstWeightImpl (const InstructionT &Inst)
 
ErrorOr< uint64_tgetBlockWeight (const BasicBlockT *BB)
 Compute the weight of a basic block. More...
 
virtual const FunctionSamplesfindFunctionSamples (const InstructionT &I) const
 Get the FunctionSamples for an instruction. More...
 
void printEdgeWeight (raw_ostream &OS, Edge E)
 Print the weight of edge E on stream OS. More...
 
void printBlockWeight (raw_ostream &OS, const BasicBlockT *BB) const
 Print the weight of block BB on stream OS. More...
 
void printBlockEquivalence (raw_ostream &OS, const BasicBlockT *BB)
 Print the equivalence class of block BB on stream OS. More...
 
bool computeBlockWeights (FunctionT &F)
 Compute and store the weights of every basic block. More...
 
void findEquivalenceClasses (FunctionT &F)
 Find equivalence classes. More...
 
void findEquivalencesFor (BasicBlockT *BB1, ArrayRef< BasicBlockT * > Descendants, PostDominatorTreeT *DomTree)
 Find equivalence classes for the given block. More...
 
void propagateWeights (FunctionT &F)
 Propagate weights into edges. More...
 
void applyProfi (FunctionT &F, BlockEdgeMap &Successors, BlockWeightMap &SampleBlockWeights, BlockWeightMap &BlockWeights, EdgeWeightMap &EdgeWeights)
 
uint64_t visitEdge (Edge E, unsigned *NumUnknownEdges, Edge *UnknownEdge)
 Visit the given edge to decide if it has a valid weight. More...
 
void buildEdges (FunctionT &F)
 Build in/out edge lists for each basic block in the CFG. More...
 
bool propagateThroughEdges (FunctionT &F, bool UpdateBlockCount)
 Propagate weights through incoming/outgoing edges. More...
 
void clearFunctionData (bool ResetDT=true)
 Clear all the per-function data used to load samples and propagate weights. More...
 
void computeDominanceAndLoopInfo (FunctionT &F)
 
bool computeAndPropagateWeights (FunctionT &F, const DenseSet< GlobalValue::GUID > &InlinedGUIDs)
 Generate branch weight metadata for all branches in F. More...
 
void initWeightPropagation (FunctionT &F, const DenseSet< GlobalValue::GUID > &InlinedGUIDs)
 
void finalizeWeightPropagation (FunctionT &F, const DenseSet< GlobalValue::GUID > &InlinedGUIDs)
 
void emitCoverageRemarks (FunctionT &F)
 
void computeDominanceAndLoopInfo (MachineFunction &F)
 

Protected Attributes

DenseMap< const DILocation *, const FunctionSamples * > DILocation2SampleMap
 
BlockWeightMap BlockWeights
 Map basic blocks to their computed weights. More...
 
EdgeWeightMap EdgeWeights
 Map edges to their computed weights. More...
 
SmallPtrSet< const BasicBlockT *, 32 > VisitedBlocks
 Set of visited blocks during propagation. More...
 
SmallSet< Edge, 32 > VisitedEdges
 Set of visited edges during propagation. More...
 
EquivalenceClassMap EquivalenceClass
 Equivalence classes for block weights. More...
 
DominatorTreePtrT DT
 Dominance, post-dominance and loop information. More...
 
PostDominatorTreePtrT PDT
 
LoopInfoPtrT LI
 
BlockEdgeMap Predecessors
 Predecessors for each basic block in the CFG. More...
 
BlockEdgeMap Successors
 Successors for each basic block in the CFG. More...
 
SampleCoverageTracker CoverageTracker
 Profile coverage tracker. More...
 
std::unique_ptr< SampleProfileReaderReader
 Profile reader object. More...
 
FunctionSamplesSamples = nullptr
 Samples collected for the body of this function. More...
 
std::string Filename
 Name of the profile file to load. More...
 
std::string RemappingFilename
 Name of the profile remapping file to load. More...
 
ProfileSummaryInfoPSI = nullptr
 Profile Summary Info computed from sample profile. More...
 
OptRemarkEmitterTORE = nullptr
 Optimization Remark Emitter used to emit diagnostic remarks. More...
 

Friends

class SampleCoverageTracker
 

Detailed Description

template<typename BT>
class llvm::SampleProfileLoaderBaseImpl< BT >

Definition at line 81 of file SampleProfileLoaderBaseImpl.h.

Member Typedef Documentation

◆ BasicBlockT

Definition at line 88 of file SampleProfileLoaderBaseImpl.h.

◆ BlockEdgeMap

Definition at line 113 of file SampleProfileLoaderBaseImpl.h.

◆ BlockFrequencyInfoT

Definition at line 90 of file SampleProfileLoaderBaseImpl.h.

◆ BlockWeightMap

Definition at line 107 of file SampleProfileLoaderBaseImpl.h.

◆ DominatorTreePtrT

Definition at line 95 of file SampleProfileLoaderBaseImpl.h.

◆ Edge

template<typename BT >
using llvm::SampleProfileLoaderBaseImpl< BT >::Edge = std::pair<const BasicBlockT *, const BasicBlockT *>

Definition at line 110 of file SampleProfileLoaderBaseImpl.h.

◆ EdgeWeightMap

Definition at line 111 of file SampleProfileLoaderBaseImpl.h.

◆ EquivalenceClassMap

Definition at line 109 of file SampleProfileLoaderBaseImpl.h.

◆ FunctionT

template<typename BT >
using llvm::SampleProfileLoaderBaseImpl< BT >::FunctionT = typename afdo_detail::IRTraits<BT>::FunctionT

Definition at line 91 of file SampleProfileLoaderBaseImpl.h.

◆ InstructionT

Definition at line 87 of file SampleProfileLoaderBaseImpl.h.

◆ LoopInfoPtrT

Definition at line 93 of file SampleProfileLoaderBaseImpl.h.

◆ LoopT

template<typename BT >
using llvm::SampleProfileLoaderBaseImpl< BT >::LoopT = typename afdo_detail::IRTraits<BT>::LoopT

Definition at line 92 of file SampleProfileLoaderBaseImpl.h.

◆ OptRemarkAnalysisT

Definition at line 103 of file SampleProfileLoaderBaseImpl.h.

◆ OptRemarkEmitterT

Definition at line 101 of file SampleProfileLoaderBaseImpl.h.

◆ PostDominatorTreePtrT

Definition at line 97 of file SampleProfileLoaderBaseImpl.h.

◆ PostDominatorTreeT

Definition at line 99 of file SampleProfileLoaderBaseImpl.h.

◆ PredRangeT

template<typename BT >
using llvm::SampleProfileLoaderBaseImpl< BT >::PredRangeT = typename afdo_detail::IRTraits<BT>::PredRangeT

Definition at line 104 of file SampleProfileLoaderBaseImpl.h.

◆ SuccRangeT

template<typename BT >
using llvm::SampleProfileLoaderBaseImpl< BT >::SuccRangeT = typename afdo_detail::IRTraits<BT>::SuccRangeT

Definition at line 105 of file SampleProfileLoaderBaseImpl.h.

Constructor & Destructor Documentation

◆ SampleProfileLoaderBaseImpl()

template<typename BT >
llvm::SampleProfileLoaderBaseImpl< BT >::SampleProfileLoaderBaseImpl ( std::string  Name,
std::string  RemapName 
)
inline

Definition at line 83 of file SampleProfileLoaderBaseImpl.h.

◆ ~SampleProfileLoaderBaseImpl()

template<typename BT >
llvm::SampleProfileLoaderBaseImpl< BT >::~SampleProfileLoaderBaseImpl ( )
protecteddefault

Member Function Documentation

◆ applyProfi()

template<typename BT >
void llvm::SampleProfileLoaderBaseImpl< BT >::applyProfi ( FunctionT F,
BlockEdgeMap Successors,
BlockWeightMap SampleBlockWeights,
BlockWeightMap BlockWeights,
EdgeWeightMap EdgeWeights 
)
protected

Definition at line 810 of file SampleProfileLoaderBaseImpl.h.

◆ buildEdges()

template<typename BT >
void llvm::SampleProfileLoaderBaseImpl< BT >::buildEdges ( FunctionT F)
protected

Build in/out edge lists for each basic block in the CFG.

We are interested in unique edges. If a block B1 has multiple edges to another block B2, we only add a single B1->B2 edge.

Definition at line 715 of file SampleProfileLoaderBaseImpl.h.

◆ clearFunctionData()

template<typename BT >
void llvm::SampleProfileLoaderBaseImpl< BT >::clearFunctionData ( bool  ResetDT = true)
protected

Clear all the per-function data used to load samples and propagate weights.

Definition at line 228 of file SampleProfileLoaderBaseImpl.h.

◆ computeAndPropagateWeights()

template<typename BT >
bool llvm::SampleProfileLoaderBaseImpl< BT >::computeAndPropagateWeights ( FunctionT F,
const DenseSet< GlobalValue::GUID > &  InlinedGUIDs 
)
protected

Generate branch weight metadata for all branches in F.

Branch weights are computed out of instruction samples using a propagation heuristic. Propagation proceeds in 3 phases:

1- Assignment of block weights. All the basic blocks in the function are initial assigned the same weight as their most frequently executed instruction.

2- Creation of equivalence classes. Since samples may be missing from blocks, we can fill in the gaps by setting the weights of all the blocks in the same equivalence class to the same weight. To compute the concept of equivalence, we use dominance and loop information. Two blocks B1 and B2 are in the same equivalence class if B1 dominates B2, B2 post-dominates B1 and both are in the same loop.

3- Propagation of block weights into edges. This uses a simple propagation heuristic. The following rules are applied to every block BB in the CFG:

  • If BB has a single predecessor/successor, then the weight of that edge is the weight of the block.
  • If all the edges are known except one, and the weight of the block is already known, the weight of the unknown edge will be the weight of the block minus the sum of all the known edges. If the sum of all the known edges is larger than BB's weight, we set the unknown edge weight to zero.
  • If there is a self-referential edge, and the weight of the block is known, the weight for that edge is set to the weight of the block minus the weight of the other incoming edges to that block (if known).

Since this propagation is not guaranteed to finalize for every CFG, we only allow it to proceed for a limited number of iterations (controlled by -sample-profile-max-propagate-iterations).

FIXME: Try to replace this propagation heuristic with a scheme that is guaranteed to finalize. A work-list approach similar to the standard value propagation algorithm used by SSA-CCP might work here.

Parameters
FThe function to query.
Returns
true if F was modified. Returns false, otherwise.

Definition at line 864 of file SampleProfileLoaderBaseImpl.h.

◆ computeBlockWeights()

template<typename BT >
bool llvm::SampleProfileLoaderBaseImpl< BT >::computeBlockWeights ( FunctionT F)
protected

Compute and store the weights of every basic block.

This populates the BlockWeights map by computing the weights of every basic block in the CFG.

Parameters
FThe function to query.

Definition at line 371 of file SampleProfileLoaderBaseImpl.h.

◆ computeDominanceAndLoopInfo() [1/2]

template<typename BT >
void llvm::SampleProfileLoaderBaseImpl< BT >::computeDominanceAndLoopInfo ( FunctionT F)
protected

Definition at line 995 of file SampleProfileLoaderBaseImpl.h.

◆ computeDominanceAndLoopInfo() [2/2]

void llvm::SampleProfileLoaderBaseImpl< MachineBasicBlock >::computeDominanceAndLoopInfo ( MachineFunction F)
protected

Definition at line 169 of file MIRSampleProfile.cpp.

◆ dump()

template<typename BT >
void llvm::SampleProfileLoaderBaseImpl< BT >::dump ( )
inline

Definition at line 85 of file SampleProfileLoaderBaseImpl.h.

◆ emitCoverageRemarks()

template<typename BT >
void llvm::SampleProfileLoaderBaseImpl< BT >::emitCoverageRemarks ( FunctionT F)
protected

Definition at line 935 of file SampleProfileLoaderBaseImpl.h.

◆ finalizeWeightPropagation()

template<typename BT >
void llvm::SampleProfileLoaderBaseImpl< BT >::finalizeWeightPropagation ( FunctionT F,
const DenseSet< GlobalValue::GUID > &  InlinedGUIDs 
)
protected

Definition at line 914 of file SampleProfileLoaderBaseImpl.h.

◆ findEquivalenceClasses()

template<typename BT >
void llvm::SampleProfileLoaderBaseImpl< BT >::findEquivalenceClasses ( FunctionT F)
protected

Find equivalence classes.

Since samples may be missing from blocks, we can fill in the gaps by setting the weights of all the blocks in the same equivalence class to the same weight. To compute the concept of equivalence, we use dominance and loop information. Two blocks B1 and B2 are in the same equivalence class if B1 dominates B2, B2 post-dominates B1 and both are in the same loop.

Parameters
FThe function to query.

Definition at line 478 of file SampleProfileLoaderBaseImpl.h.

◆ findEquivalencesFor()

template<typename BT >
void llvm::SampleProfileLoaderBaseImpl< BT >::findEquivalencesFor ( BasicBlockT BB1,
ArrayRef< BasicBlockT * >  Descendants,
PostDominatorTreeT DomTree 
)
protected

Find equivalence classes for the given block.

This finds all the blocks that are guaranteed to execute the same number of times as BB1. To do this, it traverses all the descendants of BB1 in the dominator or post-dominator tree.

A block BB2 will be in the same equivalence class as BB1 if the following holds:

1- BB1 is a descendant of BB2 in the opposite tree. So, if BB2 is a descendant of BB1 in the dominator tree, then BB2 should dominate BB1 in the post-dominator tree.

2- Both BB2 and BB1 must be in the same loop.

For every block BB2 that meets those two requirements, we set BB2's equivalence class to BB1.

Parameters
BB1Block to check.
DescendantsDescendants of BB1 in either the dom or pdom tree.
DomTreeOpposite dominator tree. If Descendants is filled with blocks from BB1's dominator tree, then this is the post-dominator tree, and vice versa.

Definition at line 434 of file SampleProfileLoaderBaseImpl.h.

◆ findFunctionSamples()

template<typename BT >
const FunctionSamples * llvm::SampleProfileLoaderBaseImpl< BT >::findFunctionSamples ( const InstructionT Inst) const
protectedvirtual

Get the FunctionSamples for an instruction.

The FunctionSamples of an instruction Inst is the inlined instance in which that instruction is coming from. We traverse the inline stack of that instruction, and match it with the tree nodes in the profile.

Parameters
InstInstruction to query.
Returns
the FunctionSamples pointer to the inlined instance.

Definition at line 397 of file SampleProfileLoaderBaseImpl.h.

◆ getBlockWeight()

template<typename BT >
ErrorOr< uint64_t > llvm::SampleProfileLoaderBaseImpl< BT >::getBlockWeight ( const BasicBlockT BB)
protected

Compute the weight of a basic block.

The weight of basic block BB is the maximum weight of all the instructions in BB.

Parameters
BBThe basic block to query.
Returns
the weight for BB.

Definition at line 351 of file SampleProfileLoaderBaseImpl.h.

◆ getEntryBB()

template<typename BT >
const BasicBlockT* llvm::SampleProfileLoaderBaseImpl< BT >::getEntryBB ( const FunctionT F)
inlineprotected

Definition at line 122 of file SampleProfileLoaderBaseImpl.h.

◆ getFunction()

template<typename BT >
Function& llvm::SampleProfileLoaderBaseImpl< BT >::getFunction ( FunctionT F)
inlineprotected

Definition at line 119 of file SampleProfileLoaderBaseImpl.h.

◆ getFunctionLoc()

template<typename BT >
unsigned llvm::SampleProfileLoaderBaseImpl< BT >::getFunctionLoc ( FunctionT F)
protected

Get the line number for the function header.

This looks up function F in the current compilation unit and retrieves the line number where the function is defined. This is line 0 for all the samples read from the profile file. Every line number is relative to this line.

Parameters
FFunction object to query.
Returns
the line number where F is defined. If it returns 0, it means that there is no debug information available for F.

Definition at line 977 of file SampleProfileLoaderBaseImpl.h.

◆ getInstWeight()

template<typename BT >
ErrorOr< uint64_t > llvm::SampleProfileLoaderBaseImpl< BT >::getInstWeight ( const InstructionT Inst)
protectedvirtual

Get the weight for an instruction.

The "weight" of an instruction Inst is the number of samples collected on that instruction at runtime. To retrieve it, we need to compute the line number of Inst relative to the start of its function. We use HeaderLineno to compute the offset. We then look up the samples collected for Inst using BodySamples.

Parameters
InstInstruction to query.
Returns
the weight of Inst.

Definition at line 293 of file SampleProfileLoaderBaseImpl.h.

◆ getInstWeightImpl()

template<typename BT >
ErrorOr< uint64_t > llvm::SampleProfileLoaderBaseImpl< BT >::getInstWeightImpl ( const InstructionT Inst)
protected

Definition at line 299 of file SampleProfileLoaderBaseImpl.h.

◆ getPredecessors()

template<typename BT >
PredRangeT llvm::SampleProfileLoaderBaseImpl< BT >::getPredecessors ( BasicBlockT BB)
inlineprotected

Definition at line 125 of file SampleProfileLoaderBaseImpl.h.

◆ getSuccessors()

template<typename BT >
SuccRangeT llvm::SampleProfileLoaderBaseImpl< BT >::getSuccessors ( BasicBlockT BB)
inlineprotected

Definition at line 128 of file SampleProfileLoaderBaseImpl.h.

◆ initWeightPropagation()

template<typename BT >
void llvm::SampleProfileLoaderBaseImpl< BT >::initWeightPropagation ( FunctionT F,
const DenseSet< GlobalValue::GUID > &  InlinedGUIDs 
)
protected

Definition at line 886 of file SampleProfileLoaderBaseImpl.h.

◆ printBlockEquivalence()

template<typename BT >
void llvm::SampleProfileLoaderBaseImpl< BT >::printBlockEquivalence ( raw_ostream OS,
const BasicBlockT BB 
)
protected

Print the equivalence class of block BB on stream OS.

Parameters
OSStream to emit the output to.
BBBlock to print.

Definition at line 260 of file SampleProfileLoaderBaseImpl.h.

◆ printBlockWeight()

template<typename BT >
void llvm::SampleProfileLoaderBaseImpl< BT >::printBlockWeight ( raw_ostream OS,
const BasicBlockT BB 
) const
protected

Print the weight of block BB on stream OS.

Parameters
OSStream to emit the output to.
BBBlock to print.

Definition at line 272 of file SampleProfileLoaderBaseImpl.h.

◆ printEdgeWeight()

template<typename BT >
void llvm::SampleProfileLoaderBaseImpl< BT >::printEdgeWeight ( raw_ostream OS,
Edge  E 
)
protected

Print the weight of edge E on stream OS.

Parameters
OSStream to emit the output to.
EEdge to print.

Definition at line 250 of file SampleProfileLoaderBaseImpl.h.

◆ propagateThroughEdges()

template<typename BT >
bool llvm::SampleProfileLoaderBaseImpl< BT >::propagateThroughEdges ( FunctionT F,
bool  UpdateBlockCount 
)
protected

Propagate weights through incoming/outgoing edges.

If the weight of a basic block is known, and there is only one edge with an unknown weight, we can calculate the weight of that edge.

Similarly, if all the edges have a known count, we can calculate the count of the basic block, if needed.

Parameters
FFunction to process.
UpdateBlockCountWhether we should update basic block counts that has already been annotated.
Returns
True if new weights were assigned to edges or blocks.

Definition at line 565 of file SampleProfileLoaderBaseImpl.h.

◆ propagateWeights()

template<typename BT >
void llvm::SampleProfileLoaderBaseImpl< BT >::propagateWeights ( FunctionT F)
protected

Propagate weights into edges.

The following rules are applied to every block BB in the CFG:

  • If BB has a single predecessor/successor, then the weight of that edge is the weight of the block.
  • If all incoming or outgoing edges are known except one, and the weight of the block is already known, the weight of the unknown edge will be the weight of the block minus the sum of all the known edges. If the sum of all the known edges is larger than BB's weight, we set the unknown edge weight to zero.
  • If there is a self-referential edge, and the weight of the block is known, the weight for that edge is set to the weight of the block minus the weight of the other incoming edges to that block (if known).

Definition at line 755 of file SampleProfileLoaderBaseImpl.h.

◆ visitEdge()

template<typename BT >
uint64_t llvm::SampleProfileLoaderBaseImpl< BT >::visitEdge ( Edge  E,
unsigned *  NumUnknownEdges,
Edge UnknownEdge 
)
protected

Visit the given edge to decide if it has a valid weight.

If E has not been visited before, we copy to UnknownEdge and increment the count of unknown edges.

Parameters
EEdge to visit.
NumUnknownEdgesCurrent number of unknown edges.
UnknownEdgeSet if E has not been visited before.
Returns
E's weight, if known. Otherwise, return 0.

Definition at line 539 of file SampleProfileLoaderBaseImpl.h.

Friends And Related Function Documentation

◆ SampleCoverageTracker

template<typename BT >
friend class SampleCoverageTracker
friend

Definition at line 117 of file SampleProfileLoaderBaseImpl.h.

Member Data Documentation

◆ BlockWeights

template<typename BT >
BlockWeightMap llvm::SampleProfileLoaderBaseImpl< BT >::BlockWeights
protected

Map basic blocks to their computed weights.

The weight of a basic block is defined to be the maximum of all the instruction weights in that block.

Definition at line 171 of file SampleProfileLoaderBaseImpl.h.

◆ CoverageTracker

template<typename BT >
SampleCoverageTracker llvm::SampleProfileLoaderBaseImpl< BT >::CoverageTracker
protected

Profile coverage tracker.

Definition at line 205 of file SampleProfileLoaderBaseImpl.h.

◆ DILocation2SampleMap

template<typename BT >
DenseMap<const DILocation *, const FunctionSamples *> llvm::SampleProfileLoaderBaseImpl< BT >::DILocation2SampleMap
mutableprotected

Definition at line 137 of file SampleProfileLoaderBaseImpl.h.

◆ DT

template<typename BT >
DominatorTreePtrT llvm::SampleProfileLoaderBaseImpl< BT >::DT
protected

Dominance, post-dominance and loop information.

Definition at line 194 of file SampleProfileLoaderBaseImpl.h.

◆ EdgeWeights

template<typename BT >
EdgeWeightMap llvm::SampleProfileLoaderBaseImpl< BT >::EdgeWeights
protected

Map edges to their computed weights.

Edge weights are computed by propagating basic block weights in SampleProfile::propagateWeights.

Definition at line 177 of file SampleProfileLoaderBaseImpl.h.

◆ EquivalenceClass

template<typename BT >
EquivalenceClassMap llvm::SampleProfileLoaderBaseImpl< BT >::EquivalenceClass
protected

Equivalence classes for block weights.

Two blocks BB1 and BB2 are in the same equivalence class if they dominate and post-dominate each other, and they are in the same loop nest. When this happens, the two blocks are guaranteed to execute the same number of times.

Definition at line 191 of file SampleProfileLoaderBaseImpl.h.

◆ Filename

template<typename BT >
std::string llvm::SampleProfileLoaderBaseImpl< BT >::Filename
protected

Name of the profile file to load.

Definition at line 214 of file SampleProfileLoaderBaseImpl.h.

◆ LI

template<typename BT >
LoopInfoPtrT llvm::SampleProfileLoaderBaseImpl< BT >::LI
protected

Definition at line 196 of file SampleProfileLoaderBaseImpl.h.

◆ ORE

template<typename BT >
OptRemarkEmitterT* llvm::SampleProfileLoaderBaseImpl< BT >::ORE = nullptr
protected

Optimization Remark Emitter used to emit diagnostic remarks.

Definition at line 223 of file SampleProfileLoaderBaseImpl.h.

◆ PDT

template<typename BT >
PostDominatorTreePtrT llvm::SampleProfileLoaderBaseImpl< BT >::PDT
protected

Definition at line 195 of file SampleProfileLoaderBaseImpl.h.

◆ Predecessors

template<typename BT >
BlockEdgeMap llvm::SampleProfileLoaderBaseImpl< BT >::Predecessors
protected

Predecessors for each basic block in the CFG.

Definition at line 199 of file SampleProfileLoaderBaseImpl.h.

◆ PSI

template<typename BT >
ProfileSummaryInfo* llvm::SampleProfileLoaderBaseImpl< BT >::PSI = nullptr
protected

Profile Summary Info computed from sample profile.

Definition at line 220 of file SampleProfileLoaderBaseImpl.h.

◆ Reader

template<typename BT >
std::unique_ptr<SampleProfileReader> llvm::SampleProfileLoaderBaseImpl< BT >::Reader
protected

Profile reader object.

Definition at line 208 of file SampleProfileLoaderBaseImpl.h.

◆ RemappingFilename

template<typename BT >
std::string llvm::SampleProfileLoaderBaseImpl< BT >::RemappingFilename
protected

Name of the profile remapping file to load.

Definition at line 217 of file SampleProfileLoaderBaseImpl.h.

◆ Samples

template<typename BT >
FunctionSamples* llvm::SampleProfileLoaderBaseImpl< BT >::Samples = nullptr
protected

Samples collected for the body of this function.

Definition at line 211 of file SampleProfileLoaderBaseImpl.h.

◆ Successors

template<typename BT >
BlockEdgeMap llvm::SampleProfileLoaderBaseImpl< BT >::Successors
protected

Successors for each basic block in the CFG.

Definition at line 202 of file SampleProfileLoaderBaseImpl.h.

◆ VisitedBlocks

template<typename BT >
SmallPtrSet<const BasicBlockT *, 32> llvm::SampleProfileLoaderBaseImpl< BT >::VisitedBlocks
protected

Set of visited blocks during propagation.

Definition at line 180 of file SampleProfileLoaderBaseImpl.h.

◆ VisitedEdges

template<typename BT >
SmallSet<Edge, 32> llvm::SampleProfileLoaderBaseImpl< BT >::VisitedEdges
protected

Set of visited edges during propagation.

Definition at line 183 of file SampleProfileLoaderBaseImpl.h.


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