22#define DEBUG_TYPE "lazy-machine-block-freq"
25 "Lazy Machine Block Frequency Analysis",
true,
true)
58LazyMachineBlockFrequencyInfoPass::calculateIfNotAvailable()
const {
59 auto *MBFI = getAnalysisIfAvailable<MachineBlockFrequencyInfo>();
65 auto &MBPI = getAnalysis<MachineBranchProbabilityInfo>();
66 auto *MLI = getAnalysisIfAvailable<MachineLoopInfo>();
67 auto *MDT = getAnalysisIfAvailable<MachineDominatorTree>();
68 LLVM_DEBUG(
dbgs() <<
"Building MachineBlockFrequencyInfo on the fly\n");
78 OwnedMDT = std::make_unique<MachineDominatorTree>();
79 OwnedMDT->getBase().recalculate(*MF);
84 OwnedMLI = std::make_unique<MachineLoopInfo>();
85 OwnedMLI->getBase().analyze(MDT->getBase());
89 OwnedMBFI = std::make_unique<MachineBlockFrequencyInfo>();
90 OwnedMBFI->calculate(*MF, MBPI, *MLI);
Lazy Machine Block Frequency true
Lazy Machine Block Frequency Analysis
===- LazyMachineBlockFrequencyInfo.h - Lazy Block Frequency -*- C++ -*–===//
#define INITIALIZE_PASS_DEPENDENCY(depName)
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis)
Represent the analysis usage information of a pass.
AnalysisUsage & addRequired()
void setPreservesAll()
Set by analyses that do not transform their input at all.
This is an alternative analysis pass to MachineBlockFrequencyInfo.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
MachineBlockFrequencyInfo & getBFI()
Compute and return the block frequencies.
void print(raw_ostream &OS, const Module *M) const override
print - Print out the internal state of the pass.
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
bool runOnMachineFunction(MachineFunction &F) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
MachineBlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate machine basic b...
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
A Module instance is used to store all the information related to an LLVM module.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
virtual void print(raw_ostream &OS, const Module *M) const
print - Print out the internal state of the pass.
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.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
void initializeLazyMachineBlockFrequencyInfoPassPass(PassRegistry &)