Go to the documentation of this file.
19 cl::desc(
"Enable the profile guided size optimizations. "));
23 cl::desc(
"Apply the profile guided size optimizations only "
24 "if the working set size is large (except for cold code.)"));
28 cl::desc(
"Apply the profile guided size optimizations only "
33 cl::desc(
"Apply the profile guided size optimizations only "
34 "to cold code under instrumentation PGO."));
38 cl::desc(
"Apply the profile guided size optimizations only "
39 "to cold code under sample PGO."));
43 cl::desc(
"Apply the profile guided size optimizations only "
44 "to cold code under partial-profile sample PGO."));
48 cl::desc(
"Force the (profiled-guided) size optimizations. "));
52 cl::desc(
"The profile guided size optimization profile summary cutoff "
53 "for instrumentation profile."));
57 cl::desc(
"The profile guided size optimization profile summary cutoff "
58 "for sample profile."));
61 struct BasicBlockBFIAdapter {
62 static bool isFunctionColdInCallGraph(
const Function *
F,
67 static bool isFunctionHotInCallGraphNthPercentile(
int CutOff,
73 static bool isFunctionColdInCallGraphNthPercentile(
int CutOff,
84 static bool isHotBlockNthPercentile(
int CutOff,
90 static bool isColdBlockNthPercentile(
int CutOff,
const BasicBlock *
BB,
101 return shouldFuncOptimizeForSizeImpl<BasicBlockBFIAdapter>(
F, PSI,
BFI,
109 return shouldOptimizeForSizeImpl<BasicBlockBFIAdapter>(
BB, PSI,
BFI,
This is an optimization pass for GlobalISel generic memory operations.
bool isColdBlockNthPercentile(int PercentileCutoff, const BasicBlock *BB, BlockFrequencyInfo *BFI) const
Returns true if BasicBlock BB is considered cold with regard to a given cold percentile cutoff value.
cl::opt< bool > EnablePGSO
cl::opt< bool > PGSOColdCodeOnlyForInstrPGO
LLVM Basic Block Representation.
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
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 isHotBlockNthPercentile(int PercentileCutoff, const BasicBlock *BB, BlockFrequencyInfo *BFI) const
Returns true if BasicBlock BB is considered hot with regard to a given hot percentile cutoff value.
cl::opt< bool > PGSOColdCodeOnlyForSamplePGO
Analysis providing profile information.
cl::opt< int > PgsoCutoffInstrProf
bool isFunctionHotInCallGraphNthPercentile(int PercentileCutoff, const Function *F, BlockFrequencyInfo &BFI) const
Returns true if F contains hot code with regard to a given hot percentile cutoff value.
initializer< Ty > init(const Ty &Val)
cl::opt< bool > ForcePGSO
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static bool isColdBlock(const MachineBasicBlock &MBB, const MachineBlockFrequencyInfo *MBFI, ProfileSummaryInfo *PSI)
bool isFunctionColdInCallGraphNthPercentile(int PercentileCutoff, const Function *F, BlockFrequencyInfo &BFI) const
Returns true if F contains cold code with regard to a given cold percentile cutoff value.
cl::opt< bool > PGSOLargeWorkingSetSizeOnly
cl::opt< bool > PGSOColdCodeOnly
bool isFunctionColdInCallGraph(const Function *F, BlockFrequencyInfo &BFI) const
Returns true if F contains only cold code.
bool isColdBlock(const BasicBlock *BB, BlockFrequencyInfo *BFI) const
Returns true if BasicBlock BB is considered cold.
Common register allocation spilling lr str ldr sxth r3 ldr mla r4 can lr mov lr str ldr sxth r3 mla r4 and then merge mul and lr str ldr sxth r3 mla r4 It also increase the likelihood the store may become dead bb27 Successors according to LLVM BB
cl::opt< int > PgsoCutoffSampleProf
cl::opt< bool > PGSOColdCodeOnlyForPartialSamplePGO