16#ifndef LLVM_ANALYSIS_LAZYBLOCKFREQUENCYINFO_H
17#define LLVM_ANALYSIS_LAZYBLOCKFREQUENCYINFO_H
31template <
typename FunctionT,
typename BranchProbabilityInfoPassT,
32 typename LoopInfoT,
typename BlockFrequencyInfoT>
38 void setAnalysis(
const FunctionT *F, BranchProbabilityInfoPassT *BPIPass,
39 const LoopInfoT *LI) {
41 this->BPIPass = BPIPass;
48 assert(F && BPIPass && LI &&
"call setAnalysis");
67 BlockFrequencyInfoT BFI;
68 bool Calculated =
false;
69 const FunctionT *F =
nullptr;
70 BranchProbabilityInfoPassT *BPIPass =
nullptr;
71 const LoopInfoT *LI =
nullptr;
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Represent the analysis usage information of a pass.
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
FunctionPass class - This class is used to implement most global optimizations.
This is an alternative analysis pass to BlockFrequencyInfoWrapperPass.
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
const BlockFrequencyInfo & getBFI() const
Compute and return the block frequencies.
BlockFrequencyInfo & getBFI()
Compute and return the block frequencies.
bool runOnFunction(Function &F) override
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass.
static void getLazyBFIAnalysisUsage(AnalysisUsage &AU)
Helper for client passes to set up the analysis usage on behalf of this pass.
void print(raw_ostream &OS, const Module *M) const override
print - Print out the internal state of the pass.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
LazyBlockFrequencyInfoPass()
Wraps a BFI to allow lazy computation of the block frequencies.
LazyBlockFrequencyInfo()=default
const BlockFrequencyInfoT & getCalculated() const
BlockFrequencyInfoT & getCalculated()
Retrieve the BFI with the block frequencies computed.
void setAnalysis(const FunctionT *F, BranchProbabilityInfoPassT *BPIPass, const LoopInfoT *LI)
Set up the per-function input.
This is an alternative analysis pass to BranchProbabilityInfoWrapperPass.
A Module instance is used to store all the information related to an LLVM module.
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.
void initializeLazyBFIPassPass(PassRegistry &Registry)
Helper for client passes to initialize dependent passes for LBFI.
Simple trait class that provides a mapping between BPI passes and the corresponding BPInfo.