class MachineBlockFrequencyInfo
Declaration
class MachineBlockFrequencyInfo : public MachineFunctionPass { /* full declaration omitted */ };
Description
MachineBlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate machine basic block frequencies.
Declared at: llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h:33
Inherits from: MachineFunctionPass
Member Variables
- private std::unique_ptr<ImplType> MBFI
- public static char ID
Method Overview
- public MachineBlockFrequencyInfo(llvm::MachineFunction & F, llvm::MachineBranchProbabilityInfo & MBPI, llvm::MachineLoopInfo & MLI)
- public MachineBlockFrequencyInfo()
- public void calculate(const llvm::MachineFunction & F, const llvm::MachineBranchProbabilityInfo & MBPI, const llvm::MachineLoopInfo & MLI)
- public void getAnalysisUsage(llvm::AnalysisUsage & AU) const
- public llvm::BlockFrequency getBlockFreq(const llvm::MachineBasicBlock * MBB) const
- public float getBlockFreqRelativeToEntryBlock(const llvm::MachineBasicBlock * MBB) const
- public Optional<uint64_t> getBlockProfileCount(const llvm::MachineBasicBlock * MBB) const
- public uint64_t getEntryFreq() const
- public const llvm::MachineFunction * getFunction() const
- public const llvm::MachineBranchProbabilityInfo * getMBPI() const
- public Optional<uint64_t> getProfileCountFromFreq(uint64_t Freq) const
- public bool isIrrLoopHeader(const llvm::MachineBasicBlock * MBB) const
- public void onEdgeSplit(const llvm::MachineBasicBlock & NewPredecessor, const llvm::MachineBasicBlock & NewSuccessor, const llvm::MachineBranchProbabilityInfo & MBPI)
- public llvm::raw_ostream & printBlockFreq(llvm::raw_ostream & OS, const llvm::BlockFrequency Freq) const
- public llvm::raw_ostream & printBlockFreq(llvm::raw_ostream & OS, const llvm::MachineBasicBlock * MBB) const
- public void releaseMemory()
- public bool runOnMachineFunction(llvm::MachineFunction & F)
- public void view(const llvm::Twine & Name, bool isSimple = true) const
- public ~MachineBlockFrequencyInfo()
Inherited from MachineFunctionPass:
- public doInitialization
- protected getAnalysisUsage
- protected getClearedProperties
- protected getRequiredProperties
- protected getSetProperties
- protected runOnMachineFunction
Inherited from FunctionPass:
- public assignPassManager
- public createPrinterPass
- public getPotentialPassManagerType
- public runOnFunction
- protected skipFunction
Inherited from Pass:
- public assignPassManager
- public createPass
- public createPrinterPass
- public doFinalization
- public doInitialization
- public dump
- public dumpPassStructure
- public getAdjustedAnalysisPointer
- public getAnalysis
- public getAnalysis
- public getAnalysisID
- public getAnalysisID
- public getAnalysisIfAvailable
- public getAnalysisUsage
- public getAsImmutablePass
- public getAsPMDataManager
- public getPassID
- public getPassKind
- public getPassName
- public getPotentialPassManagerType
- public getResolver
- public lookupPassInfo
- public lookupPassInfo
- public mustPreserveAnalysisID
- public preparePassManager
- public print
- public releaseMemory
- public setResolver
- public verifyAnalysis
Methods
¶MachineBlockFrequencyInfo(
llvm::MachineFunction& F,
llvm::MachineBranchProbabilityInfo& MBPI,
llvm::MachineLoopInfo& MLI)
MachineBlockFrequencyInfo(
llvm::MachineFunction& F,
llvm::MachineBranchProbabilityInfo& MBPI,
llvm::MachineLoopInfo& MLI)
Declared at: llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h:41
Parameters
¶MachineBlockFrequencyInfo()
MachineBlockFrequencyInfo()
Declared at: llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h:40
¶void calculate(
const llvm::MachineFunction& F,
const llvm::MachineBranchProbabilityInfo&
MBPI,
const llvm::MachineLoopInfo& MLI)
void calculate(
const llvm::MachineFunction& F,
const llvm::MachineBranchProbabilityInfo&
MBPI,
const llvm::MachineLoopInfo& MLI)
Description
calculate - compute block frequency info for the given function.
Declared at: llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h:51
Parameters
- const llvm::MachineFunction& F
- const llvm::MachineBranchProbabilityInfo& MBPI
- const llvm::MachineLoopInfo& MLI
¶void getAnalysisUsage(
llvm::AnalysisUsage& AU) const
void getAnalysisUsage(
llvm::AnalysisUsage& AU) const
Description
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this. For MachineFunctionPasses, calling AU.preservesCFG() indicates that the pass does not modify the MachineBasicBlock CFG.
Declared at: llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h:46
Parameters
¶llvm::BlockFrequency getBlockFreq(
const llvm::MachineBasicBlock* MBB) const
llvm::BlockFrequency getBlockFreq(
const llvm::MachineBasicBlock* MBB) const
Description
getblockFreq - Return block frequency. Return 0 if we don't have the information. Please note that initial frequency is equal to 1024. It means that we should not rely on the value itself, but only on the comparison to the other block frequencies. We do this to avoid using of floating points. For example, to get the frequency of a block relative to the entry block, divide the integral value returned by this function (the BlockFrequency::getFrequency() value) by getEntryFreq().
Declared at: llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h:64
Parameters
- const llvm::MachineBasicBlock* MBB
¶float getBlockFreqRelativeToEntryBlock(
const llvm::MachineBasicBlock* MBB) const
float getBlockFreqRelativeToEntryBlock(
const llvm::MachineBasicBlock* MBB) const
Description
Compute the frequency of the block, relative to the entry block. This API assumes getEntryFreq() is non-zero.
Declared at: llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h:68
Parameters
- const llvm::MachineBasicBlock* MBB
¶Optional<uint64_t> getBlockProfileCount(
const llvm::MachineBasicBlock* MBB) const
Optional<uint64_t> getBlockProfileCount(
const llvm::MachineBasicBlock* MBB) const
Declared at: llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h:72
Parameters
- const llvm::MachineBasicBlock* MBB
¶uint64_t getEntryFreq() const
uint64_t getEntryFreq() const
Description
Divide a block's BlockFrequency::getFrequency() value by this value to obtain the entry block - relative frequency of said block.
Declared at: llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h:101
¶const llvm::MachineFunction* getFunction() const
const llvm::MachineFunction* getFunction() const
Declared at: llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h:83
¶const llvm::MachineBranchProbabilityInfo*
getMBPI() const
const llvm::MachineBranchProbabilityInfo*
getMBPI() const
Declared at: llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h:84
¶Optional<uint64_t> getProfileCountFromFreq(
uint64_t Freq) const
Optional<uint64_t> getProfileCountFromFreq(
uint64_t Freq) const
Declared at: llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h:73
Parameters
- uint64_t Freq
¶bool isIrrLoopHeader(
const llvm::MachineBasicBlock* MBB) const
bool isIrrLoopHeader(
const llvm::MachineBasicBlock* MBB) const
Declared at: llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h:75
Parameters
- const llvm::MachineBasicBlock* MBB
¶void onEdgeSplit(
const llvm::MachineBasicBlock& NewPredecessor,
const llvm::MachineBasicBlock& NewSuccessor,
const llvm::MachineBranchProbabilityInfo&
MBPI)
void onEdgeSplit(
const llvm::MachineBasicBlock& NewPredecessor,
const llvm::MachineBasicBlock& NewSuccessor,
const llvm::MachineBranchProbabilityInfo&
MBPI)
Description
incrementally calculate block frequencies when we split edges, to avoid full CFG traversal.
Declared at: llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h:79
Parameters
- const llvm::MachineBasicBlock& NewPredecessor
- const llvm::MachineBasicBlock& NewSuccessor
- const llvm::MachineBranchProbabilityInfo& MBPI
¶llvm::raw_ostream& printBlockFreq(
llvm::raw_ostream& OS,
const llvm::BlockFrequency Freq) const
llvm::raw_ostream& printBlockFreq(
llvm::raw_ostream& OS,
const llvm::BlockFrequency Freq) const
Declared at: llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h:92
Parameters
- llvm::raw_ostream& OS
- const llvm::BlockFrequency Freq
¶llvm::raw_ostream& printBlockFreq(
llvm::raw_ostream& OS,
const llvm::MachineBasicBlock* MBB) const
llvm::raw_ostream& printBlockFreq(
llvm::raw_ostream& OS,
const llvm::MachineBasicBlock* MBB) const
Declared at: llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h:96
Parameters
- llvm::raw_ostream& OS
- const llvm::MachineBasicBlock* MBB
¶void releaseMemory()
void releaseMemory()
Description
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memory when it is no longer needed. The default behavior of passes is to hold onto memory for the entire duration of their lifetime (which is the entire compile time). For pipelined passes, this is not a big deal because that memory gets recycled every time the pass is invoked on another program unit. For IP passes, it is more important to free memory when it is unused. Optionally implement this function to release pass memory when it is no longer used.
Declared at: llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h:55
¶bool runOnMachineFunction(
llvm::MachineFunction& F)
bool runOnMachineFunction(
llvm::MachineFunction& F)
Description
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformation or analysis.
Declared at: llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h:48
Parameters
¶void view(const llvm::Twine& Name,
bool isSimple = true) const
void view(const llvm::Twine& Name,
bool isSimple = true) const
Description
Pop up a ghostview window with the current block frequency propagation rendered using dot.
Declared at: llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h:88
Parameters
- const llvm::Twine& Name
- bool isSimple = true
¶~MachineBlockFrequencyInfo()
~MachineBlockFrequencyInfo()
Declared at: llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h:44