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;
121 void releaseMemory()
override;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
static bool runOnFunction(Function &F, bool PostInlining)
Represent the analysis usage information of a pass.
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
const BlockFrequencyInfo & getBFI() const
Compute and return the block frequencies.
BlockFrequencyInfo & getBFI()
Compute and return the block frequencies.
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.
static PassT & getBPI(PassT *P)