llvm::SampleProfileLoaderBaseImpl

Base implementation for loading and applying sample profiles to IR.

Synopsis

Declared in <llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h>

template<typename FT>
class SampleProfileLoaderBaseImpl;

Type Aliases

NameDescription
BT Basic-block type pointed to by NodeRef.
BasicBlockT Basic block type for the IR being profiled.
BlockEdgeMap Map from a basic block to its unique predecessor or successor list.
BlockFrequencyInfoT Block frequency info type for the IR being profiled.
BlockWeightMap Map from a basic block to its computed sample weight.
DominatorTreePtrT Owning pointer to a dominator tree for the IR being profiled.
Edge Directed edge between two basic blocks in the CFG.
EdgeWeightMap Map from a CFG edge to its computed sample weight.
EquivalenceClassMap Map from a basic block to the representative of its equivalence class.
FunctionT Function type for the IR being profiled.
InstructionT Instruction type for the IR being profiled.
LoopInfoPtrT Owning pointer to loop info for the IR being profiled.
LoopT Loop type for the IR being profiled.
NodeRef Graph node reference type for the CFG of FT.
OptRemarkAnalysisT Optimization remark analysis type for the IR being profiled.
OptRemarkEmitterT Optimization remark emitter type for the IR being profiled.
PostDominatorTreePtrT Owning pointer to a post-dominator tree for the IR being profiled.
PostDominatorTreeT Post-dominator tree type for the IR being profiled.
PredRangeT Range type over predecessors of a basic block.
SuccRangeT Range type over successors of a basic block.

Member Functions

NameDescription
SampleProfileLoaderBaseImpl [constructor]Construct a loader for profile file Name with optional remapping.
dump Dump the contents of the loaded sample profile.

Protected Member Functions

NameDescription
~SampleProfileLoaderBaseImpl [destructor]Destroy the sample profile loader base implementation.
applyProfi Infer missing block and edge weights with the flow-based profi algorithm.
buildEdges Build in/out edge lists for each basic block in the CFG.
clearFunctionData Clear all the per-function data used to load samples and propagate weights.
computeAndPropagateWeights Generate branch weight metadata for all branches in F.
computeBlockWeights Compute and store the weights of every basic block.
computeDominanceAndLoopInfo Compute dominator, post-dominator, and loop info for F.
emitCoverageRemarks Emit diagnostics when applied profile coverage is below the configured thresholds.
finalizeWeightPropagation Finish weight propagation, syncing the function entry count when using profi.
findEquivalenceClasses Find equivalence classes.
findEquivalencesFor Find equivalence classes for the given block.
findFunctionSamples [virtual]Get the FunctionSamples for an instruction.
getBlockWeight Compute the weight of a basic block.
getEntryBB Return the entry basic block of function F.
getFunction Return the LLVM IR Function underlying F.
getFunctionLoc Get the line number for the function header.
getInstWeight [virtual]Get the weight for an instruction.
getInstWeightImpl Get the weight for an instruction from line-offset body samples.
getPredecessors Return the predecessors of basic block BB.
getProbeWeight [virtual]Get the weight for a pseudo-probe instruction.
getSuccessors Return the successors of basic block BB.
initWeightPropagation Prepare a function for block and edge weight propagation.
printBlockEquivalence Print the equivalence class of block BB on stream OS.
printBlockWeight Print the weight of block BB on stream OS.
printEdgeWeight Print the weight of edge E on stream OS.
propagateThroughEdges Propagate weights through incoming/outgoing edges.
propagateWeights Propagate weights into edges
visitEdge Visit the given edge to decide if it has a valid weight.

Protected Data Members

NameDescription
BlockWeights Map basic blocks to their computed weights.
CoverageTracker Profile coverage tracker.
DILocation2SampleMap Cache mapping debug locations to their matching FunctionSamples.
DT Dominator tree for the function being processed.
EdgeWeights Map edges to their computed weights.
EquivalenceClass Equivalence classes for block weights.
FS VirtualFileSystem to load profile files from.
Filename Name of the profile file to load.
LI Loop information for the function being processed.
ORE Optimization Remark Emitter used to emit diagnostic remarks.
OutlineFunctionSamples Synthetic top-level samples cloned from inlined profiles.
PDT Post-dominator tree for the function being processed.
PSI Profile Summary Info computed from sample profile.
Predecessors Predecessors for each basic block in the CFG.
ProbeManager Helper that correlates imported sample counts with pseudo probes.
Reader Profile reader object.
RemappingFilename Name of the profile remapping file to load.
Samples Samples collected for the body of this function.
Successors Successors for each basic block in the CFG.
VisitedBlocks Set of visited blocks during propagation.
VisitedEdges Set of visited edges during propagation.

Friends

NameDescription
llvm::sampleprofutil::SampleCoverageTrackerTracks which sample-profile records have been matched to IR instructions.