13 #ifndef LLVM_TRANSFORMS_UTILS_SIZEOPTS_H 14 #define LLVM_TRANSFORMS_UTILS_SIZEOPTS_H 31 class BlockFrequencyInfo;
33 class ProfileSummaryInfo;
41 template<
typename AdapterT,
typename FuncT,
typename BFIT>
56 if (PGSOColdCodeOnly ||
66 template<
typename AdapterT,
typename BlockT,
typename BFIT>
81 if (PGSOColdCodeOnly ||
105 #endif // LLVM_TRANSFORMS_UTILS_SIZEOPTS_H bool isFunctionColdInCallGraph(const MachineFunction *MF, ProfileSummaryInfo *PSI, const MachineBlockFrequencyInfo &MBFI)
Like ProfileSummaryInfo::isFunctionColdInCallGraph but for MachineFunction.
This class represents lattice values for constants.
llvm::cl::opt< bool > EnablePGSO
Analysis providing profile information.
llvm::cl::opt< bool > PGSOIRPassOrTestOnly
static bool isHotBlockNthPercentile(int PercentileCutoff, const MachineBasicBlock *MBB, ProfileSummaryInfo *PSI, const MachineBlockFrequencyInfo *MBFI)
Like ProfileSummaryInfo::isHotBlockNthPercentile but for MachineBasicBlock.
llvm::cl::opt< int > PgsoCutoffInstrProf
bool shouldFuncOptimizeForSizeImpl(const FuncT *F, ProfileSummaryInfo *PSI, BFIT *BFI, PGSOQueryType QueryType)
bool hasLargeWorkingSetSize()
Returns true if the working set size of the code is considered large.
bool hasProfileSummary()
Returns true if profile summary is available.
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
LLVM Basic Block Representation.
bool hasSampleProfile()
Returns true if module M has sample profile.
llvm::cl::opt< bool > PGSOLargeWorkingSetSizeOnly
llvm::cl::opt< bool > ForcePGSO
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 isFunctionHotInCallGraphNthPercentile(int PercentileCutoff, const MachineFunction *MF, ProfileSummaryInfo *PSI, const MachineBlockFrequencyInfo &MBFI)
Like ProfileSummaryInfo::isFunctionHotInCallGraphNthPercentile but for MachineFunction.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::cl::opt< int > PgsoCutoffSampleProf
bool isColdBlock(const MachineBasicBlock *MBB, ProfileSummaryInfo *PSI, const MachineBlockFrequencyInfo *MBFI)
Like ProfileSummaryInfo::isColdBlock but for MachineBasicBlock.
bool shouldOptimizeForSizeImpl(const BlockT *BB, ProfileSummaryInfo *PSI, BFIT *BFI, PGSOQueryType QueryType)
llvm::cl::opt< bool > PGSOColdCodeOnly