20 cl::desc(
"Enable the profile guided size optimizations. "));
24 cl::desc(
"Apply the profile guided size optimizations only "
25 "if the working set size is large (except for cold code.)"));
29 cl::desc(
"Apply the profile guided size optimizations only "
34 cl::desc(
"Apply the profile guided size optimizations only "
35 "to cold code under instrumentation PGO."));
39 cl::desc(
"Apply the profile guided size optimizations only "
40 "to cold code under sample PGO."));
44 cl::desc(
"Apply the profile guided size optimizations only "
45 "to cold code under partial-profile sample PGO."));
49 cl::desc(
"Force the (profiled-guided) size optimizations. "));
53 cl::desc(
"The profile guided size optimization profile summary cutoff "
54 "for instrumentation profile."));
58 cl::desc(
"The profile guided size optimization profile summary cutoff "
59 "for sample profile."));
62struct BasicBlockBFIAdapter {
63 static bool isFunctionColdInCallGraph(
const Function *
F,
68 static bool isFunctionHotInCallGraphNthPercentile(
int CutOff,
74 static bool isFunctionColdInCallGraphNthPercentile(
int CutOff,
85 static bool isHotBlockNthPercentile(
int CutOff,
91 static bool isColdBlockNthPercentile(
int CutOff,
const BasicBlock *BB,
static bool isColdBlock(const MachineBasicBlock &MBB, const MachineBlockFrequencyInfo *MBFI, ProfileSummaryInfo *PSI)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Basic Block Representation.
const Function * getParent() const
Return the enclosing method, or null if none.
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
bool hasOptSize() const
Optimize this function for size (-Os) or minimum size (-Oz).
Analysis providing profile information.
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 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 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.
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.
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
cl::opt< bool > PGSOColdCodeOnlyForSamplePGO
cl::opt< bool > PGSOColdCodeOnlyForInstrPGO
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)
cl::opt< int > PgsoCutoffSampleProf
cl::opt< bool > EnablePGSO
cl::opt< bool > PGSOColdCodeOnlyForPartialSamplePGO
cl::opt< int > PgsoCutoffInstrProf
bool shouldOptimizeForSizeImpl(BlockTOrBlockFreq BBOrBlockFreq, ProfileSummaryInfo *PSI, BFIT *BFI, PGSOQueryType QueryType)
cl::opt< bool > ForcePGSO
cl::opt< bool > PGSOLargeWorkingSetSizeOnly
cl::opt< bool > PGSOColdCodeOnly