16#ifndef LLVM_ANALYSIS_LAZYBRANCHPROBABILITYINFO_H
17#define LLVM_ANALYSIS_LAZYBRANCHPROBABILITYINFO_H
55 class LazyBranchProbabilityInfo {
59 :
F(
F), LI(LI), TLI(TLI) {}
64 assert(
F && LI &&
"call setAnalysis");
72 return const_cast<LazyBranchProbabilityInfo *
>(
this)->getCalculated();
77 bool Calculated =
false;
83 std::unique_ptr<LazyBranchProbabilityInfo> LBPI;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Represent the analysis usage information of a pass.
Analysis providing branch probability information.
LLVM_ABI void calculate(const Function &F, const LoopInfo &LI, const TargetLibraryInfo *TLI, DominatorTree *DT, PostDominatorTree *PDT)
This is an alternative analysis pass to BranchProbabilityInfoWrapperPass.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
bool runOnFunction(Function &F) override
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass.
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
const BranchProbabilityInfo & getBPI() const
Compute and return the branch probabilities.
void print(raw_ostream &OS, const Module *M) const override
print - Print out the internal state of the pass.
BranchProbabilityInfo & getBPI()
Compute and return the branch probabilities.
LazyBranchProbabilityInfoPass()
static void getLazyBPIAnalysisUsage(AnalysisUsage &AU)
Helper for client passes to set up the analysis usage on behalf of this pass.
A Module instance is used to store all the information related to an LLVM module.
Provides information about what library functions are available for the current target.
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 initializeLazyBPIPassPass(PassRegistry &Registry)
Helper for client passes to initialize dependent passes for LBPI.
MachinePassRegistry< typename RegisterRegAllocBase< T >::FunctionPassCtor > RegisterRegAllocBase< T >::Registry
RegisterRegAlloc's global Registry tracks allocator registration.
static BranchProbabilityInfo & getBPI(LazyBranchProbabilityInfoPass *P)
Simple trait class that provides a mapping between BPI passes and the corresponding BPInfo.
static PassT & getBPI(PassT *P)