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