LLVM: llvm::MIRProfileLoader Class Reference (original) (raw)

Public Member Functions
void setInitVals (MachineDominatorTree *MDT, MachinePostDominatorTree *MPDT, MachineLoopInfo *MLI, MachineBlockFrequencyInfo *MBFI, MachineOptimizationRemarkEmitter *MORE)
void setFSPass (FSDiscriminatorPass Pass)
MIRProfileLoader (StringRef Name, StringRef RemapName, IntrusiveRefCntPtr< vfs::FileSystem > FS)
void setBranchProbs (MachineFunction &F)
bool runOnFunction (MachineFunction &F)
bool doInitialization (Module &M)
bool isValid () const
Public Member Functions inherited from llvm::SampleProfileLoaderBaseImpl< MachineFunction >
SampleProfileLoaderBaseImpl (std::string Name, std::string RemapName, IntrusiveRefCntPtr< vfs::FileSystem > FS)
void dump ()
Protected Member Functions
ErrorOr< uint64_t > getInstWeight (const MachineInstr &MI) override
Protected Member Functions inherited from llvm::SampleProfileLoaderBaseImpl< MachineFunction >
void computeDominanceAndLoopInfo (MachineFunction &F)
void computeDominanceAndLoopInfo (Function &F)
~SampleProfileLoaderBaseImpl ()=default
Function & getFunction (FunctionT &F)
const BasicBlockT * getEntryBB (const FunctionT *F)
PredRangeT getPredecessors (BasicBlockT *BB)
SuccRangeT getSuccessors (BasicBlockT *BB)
unsigned getFunctionLoc (FunctionT &Func)
Get the line number for the function header.
virtual ErrorOr< uint64_t > getInstWeight (const InstructionT &Inst)
Get the weight for an instruction.
ErrorOr< uint64_t > getInstWeightImpl (const InstructionT &Inst)
virtual ErrorOr< uint64_t > getProbeWeight (const InstructionT &Inst)
ErrorOr< uint64_t > getBlockWeight (const BasicBlockT *BB)
Compute the weight of a basic block.
virtual const FunctionSamples * findFunctionSamples (const InstructionT &I) const
Get the FunctionSamples for an instruction.
void printEdgeWeight (raw_ostream &OS, Edge E)
Print the weight of edge E on stream OS.
void printBlockWeight (raw_ostream &OS, const BasicBlockT *BB) const
Print the weight of block BB on stream OS.
void printBlockEquivalence (raw_ostream &OS, const BasicBlockT *BB)
Print the equivalence class of block BB on stream OS.
bool computeBlockWeights (FunctionT &F)
Compute and store the weights of every basic block.
void findEquivalenceClasses (FunctionT &F)
Find equivalence classes.
void findEquivalencesFor (BasicBlockT *BB1, ArrayRef< BasicBlockT * > Descendants, PostDominatorTreeT *DomTree)
Find equivalence classes for the given block.
void propagateWeights (FunctionT &F)
Propagate weights into edges.
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.
void buildEdges (FunctionT &F)
Build in/out edge lists for each basic block in the CFG.
bool propagateThroughEdges (FunctionT &F, bool UpdateBlockCount)
Propagate weights through incoming/outgoing edges.
void clearFunctionData (bool ResetDT=true)
Clear all the per-function data used to load samples and propagate weights.
bool computeAndPropagateWeights (FunctionT &F, const DenseSet< GlobalValue::GUID > &InlinedGUIDs)
Generate branch weight metadata for all branches in F.
void initWeightPropagation (FunctionT &F, const DenseSet< GlobalValue::GUID > &InlinedGUIDs)
void finalizeWeightPropagation (FunctionT &F, const DenseSet< GlobalValue::GUID > &InlinedGUIDs)
void emitCoverageRemarks (FunctionT &F)
Protected Attributes
MachineBlockFrequencyInfo * BFI
Hold the information of the basic block frequency.
FSDiscriminatorPass P
PassNum is the sequence number this pass is called, start from 1.
unsigned LowBit
unsigned HighBit
bool ProfileIsValid = true
Protected Attributes inherited from llvm::SampleProfileLoaderBaseImpl< MachineFunction >
DenseMap< const DILocation *, const FunctionSamples * > DILocation2SampleMap
BlockWeightMap BlockWeights
Map basic blocks to their computed weights.
EdgeWeightMap EdgeWeights
Map edges to their computed weights.
SmallPtrSet< const BasicBlockT *, 32 > VisitedBlocks
Set of visited blocks during propagation.
SmallSet< Edge, 32 > VisitedEdges
Set of visited edges during propagation.
EquivalenceClassMap EquivalenceClass
Equivalence classes for block weights.
DominatorTreePtrT DT
Dominance, post-dominance and loop information.
PostDominatorTreePtrT PDT
LoopInfoPtrT LI
BlockEdgeMap Predecessors
Predecessors for each basic block in the CFG.
BlockEdgeMap Successors
Successors for each basic block in the CFG.
SampleCoverageTracker CoverageTracker
Profile coverage tracker.
std::unique_ptr< SampleProfileReader > Reader
Profile reader object.
std::map< SampleContext, FunctionSamples > OutlineFunctionSamples
Synthetic samples created by duplicating the samples of inlined functions from the original profile as if they were top level sample profiles.
std::unique_ptr< PseudoProbeManager > ProbeManager
FunctionSamples * Samples
Samples collected for the body of this function.
std::string Filename
Name of the profile file to load.
std::string RemappingFilename
Name of the profile remapping file to load.
IntrusiveRefCntPtr< vfs::FileSystem > FS
VirtualFileSystem to load profile files from.
ProfileSummaryInfo * PSI
Profile Summary Info computed from sample profile.
OptRemarkEmitterT * ORE
Optimization Remark Emitter used to emit diagnostic remarks.
Friends
class SampleCoverageTracker
Additional Inherited Members
Public Types inherited from llvm::SampleProfileLoaderBaseImpl< MachineFunction >
using NodeRef
using BT
using InstructionT
using BasicBlockT
using BlockFrequencyInfoT
using FunctionT
using LoopT
using LoopInfoPtrT
using DominatorTreePtrT
using PostDominatorTreePtrT
using PostDominatorTreeT
using OptRemarkEmitterT
using OptRemarkAnalysisT
using PredRangeT
using SuccRangeT
using BlockWeightMap
using EquivalenceClassMap
using Edge
using EdgeWeightMap
using BlockEdgeMap

