LLVM: include/llvm/CodeGen/MachineBlockFrequencyInfo.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_CODEGEN_MACHINEBLOCKFREQUENCYINFO_H
14#define LLVM_CODEGEN_MACHINEBLOCKFREQUENCYINFO_H
15
20#include
21#include
22#include
23
24namespace llvm {
25
32
33
34
37 std::unique_ptr MBFI;
38
39public:
46
47
49 MachineFunctionAnalysisManager::Invalidator &);
50
51
55
57
59
60
61
62
63
64
65
66
68
69
70
73 "getEntryFreq() should not return 0 here!");
75 static_cast<double>(getEntryFreq().getFrequency());
76 }
77
78 LLVM_ABI std::optional<uint64_t>
80 LLVM_ABI std::optional<uint64_t>
82
84
85
86
90
93
94
95
97
98
99
101};
102
103
104
105
107 BlockFrequency Freq);
108
109
110
112 const MachineBasicBlock &MBB);
113
125
126
128 : public PassInfoMixin {
130
131public:
133
136
138};
139
143
144public:
146
148
150
152
154
156
158};
159}
160
161#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static bool isSimple(Instruction *I)
Represent the analysis usage information of a pass.
Shared implementation for block frequency analysis.
uint64_t getFrequency() const
Returns the frequency as a fixpoint number scaled by the entry frequency.
MachineBlockFrequencyInfo Result
Definition MachineBlockFrequencyInfo.h:120
LLVM_ABI Result run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
bool runOnMachineFunction(MachineFunction &F) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
static char ID
Definition MachineBlockFrequencyInfo.h:145
MachineBlockFrequencyInfo & getMBFI()
Definition MachineBlockFrequencyInfo.h:155
const MachineBlockFrequencyInfo & getMBFI() const
Definition MachineBlockFrequencyInfo.h:157
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
Definition MachineBlockFrequencyInfo.h:153
MachineBlockFrequencyInfoWrapperPass()
MachineBlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate machine basic b...
Definition MachineBlockFrequencyInfo.h:35
LLVM_ABI void view(const Twine &Name, bool isSimple=true) const
Pop up a ghostview window with the current block frequency propagation rendered using dot.
LLVM_ABI void print(raw_ostream &OS)
LLVM_ABI bool isIrrLoopHeader(const MachineBasicBlock *MBB) const
LLVM_ABI const MachineBranchProbabilityInfo * getMBPI() const
LLVM_ABI BlockFrequency getBlockFreq(const MachineBasicBlock *MBB) const
getblockFreq - Return block frequency.
LLVM_ABI void onEdgeSplit(const MachineBasicBlock &NewPredecessor, const MachineBasicBlock &NewSuccessor, const MachineBranchProbabilityInfo &MBPI)
incrementally calculate block frequencies when we split edges, to avoid full CFG traversal.
LLVM_ABI void calculate(const MachineFunction &F, const MachineBranchProbabilityInfo &MBPI, const MachineLoopInfo &MLI)
calculate - compute block frequency info for the given function.
LLVM_ABI void releaseMemory()
LLVM_ABI const MachineFunction * getFunction() const
double getBlockFreqRelativeToEntryBlock(const MachineBasicBlock *MBB) const
Compute the frequency of the block, relative to the entry block.
Definition MachineBlockFrequencyInfo.h:71
LLVM_ABI std::optional< uint64_t > getProfileCountFromFreq(BlockFrequency Freq) const
LLVM_ABI bool invalidate(MachineFunction &F, const PreservedAnalyses &PA, MachineFunctionAnalysisManager::Invalidator &)
Handle invalidation explicitly.
LLVM_ABI BlockFrequency getEntryFreq() const
Divide a block's BlockFrequency::getFrequency() value by this value to obtain the entry block - relat...
LLVM_ABI ~MachineBlockFrequencyInfo()
LLVM_ABI std::optional< uint64_t > getBlockProfileCount(const MachineBasicBlock *MBB) const
LLVM_ABI MachineBlockFrequencyInfo(MachineBlockFrequencyInfo &&)
LLVM_ABI MachineBlockFrequencyInfo()
static bool isRequired()
Definition MachineBlockFrequencyInfo.h:137
MachineBlockFrequencyPrinterPass(raw_ostream &OS)
Definition MachineBlockFrequencyInfo.h:132
LLVM_ABI PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
MachineFunctionPass(char &ID)
A set of analyses that are preserved following a run of a transformation pass.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
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.
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
LLVM_ABI Printable printBlockFreq(const BlockFrequencyInfo &BFI, BlockFrequency Freq)
Print the block frequency Freq relative to the current functions entry frequency.
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.