Go to the documentation of this file.
22 #define DEBUG_TYPE "lazy-machine-block-freq"
25 "Lazy Machine Block Frequency Analysis",
true,
true)
58 LazyMachineBlockFrequencyInfoPass::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);
This is an optimization pass for GlobalISel generic memory operations.
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
MachineBlockFrequencyInfo & getBFI()
Compute and return the block frequencies.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
MachineBlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate machine basic b...
Represent the analysis usage information of a pass.
This class implements an extremely fast bulk output stream that can only output to a stream.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
virtual void print(raw_ostream &OS, const Module *M) const
print - Print out the internal state of the pass.
===- LazyMachineBlockFrequencyInfo.h - Lazy Block Frequency -*- C++ -*–===//
INITIALIZE_PASS_BEGIN(LazyMachineBlockFrequencyInfoPass, DEBUG_TYPE, "Lazy Machine Block Frequency Analysis", true, true) INITIALIZE_PASS_END(LazyMachineBlockFrequencyInfoPass
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
void print(raw_ostream &OS, const Module *M) const override
print - Print out the internal state of the pass.
void initializeLazyMachineBlockFrequencyInfoPassPass(PassRegistry &)
A Module instance is used to store all the information related to an LLVM module.
This is an alternative analysis pass to MachineBlockFrequencyInfo.
void setPreservesAll()
Set by analyses that do not transform their input at all.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
COFF::MachineTypes Machine
Lazy Machine Block Frequency true
AnalysisUsage & addRequired()
bool runOnMachineFunction(MachineFunction &F) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...