LLVM 22.0.0git
llvm::MIRProfileLoader Class Referencefinal
Inheritance diagram for llvm::MIRProfileLoader:
[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, 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_tgetInstWeight (const MachineInstr &MI) override
Protected Member Functions inherited from llvm::SampleProfileLoaderBaseImpl< MachineFunction >
void computeDominanceAndLoopInfo (MachineFunction &F)
void computeDominanceAndLoopInfo (Function &F)
 ~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.
virtual ErrorOr< uint64_tgetInstWeight (const InstructionT &Inst)
 Get the weight for an instruction.
ErrorOr< uint64_tgetInstWeightImpl (const InstructionT &Inst)
virtual ErrorOr< uint64_tgetProbeWeight (const InstructionT &Inst)
ErrorOr< uint64_tgetBlockWeight (const BasicBlockT *BB)
 Compute the weight of a basic block.
virtual const FunctionSamplesfindFunctionSamples (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

MachineBlockFrequencyInfoBFI
 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< SampleProfileReaderReader
 Profile reader object.
std::map< SampleContext, FunctionSamplesOutlineFunctionSamples
 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< PseudoProbeManagerProbeManager
FunctionSamplesSamples
 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::FileSystemFS
 VirtualFileSystem to load profile files from.
ProfileSummaryInfoPSI
 Profile Summary Info computed from sample profile.
OptRemarkEmitterTORE
 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

Detailed Description

Definition at line 147 of file MIRSampleProfile.cpp.

Constructor & Destructor Documentation

◆ MIRProfileLoader()

Member Function Documentation

◆ doInitialization()

◆ getInstWeight()

◆ isValid()

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

Definition at line 174 of file MIRSampleProfile.cpp.

References ProfileIsValid.

◆ runOnFunction()

◆ setBranchProbs()

◆ setFSPass()

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

◆ setInitVals()

◆ SampleCoverageTracker

friend class SampleCoverageTracker
friend

Definition at line 177 of file MIRSampleProfile.cpp.

References SampleCoverageTracker.

Referenced by SampleCoverageTracker.

Member Data Documentation

◆ BFI

MachineBlockFrequencyInfo* llvm::MIRProfileLoader::BFI
protected

Hold the information of the basic block frequency.

Definition at line 180 of file MIRSampleProfile.cpp.

Referenced by setBranchProbs(), and setInitVals().

◆ HighBit

unsigned llvm::MIRProfileLoader::HighBit
protected

Definition at line 190 of file MIRSampleProfile.cpp.

Referenced by setFSPass().

◆ LowBit

unsigned llvm::MIRProfileLoader::LowBit
protected

Definition at line 187 of file MIRSampleProfile.cpp.

Referenced by setFSPass().

◆ P

FSDiscriminatorPass llvm::MIRProfileLoader::P
protected

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

Definition at line 183 of file MIRSampleProfile.cpp.

Referenced by doInitialization(), and setFSPass().

◆ ProfileIsValid

bool llvm::MIRProfileLoader::ProfileIsValid = true
protected

Definition at line 192 of file MIRSampleProfile.cpp.

Referenced by doInitialization(), and isValid().


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