LLVM  14.0.0git
Public Member Functions | Protected Attributes | Friends | List of all members
llvm::MIRProfileLoader Class Referencefinal
Inheritance diagram for llvm::MIRProfileLoader:
Inheritance graph
[legend]
Collaboration diagram for llvm::MIRProfileLoader:
Collaboration graph
[legend]

Public Member Functions

void setInitVals (MachineDominatorTree *MDT, MachinePostDominatorTree *MPDT, MachineLoopInfo *MLI, MachineBlockFrequencyInfo *MBFI, MachineOptimizationRemarkEmitter *MORE)
 
void setFSPass (FSDiscriminatorPass Pass)
 
 MIRProfileLoader (StringRef Name, StringRef RemapName)
 
void setBranchProbs (MachineFunction &F)
 
bool runOnFunction (MachineFunction &F)
 
bool doInitialization (Module &M)
 
bool isValid () const
 
- Public Member Functions inherited from llvm::SampleProfileLoaderBaseImpl< MachineBasicBlock >
 SampleProfileLoaderBaseImpl (std::string Name, std::string RemapName)
 
void dump ()
 

Protected Attributes

MachineBlockFrequencyInfoBFI
 Hold the information of the basic block frequency. More...
 
FSDiscriminatorPass P
 PassNum is the sequence number this pass is called, start from 1. More...
 
unsigned LowBit
 
unsigned HighBit
 
bool ProfileIsValid = true
 
- Protected Attributes inherited from llvm::SampleProfileLoaderBaseImpl< MachineBasicBlock >
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
 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
 Profile Summary Info computed from sample profile. More...
 
OptRemarkEmitterTORE
 Optimization Remark Emitter used to emit diagnostic remarks. More...
 

Friends

class SampleCoverageTracker
 

Additional Inherited Members

- Public Types inherited from llvm::SampleProfileLoaderBaseImpl< MachineBasicBlock >
using InstructionT = typename afdo_detail::IRTraits< MachineBasicBlock >::InstructionT
 
using BasicBlockT = typename afdo_detail::IRTraits< MachineBasicBlock >::BasicBlockT
 
using BlockFrequencyInfoT = typename afdo_detail::IRTraits< MachineBasicBlock >::BlockFrequencyInfoT
 
using FunctionT = typename afdo_detail::IRTraits< MachineBasicBlock >::FunctionT
 
using LoopT = typename afdo_detail::IRTraits< MachineBasicBlock >::LoopT
 
using LoopInfoPtrT = typename afdo_detail::IRTraits< MachineBasicBlock >::LoopInfoPtrT
 
using DominatorTreePtrT = typename afdo_detail::IRTraits< MachineBasicBlock >::DominatorTreePtrT
 
using PostDominatorTreePtrT = typename afdo_detail::IRTraits< MachineBasicBlock >::PostDominatorTreePtrT
 
using PostDominatorTreeT = typename afdo_detail::IRTraits< MachineBasicBlock >::PostDominatorTreeT
 
using OptRemarkEmitterT = typename afdo_detail::IRTraits< MachineBasicBlock >::OptRemarkEmitterT
 
using OptRemarkAnalysisT = typename afdo_detail::IRTraits< MachineBasicBlock >::OptRemarkAnalysisT
 
using PredRangeT = typename afdo_detail::IRTraits< MachineBasicBlock >::PredRangeT
 
using SuccRangeT = typename afdo_detail::IRTraits< MachineBasicBlock >::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 > >
 
- Protected Member Functions inherited from llvm::SampleProfileLoaderBaseImpl< MachineBasicBlock >
 ~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...
 
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)
 
void computeDominanceAndLoopInfo (MachineFunction &F)
 
bool computeAndPropagateWeights (FunctionT &F, const DenseSet< GlobalValue::GUID > &InlinedGUIDs)
 Generate branch weight metadata for all branches in F. More...
 
void emitCoverageRemarks (FunctionT &F)
 

Detailed Description

Definition at line 112 of file MIRSampleProfile.cpp.

Constructor & Destructor Documentation

◆ MIRProfileLoader()

llvm::MIRProfileLoader::MIRProfileLoader ( StringRef  Name,
StringRef  RemapName 
)
inline

Definition at line 131 of file MIRSampleProfile.cpp.

References string.

Member Function Documentation

◆ doInitialization()

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

◆ isValid()

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

Definition at line 138 of file MIRSampleProfile.cpp.

◆ runOnFunction()

bool llvm::MIRProfileLoader::runOnFunction ( MachineFunction F)

Definition at line 268 of file MIRSampleProfile.cpp.

References llvm::MachineFunction::getFunction().

◆ setBranchProbs()

void llvm::MIRProfileLoader::setBranchProbs ( MachineFunction F)

◆ setFSPass()

void llvm::MIRProfileLoader::setFSPass ( FSDiscriminatorPass  Pass)
inline

Definition at line 124 of file MIRSampleProfile.cpp.

References assert(), llvm::getFSPassBitBegin(), llvm::getFSPassBitEnd(), P, and Pass.

◆ setInitVals()

void llvm::MIRProfileLoader::setInitVals ( MachineDominatorTree MDT,
MachinePostDominatorTree MPDT,
MachineLoopInfo MLI,
MachineBlockFrequencyInfo MBFI,
MachineOptimizationRemarkEmitter MORE 
)
inline

Definition at line 115 of file MIRSampleProfile.cpp.

References llvm::AMDGPUISD::BFI, and MORE.

Friends And Related Function Documentation

◆ SampleCoverageTracker

friend class SampleCoverageTracker
friend

Definition at line 141 of file MIRSampleProfile.cpp.

Member Data Documentation

◆ BFI

MachineBlockFrequencyInfo* llvm::MIRProfileLoader::BFI
protected

Hold the information of the basic block frequency.

Definition at line 144 of file MIRSampleProfile.cpp.

◆ HighBit

unsigned llvm::MIRProfileLoader::HighBit
protected

Definition at line 154 of file MIRSampleProfile.cpp.

◆ LowBit

unsigned llvm::MIRProfileLoader::LowBit
protected

Definition at line 151 of file MIRSampleProfile.cpp.

◆ P

FSDiscriminatorPass llvm::MIRProfileLoader::P
protected

PassNum is the sequence number this pass is called, start from 1.

Definition at line 147 of file MIRSampleProfile.cpp.

◆ ProfileIsValid

bool llvm::MIRProfileLoader::ProfileIsValid = true
protected

Definition at line 156 of file MIRSampleProfile.cpp.


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