13#ifndef LLVM_CODEGEN_MACHINEBLOCKFREQUENCYINFO_H
14#define LLVM_CODEGEN_MACHINEBLOCKFREQUENCYINFO_H
24template <
class BlockT>
class BlockFrequencyInfoImpl;
25class MachineBasicBlock;
26class MachineBranchProbabilityInfo;
35 std::unique_ptr<ImplType> MBFI;
73 std::optional<uint64_t>
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static bool isSimple(Instruction *I)
Represent the analysis usage information of a pass.
Shared implementation for block frequency analysis.
uint64_t getFrequency() const
Returns the frequency as a fixpoint number scaled by the entry frequency.
MachineBlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate machine basic b...
void view(const Twine &Name, bool isSimple=true) const
Pop up a ghostview window with the current block frequency propagation rendered using dot.
bool isIrrLoopHeader(const MachineBasicBlock *MBB) const
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
const MachineBranchProbabilityInfo * getMBPI() const
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
BlockFrequency getBlockFreq(const MachineBasicBlock *MBB) const
getblockFreq - Return block frequency.
void onEdgeSplit(const MachineBasicBlock &NewPredecessor, const MachineBasicBlock &NewSuccessor, const MachineBranchProbabilityInfo &MBPI)
incrementally calculate block frequencies when we split edges, to avoid full CFG traversal.
void calculate(const MachineFunction &F, const MachineBranchProbabilityInfo &MBPI, const MachineLoopInfo &MLI)
calculate - compute block frequency info for the given function.
bool runOnMachineFunction(MachineFunction &F) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
raw_ostream & printBlockFreq(raw_ostream &OS, const BlockFrequency Freq) const
uint64_t getEntryFreq() const
Divide a block's BlockFrequency::getFrequency() value by this value to obtain the entry block - relat...
const MachineFunction * getFunction() const
std::optional< uint64_t > getBlockProfileCount(const MachineBasicBlock *MBB) const
MachineBlockFrequencyInfo()
float getBlockFreqRelativeToEntryBlock(const MachineBasicBlock *MBB) const
Compute the frequency of the block, relative to the entry block.
std::optional< uint64_t > getProfileCountFromFreq(uint64_t Freq) const
~MachineBlockFrequencyInfo() override
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.