13#ifndef LLVM_TRANSFORMS_UTILS_SIZEOPTS_H
14#define LLVM_TRANSFORMS_UTILS_SIZEOPTS_H
51template <
typename FuncT,
typename BFIT>
72template <
typename BlockTOrBlockFreq,
typename BFIT>
96 BlockFrequencyInfo *BFI,
103 BlockFrequencyInfo *BFI,
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)
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)
LLVM_ABI cl::opt< bool > ForcePGSO
LLVM_ABI cl::opt< bool > PGSOLargeWorkingSetSizeOnly
static bool isPGSOColdCodeOnly(ProfileSummaryInfo *PSI)
LLVM_ABI cl::opt< bool > PGSOColdCodeOnly