16#ifndef LLVM_ANALYSIS_LAZYBRANCHPROBABILITYINFO_H
17#define LLVM_ANALYSIS_LAZYBRANCHPROBABILITYINFO_H
26class TargetLibraryInfo;
56 class LazyBranchProbabilityInfo {
60 :
F(
F), LI(LI), TLI(TLI) {}
65 assert(
F && LI &&
"call setAnalysis");
66 BPI.calculate(*
F, *LI, TLI,
nullptr,
nullptr);
73 return const_cast<LazyBranchProbabilityInfo *
>(
this)->getCalculated();
78 bool Calculated =
false;
84 std::unique_ptr<LazyBranchProbabilityInfo> LBPI;
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Represent the analysis usage information of a pass.
Analysis providing branch probability information.
FunctionPass class - This class is used to implement most global optimizations.
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.
static BranchProbabilityInfo & getBPI(LazyBranchProbabilityInfoPass *P)
Simple trait class that provides a mapping between BPI passes and the corresponding BPInfo.
static PassT & getBPI(PassT *P)