Definition at line 145 of file MIRSampleProfile.cpp.

doInitialization()

bool llvm::MIRProfileLoader::doInitialization ( Module & M )

getInstWeight()

isValid()

bool llvm::MIRProfileLoader::isValid ( ) const inline

runOnFunction()

setBranchProbs()

Definition at line 204 of file MIRSampleProfile.cpp.

References assert(), BFI, llvm::SampleProfileLoaderBaseImpl< MachineFunction >::BlockWeights, llvm::dbgs(), llvm::SampleProfileLoaderBaseImpl< MachineFunction >::EdgeWeights, llvm::SampleProfileLoaderBaseImpl< MachineFunction >::EquivalenceClass, F, llvm::MachineBasicBlock::findBranchDebugLoc(), FSProfileDebugBWThreshold, FSProfileDebugProbDiffThreshold, llvm::MachineBasicBlock::getNumber(), LLVM_DEBUG, llvm::MachineBasicBlock::setSuccProbability(), ShowFSBranchProb, llvm::MachineBasicBlock::succ_begin(), llvm::MachineBasicBlock::succ_end(), llvm::MachineBasicBlock::succ_size(), and llvm::MachineBasicBlock::successors().

Referenced by runOnFunction().

setFSPass()

setInitVals()

SampleCoverageTracker

BFI

HighBit

unsigned llvm::MIRProfileLoader::HighBit protected

LowBit

P

ProfileIsValid

bool llvm::MIRProfileLoader::ProfileIsValid = true protected

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