LLVM: include/llvm/Transforms/Utils/SizeOpts.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_TRANSFORMS_UTILS_SIZEOPTS_H
14#define LLVM_TRANSFORMS_UTILS_SIZEOPTS_H
15
19
20namespace llvm {
30
34
40
50
51template <typename FuncT, typename BFIT>
56 return false;
58 return true;
60 return false;
64
65
67 *BFI);
69 *BFI);
70}
71
72template <typename BlockTOrBlockFreq, typename BFIT>
77 return false;
79 return true;
81 return false;
83 return PSI->isColdBlock(BBOrBlockFreq, BFI);
85
86
88 BFI);
90}
91
92
93
96 BlockFrequencyInfo *BFI,
98
99
100
103 BlockFrequencyInfo *BFI,
105
106}
107
108#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
LLVM Basic Block Representation.
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
Analysis providing profile information.
bool hasProfileSummary() const
Returns true if profile summary is available.
bool isHotBlockNthPercentile(int PercentileCutoff, const BBType *BB, BFIT *BFI) const
bool isFunctionColdInCallGraph(const FuncT *F, BFIT &BFI) const
Returns true if F contains only cold code.
bool hasInstrumentationProfile() const
Returns true if module M has instrumentation profile.
bool isFunctionColdInCallGraphNthPercentile(int PercentileCutoff, const FuncT *F, BFIT &BFI) const
Returns true if F contains cold code with regard to a given cold percentile cutoff value.
bool hasSampleProfile() const
Returns true if module M has sample profile.
bool isColdBlock(const BBType *BB, BFIT *BFI) const
Returns true if BasicBlock BB is considered cold.
bool isFunctionHotInCallGraphNthPercentile(int PercentileCutoff, const FuncT *F, BFIT &BFI) const
Returns true if F contains hot code with regard to a given hot percentile cutoff value.
LLVM_ABI bool hasPartialSampleProfile() const
Returns true if module M has partial-profile sample profile.
LLVM_ABI bool hasLargeWorkingSetSize() const
Returns true if the working set size of the code is considered large.
bool isColdBlockNthPercentile(int PercentileCutoff, const BBType *BB, BFIT *BFI) const
Returns true if BasicBlock BB is considered cold with regard to a given cold percentile cutoff value.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI cl::opt< bool > PGSOColdCodeOnlyForSamplePGO
LLVM_ABI cl::opt< bool > PGSOColdCodeOnlyForInstrPGO
LLVM_ABI bool shouldOptimizeForSize(const MachineFunction *MF, ProfileSummaryInfo *PSI, const MachineBlockFrequencyInfo *BFI, PGSOQueryType QueryType=PGSOQueryType::Other)
Returns true if machine function MF is suggested to be size-optimized based on the profile.
bool shouldFuncOptimizeForSizeImpl(const FuncT *F, ProfileSummaryInfo *PSI, BFIT *BFI, PGSOQueryType QueryType)
Definition SizeOpts.h:52
LLVM_ABI cl::opt< int > PgsoCutoffSampleProf
LLVM_ABI cl::opt< bool > EnablePGSO
LLVM_ABI cl::opt< bool > PGSOColdCodeOnlyForPartialSamplePGO
LLVM_ABI cl::opt< int > PgsoCutoffInstrProf
bool shouldOptimizeForSizeImpl(BlockTOrBlockFreq BBOrBlockFreq, ProfileSummaryInfo *PSI, BFIT *BFI, PGSOQueryType QueryType)
Definition SizeOpts.h:73
LLVM_ABI cl::opt< bool > ForcePGSO
LLVM_ABI cl::opt< bool > PGSOLargeWorkingSetSizeOnly
PGSOQueryType
Definition SizeOpts.h:35
@ IRPass
Definition SizeOpts.h:36
@ Test
Definition SizeOpts.h:37
@ Other
Definition SizeOpts.h:38
static bool isPGSOColdCodeOnly(ProfileSummaryInfo *PSI)
Definition SizeOpts.h:41
LLVM_ABI cl::opt< bool > PGSOColdCodeOnly