LLVM: include/llvm/Analysis/BlockFrequencyInfo.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_ANALYSIS_BLOCKFREQUENCYINFO_H
14#define LLVM_ANALYSIS_BLOCKFREQUENCYINFO_H
15
21#include
22#include
23#include
24
25namespace llvm {
26
33
35
36
37
40
41 std::unique_ptr BFI;
42
43public:
53
54
56 FunctionAnalysisManager::Invalidator &);
57
61
62
63
64
65
66
68
69
70
71
72 LLVM_ABI std::optional<uint64_t>
74
75
76
77
78 LLVM_ABI std::optional<uint64_t>
80
81
82
84
85
87
88
89
90
94
95
98
102
103
105};
106
107
108
109
112
113
114
117
118
122
124
125public:
126
128
129
131};
132
133
135 : public PassInfoMixin {
137
138public:
140
142
144};
145
146
149
150public:
152
155
158
159 void getAnalysisUsage(AnalysisUsage &AU) const override;
160
162 void releaseMemory() override;
164};
165
166}
167
168#endif
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
static bool runOnFunction(Function &F, bool PostInlining)
This header defines various interfaces for pass management in LLVM.
Represent the analysis usage information of a pass.
LLVM Basic Block Representation.
Analysis pass which computes BlockFrequencyInfo.
Definition BlockFrequencyInfo.h:120
BlockFrequencyInfo Result
Provide the result type for this analysis pass.
Definition BlockFrequencyInfo.h:127
LLVM_ABI Result run(Function &F, FunctionAnalysisManager &AM)
Run the analysis pass over a function and produce BFI.
Shared implementation for block frequency analysis.
~BlockFrequencyInfoWrapperPass() override
BlockFrequencyInfo & getBFI()
Definition BlockFrequencyInfo.h:156
BlockFrequencyInfoWrapperPass()
const BlockFrequencyInfo & getBFI() const
Definition BlockFrequencyInfo.h:157
static char ID
Definition BlockFrequencyInfo.h:151
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
Definition BlockFrequencyInfo.h:38
LLVM_ABI bool isIrrLoopHeader(const BasicBlock *BB)
Returns true if BB is an irreducible loop header block.
LLVM_ABI void calculate(const Function &F, const BranchProbabilityInfo &BPI, const LoopInfo &LI)
calculate - compute block frequency info for the given function.
LLVM_ABI std::optional< uint64_t > getProfileCountFromFreq(BlockFrequency Freq) const
Returns the estimated profile count of Freq.
LLVM_ABI void setBlockFreq(const BasicBlock *BB, BlockFrequency Freq)
LLVM_ABI ~BlockFrequencyInfo()
LLVM_ABI const Function * getFunction() const
LLVM_ABI std::optional< uint64_t > getBlockProfileCount(const BasicBlock *BB, bool AllowSynthetic=false) const
Returns the estimated profile count of BB.
BlockFrequencyInfo & operator=(const BlockFrequencyInfo &)=delete
LLVM_ABI BlockFrequencyInfo()
LLVM_ABI void view(StringRef="BlockFrequencyDAGs") const
Pop up a ghostview window with the current block frequency propagation rendered using dot.
LLVM_ABI void setBlockFreqAndScale(const BasicBlock *ReferenceBB, BlockFrequency Freq, SmallPtrSetImpl< BasicBlock * > &BlocksToScale)
Set the frequency of ReferenceBB to Freq and scale the frequencies of the blocks in BlocksToScale suc...
LLVM_ABI const BranchProbabilityInfo * getBPI() const
LLVM_ABI BlockFrequency getEntryFreq() const
LLVM_ABI BlockFrequency getBlockFreq(const BasicBlock *BB) const
getblockFreq - Return block frequency.
LLVM_ABI void print(raw_ostream &OS) const
LLVM_ABI void releaseMemory()
LLVM_ABI bool invalidate(Function &F, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &)
Handle invalidation explicitly.
LLVM_ABI void verifyMatch(BlockFrequencyInfo &Other) const
BlockFrequencyInfo(const BlockFrequencyInfo &)=delete
BlockFrequencyPrinterPass(raw_ostream &OS)
Definition BlockFrequencyInfo.h:139
LLVM_ABI PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
static bool isRequired()
Definition BlockFrequencyInfo.h:143
Analysis providing branch probability information.
A Module instance is used to store all the information related to an LLVM module.
A set of analyses that are preserved following a run of a transformation pass.
Simple wrapper around std::function<void(raw_ostream&)>.
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
StringRef - Represent a constant reference to a string, i.e.
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.
PGOViewCountsType
Definition BlockFrequencyInfo.h:34
@ PGOVCT_Graph
Definition BlockFrequencyInfo.h:34
@ PGOVCT_None
Definition BlockFrequencyInfo.h:34
@ PGOVCT_Text
Definition BlockFrequencyInfo.h:34
LLVM_ABI Printable printBlockFreq(const BlockFrequencyInfo &BFI, BlockFrequency Freq)
Print the block frequency Freq relative to the current functions entry frequency.
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
A CRTP mix-in that provides informational APIs needed for analysis passes.
A special type used by analysis passes to provide an address that identifies that particular analysis...
A CRTP mix-in to automatically provide informational APIs needed for passes.