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 the IR passes or tests."));
38 cl::desc(
"Force the (profiled-guided) size optimizations. "));
42 cl::desc(
"The profile guided size optimization profile summary cutoff " 43 "for instrumentation profile."));
47 cl::desc(
"The profile guided size optimization profile summary cutoff " 48 "for sample profile."));
51 struct BasicBlockBFIAdapter {
80 return shouldFuncOptimizeForSizeImpl<BasicBlockBFIAdapter>(
F, PSI,
BFI,
87 return shouldOptimizeForSizeImpl<BasicBlockBFIAdapter>(BB, PSI,
BFI,
bool isFunctionColdInCallGraph(const MachineFunction *MF, ProfileSummaryInfo *PSI, const MachineBlockFrequencyInfo &MBFI)
Like ProfileSummaryInfo::isFunctionColdInCallGraph but for MachineFunction.
cl::opt< bool > PGSOLargeWorkingSetSizeOnly("pgso-lwss-only", cl::Hidden, cl::init(true), cl::desc("Apply the profile guided size optimizations only " "if the working set size is large (except for cold code.)"))
This class represents lattice values for constants.
Analysis providing profile information.
cl::opt< int > PgsoCutoffInstrProf("pgso-cutoff-instr-prof", cl::Hidden, cl::init(250000), cl::ZeroOrMore, cl::desc("The profile guided size optimization profile summary cutoff " "for instrumentation profile."))
bool isFunctionHotInCallGraphNthPercentile(int PercentileCutoff, const Function *F, BlockFrequencyInfo &BFI)
Returns true if F contains hot code with regard to a given hot percentile cutoff value.
static bool isHotBlockNthPercentile(int PercentileCutoff, const MachineBasicBlock *MBB, ProfileSummaryInfo *PSI, const MachineBlockFrequencyInfo *MBFI)
Like ProfileSummaryInfo::isHotBlockNthPercentile but for MachineBasicBlock.
cl::opt< bool > PGSOColdCodeOnly("pgso-cold-code-only", cl::Hidden, cl::init(true), cl::desc("Apply the profile guided size optimizations only " "to cold code."))
cl::opt< bool > EnablePGSO("pgso", cl::Hidden, cl::init(true), cl::desc("Enable the profile guided size optimizations. "))
bool isColdBlock(const BasicBlock *BB, BlockFrequencyInfo *BFI)
Returns true if BasicBlock BB is considered cold.
cl::opt< bool > PGSOIRPassOrTestOnly("pgso-ir-pass-or-test-only", cl::Hidden, cl::init(false), cl::desc("Apply the profile guided size optimizations only" "to the IR passes or tests."))
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
initializer< Ty > init(const Ty &Val)
LLVM Basic Block Representation.
bool isHotBlockNthPercentile(int PercentileCutoff, const BasicBlock *BB, BlockFrequencyInfo *BFI)
Returns true if BasicBlock BB is considered hot with regard to a given hot percentile cutoff value...
cl::opt< int > PgsoCutoffSampleProf("pgso-cutoff-sample-prof", cl::Hidden, cl::init(800000), cl::ZeroOrMore, cl::desc("The profile guided size optimization profile summary cutoff " "for sample profile."))
bool isFunctionColdInCallGraph(const Function *F, BlockFrequencyInfo &BFI)
Returns true if F contains only cold code.
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...
cl::opt< bool > ForcePGSO("force-pgso", cl::Hidden, cl::init(false), cl::desc("Force the (profiled-guided) size optimizations. "))
bool isFunctionHotInCallGraphNthPercentile(int PercentileCutoff, const MachineFunction *MF, ProfileSummaryInfo *PSI, const MachineBlockFrequencyInfo &MBFI)
Like ProfileSummaryInfo::isFunctionHotInCallGraphNthPercentile but for MachineFunction.
bool isColdBlock(const MachineBasicBlock *MBB, ProfileSummaryInfo *PSI, const MachineBlockFrequencyInfo *MBFI)
Like ProfileSummaryInfo::isColdBlock but for MachineBasicBlock.