17 #ifndef LLVM_ANALYSIS_LAZYBLOCKFREQUENCYINFO_H
18 #define LLVM_ANALYSIS_LAZYBLOCKFREQUENCYINFO_H
26 class BranchProbabilityInfo;
58 class LazyBlockFrequencyInfo {
60 LazyBlockFrequencyInfo()
61 : Calculated(
false),
F(
nullptr), BPIPass(
nullptr), LI(
nullptr) {}
67 this->BPIPass = BPIPass;
74 assert(F && BPIPass && LI &&
"call setAnalysis");
75 BFI.calculate(*F, BPIPass->
getBPI(), *LI);
82 return const_cast<LazyBlockFrequencyInfo *
>(
this)->getCalculated();
88 setAnalysis(
nullptr,
nullptr,
nullptr);
99 LazyBlockFrequencyInfo LBFI;
This is an alternative analysis pass to BlockFrequencyInfoWrapperPass.
A Module instance is used to store all the information related to an LLVM module. ...
void initializeLazyBFIPassPass(PassRegistry &Registry)
Helper for client passes to initialize dependent passes for LBFI.
LazyBlockFrequencyInfoPass()
This is an alternative analysis pass to BranchProbabilityInfoWrapperPass.
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
bool runOnFunction(Function &F) override
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass...
const BlockFrequencyInfo & getBFI() const
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.
static void getLazyBFIAnalysisUsage(AnalysisUsage &AU)
Helper for client passes to set up the analysis usage on behalf of this pass.
BranchProbabilityInfo & getBPI()
Compute and return the branch probabilities.
BlockFrequencyInfo & getBFI()
Compute and return the block frequencies.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This class implements an extremely fast bulk output stream that can only output to a stream...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...