|
LLVM
10.0.0
|
Analysis providing profile information. More...
#include "llvm/Analysis/ProfileSummaryInfo.h"
Public Member Functions | |
| ProfileSummaryInfo (Module &M) | |
| ProfileSummaryInfo (ProfileSummaryInfo &&Arg) | |
| bool | hasProfileSummary () |
| Returns true if profile summary is available. More... | |
| bool | hasSampleProfile () |
Returns true if module M has sample profile. More... | |
| bool | hasInstrumentationProfile () |
Returns true if module M has instrumentation profile. More... | |
| bool | hasCSInstrumentationProfile () |
Returns true if module M has context sensitive instrumentation profile. More... | |
| bool | invalidate (Module &, const PreservedAnalyses &, ModuleAnalysisManager::Invalidator &) |
| Handle the invalidation of this information. More... | |
| Optional< uint64_t > | getProfileCount (const Instruction *CallInst, BlockFrequencyInfo *BFI, bool AllowSynthetic=false) |
Returns the profile count for CallInst. More... | |
| bool | hasHugeWorkingSetSize () |
| Returns true if the working set size of the code is considered huge. More... | |
| bool | hasLargeWorkingSetSize () |
| Returns true if the working set size of the code is considered large. More... | |
| bool | isFunctionEntryHot (const Function *F) |
Returns true if F has hot function entry. More... | |
| bool | isFunctionHotInCallGraph (const Function *F, BlockFrequencyInfo &BFI) |
Returns true if F contains hot code. More... | |
| bool | isFunctionEntryCold (const Function *F) |
Returns true if F has cold function entry. More... | |
| bool | isFunctionColdInCallGraph (const Function *F, BlockFrequencyInfo &BFI) |
Returns true if F contains only cold code. More... | |
| 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. More... | |
| bool | isHotCount (uint64_t C) |
Returns true if count C is considered hot. More... | |
| bool | isColdCount (uint64_t C) |
Returns true if count C is considered cold. More... | |
| bool | isHotCountNthPercentile (int PercentileCutoff, uint64_t C) |
Returns true if count C is considered hot with regard to a given hot percentile cutoff value. More... | |
| bool | isHotBlock (const BasicBlock *BB, BlockFrequencyInfo *BFI) |
Returns true if BasicBlock BB is considered hot. More... | |
| bool | isColdBlock (const BasicBlock *BB, BlockFrequencyInfo *BFI) |
Returns true if BasicBlock BB is considered cold. More... | |
| 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. More... | |
| bool | isHotCallSite (const CallSite &CS, BlockFrequencyInfo *BFI) |
Returns true if CallSite CS is considered hot. More... | |
| bool | isColdCallSite (const CallSite &CS, BlockFrequencyInfo *BFI) |
Returns true if Callsite CS is considered cold. More... | |
| uint64_t | getOrCompHotCountThreshold () |
| Returns HotCountThreshold if set. More... | |
| uint64_t | getOrCompColdCountThreshold () |
| Returns ColdCountThreshold if set. More... | |
| uint64_t | getHotCountThreshold () |
| Returns HotCountThreshold if set. More... | |
| uint64_t | getColdCountThreshold () |
| Returns ColdCountThreshold if set. More... | |
Analysis providing profile information.
This is an immutable analysis pass that provides ability to query global (program-level) profile information. The main APIs are isHotCount and isColdCount that tells whether a given profile count is considered hot/cold based on the profile summary. This also provides convenience methods to check whether a function is hot or cold.
Definition at line 43 of file ProfileSummaryInfo.h.
|
inline |
Definition at line 66 of file ProfileSummaryInfo.h.
Referenced by llvm::ProfileSummaryInfoWrapperPass::doInitialization(), and llvm::ProfileSummaryAnalysis::run().
|
inline |
Definition at line 67 of file ProfileSummaryInfo.h.
|
inline |
Returns ColdCountThreshold if set.
Definition at line 153 of file ProfileSummaryInfo.h.
References llvm::Optional< T >::getValue().
|
inline |
Returns HotCountThreshold if set.
Definition at line 149 of file ProfileSummaryInfo.h.
References llvm::Optional< T >::getValue().
| uint64_t ProfileSummaryInfo::getOrCompColdCountThreshold | ( | ) |
Returns ColdCountThreshold if set.
Recompute HotCountThreshold if not set.
Definition at line 313 of file ProfileSummaryInfo.cpp.
References llvm::Optional< T >::getValue().
Referenced by invalidate().
| uint64_t ProfileSummaryInfo::getOrCompHotCountThreshold | ( | ) |
Returns HotCountThreshold if set.
Recompute HotCountThreshold if not set.
Definition at line 307 of file ProfileSummaryInfo.cpp.
References llvm::Optional< T >::getValue(), and UINT64_MAX.
Referenced by invalidate().
| Optional< uint64_t > ProfileSummaryInfo::getProfileCount | ( | const Instruction * | CallInst, |
| BlockFrequencyInfo * | BFI, | ||
| bool | AllowSynthetic = false |
||
| ) |
Returns the profile count for CallInst.
Definition at line 105 of file ProfileSummaryInfo.cpp.
References assert(), llvm::Instruction::extractProfTotalWeight(), llvm::BlockFrequencyInfo::getBlockProfileCount(), llvm::Instruction::getParent(), hasSampleProfile(), and llvm::None.
Referenced by computeFunctionSummary(), invalidate(), isColdCallSite(), isFunctionColdInCallGraph(), isFunctionHotInCallGraph(), isFunctionHotInCallGraphNthPercentile(), isHotCallSite(), and updateCallProfile().
|
inline |
Returns true if module M has context sensitive instrumentation profile.
Definition at line 86 of file ProfileSummaryInfo.h.
References hasProfileSummary(), and llvm::ProfileSummary::PSK_CSInstr.
| bool ProfileSummaryInfo::hasHugeWorkingSetSize | ( | ) |
Returns true if the working set size of the code is considered huge.
Definition at line 278 of file ProfileSummaryInfo.cpp.
References llvm::Optional< T >::getValue().
Referenced by invalidate(), and llvm::LoopUnrollPass::run().
|
inline |
Returns true if module M has instrumentation profile.
Definition at line 80 of file ProfileSummaryInfo.h.
References hasProfileSummary(), and llvm::ProfileSummary::PSK_Instr.
| bool ProfileSummaryInfo::hasLargeWorkingSetSize | ( | ) |
Returns true if the working set size of the code is considered large.
Definition at line 284 of file ProfileSummaryInfo.cpp.
References llvm::Optional< T >::getValue().
Referenced by invalidate(), llvm::shouldFuncOptimizeForSizeImpl(), and llvm::shouldOptimizeForSizeImpl().
|
inline |
Returns true if profile summary is available.
Definition at line 71 of file ProfileSummaryInfo.h.
Referenced by eliminateLoadsAcrossLoops(), hasCSInstrumentationProfile(), hasInstrumentationProfile(), hasSampleProfile(), llvm::pgo::promoteIndirectCall(), llvm::LoopLoadEliminationPass::run(), llvm::InstCombinePass::run(), llvm::LoopUnrollPass::run(), llvm::InstructionCombiningPass::runOnFunction(), llvm::AsmPrinter::SetupMachineFunction(), shouldApply(), llvm::shouldFuncOptimizeForSizeImpl(), and llvm::shouldOptimizeForSizeImpl().
|
inline |
Returns true if module M has sample profile.
Definition at line 74 of file ProfileSummaryInfo.h.
References hasProfileSummary(), and llvm::ProfileSummary::PSK_Sample.
Referenced by getProfileCount(), isColdCallSite(), isFunctionColdInCallGraph(), isFunctionHotInCallGraph(), isFunctionHotInCallGraphNthPercentile(), llvm::shouldFuncOptimizeForSizeImpl(), and llvm::shouldOptimizeForSizeImpl().
|
inline |
Handle the invalidation of this information.
When used as a result of ProfileSummaryAnalysis this method will be called when the module this was computed for changes. Since profile summary is immutable after it is annotated on the module, we return false here.
Definition at line 97 of file ProfileSummaryInfo.h.
References llvm::AMDGPUISD::BFI, C, F(), getOrCompColdCountThreshold(), getOrCompHotCountThreshold(), getProfileCount(), hasHugeWorkingSetSize(), hasLargeWorkingSetSize(), isColdBlock(), isColdCallSite(), isColdCount(), isFunctionColdInCallGraph(), isFunctionEntryCold(), isFunctionEntryHot(), isFunctionHotInCallGraph(), isFunctionHotInCallGraphNthPercentile(), isHotBlock(), isHotBlockNthPercentile(), isHotCallSite(), isHotCount(), and isHotCountNthPercentile().
| bool ProfileSummaryInfo::isColdBlock | ( | const BasicBlock * | BB, |
| BlockFrequencyInfo * | BFI | ||
| ) |
Returns true if BasicBlock BB is considered cold.
Definition at line 324 of file ProfileSummaryInfo.cpp.
References llvm::BlockFrequencyInfo::getBlockProfileCount(), and isColdCount().
Referenced by invalidate(), and isFunctionColdInCallGraph().
| bool ProfileSummaryInfo::isColdCallSite | ( | const CallSite & | CS, |
| BlockFrequencyInfo * | BFI | ||
| ) |
Returns true if Callsite CS is considered cold.
Definition at line 343 of file ProfileSummaryInfo.cpp.
References llvm::AMDGPUISD::BFI, C, llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::getCaller(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::getInstruction(), getProfileCount(), llvm::Function::hasProfileData(), hasSampleProfile(), and isColdCount().
Referenced by invalidate().
| bool ProfileSummaryInfo::isColdCount | ( | uint64_t | C | ) |
Returns true if count C is considered cold.
Definition at line 296 of file ProfileSummaryInfo.cpp.
References llvm::Optional< T >::getValue().
Referenced by getHotness(), invalidate(), machine_size_opts_detail::isColdBlock(), isColdBlock(), isColdCallSite(), machine_size_opts_detail::isFunctionColdInCallGraph(), isFunctionColdInCallGraph(), isFunctionEntryCold(), and sumEdgeCount().
| bool ProfileSummaryInfo::isFunctionColdInCallGraph | ( | const Function * | F, |
| BlockFrequencyInfo & | BFI | ||
| ) |
Returns true if F contains only cold code.
Returns true if the function only contains cold code.
This means that the function entry and blocks are all cold, and (in the case of Sample PGO) the total call edge count is cold. If it returns false, it either means it is not cold or it is unknown (for example, no profile data is available).
Definition at line 174 of file ProfileSummaryInfo.cpp.
References llvm::Function::getEntryCount(), getProfileCount(), hasSampleProfile(), I, isColdBlock(), and isColdCount().
Referenced by invalidate().
Returns true if F has cold function entry.
Returns true if the function's entry is a cold.
If it returns false, it either means it is not cold or it is unknown whether it is cold or not (for example, no profile data is available).
Definition at line 226 of file ProfileSummaryInfo.cpp.
References assert(), llvm::CallingConv::Cold, CountThreshold, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), llvm::Function::getEntryCount(), getEntryForPercentile(), llvm::Function::hasFnAttribute(), isColdCount(), llvm::None, ProfileSummaryColdCount, ProfileSummaryCutoffCold, ProfileSummaryCutoffHot, ProfileSummaryHotCount, ProfileSummaryHugeWorkingSetSizeThreshold, and ProfileSummaryLargeWorkingSetSizeThreshold.
Referenced by invalidate(), and llvm::ProfileSummaryPrinterPass::run().
Returns true if F has hot function entry.
Returns true if the function's entry is hot.
If it returns false, it either means it is not hot or it is unknown whether it is hot or not (for example, no profile data is available).
Definition at line 130 of file ProfileSummaryInfo.cpp.
References llvm::Function::getEntryCount(), and isHotCount().
Referenced by invalidate(), llvm::ProfileSummaryPrinterPass::run(), and shouldApply().
| bool ProfileSummaryInfo::isFunctionHotInCallGraph | ( | const Function * | F, |
| BlockFrequencyInfo & | BFI | ||
| ) |
Returns true if F contains hot code.
Returns true if the function contains hot code.
This can include a hot function entry count, hot basic block, or (in the case of Sample PGO) hot total call edge count. If it returns false, it either means it is not hot or it is unknown (for example, no profile data is available).
Definition at line 145 of file ProfileSummaryInfo.cpp.
References llvm::Function::getEntryCount(), getProfileCount(), hasSampleProfile(), I, isHotBlock(), and isHotCount().
Referenced by invalidate().
| bool ProfileSummaryInfo::isFunctionHotInCallGraphNthPercentile | ( | int | PercentileCutoff, |
| const Function * | F, | ||
| BlockFrequencyInfo & | BFI | ||
| ) |
Returns true if F contains hot code with regard to a given hot percentile cutoff value.
Definition at line 199 of file ProfileSummaryInfo.cpp.
References llvm::Function::getEntryCount(), getProfileCount(), hasSampleProfile(), I, isHotBlockNthPercentile(), and isHotCountNthPercentile().
Referenced by invalidate().
| bool ProfileSummaryInfo::isHotBlock | ( | const BasicBlock * | BB, |
| BlockFrequencyInfo * | BFI | ||
| ) |
Returns true if BasicBlock BB is considered hot.
Definition at line 319 of file ProfileSummaryInfo.cpp.
References llvm::BlockFrequencyInfo::getBlockProfileCount(), and isHotCount().
Referenced by invalidate(), and isFunctionHotInCallGraph().
| bool ProfileSummaryInfo::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.
Definition at line 330 of file ProfileSummaryInfo.cpp.
References llvm::BlockFrequencyInfo::getBlockProfileCount(), and isHotCountNthPercentile().
Referenced by invalidate(), and isFunctionHotInCallGraphNthPercentile().
| bool ProfileSummaryInfo::isHotCallSite | ( | const CallSite & | CS, |
| BlockFrequencyInfo * | BFI | ||
| ) |
Returns true if CallSite CS is considered hot.
Definition at line 337 of file ProfileSummaryInfo.cpp.
References llvm::AMDGPUISD::BFI, C, llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::getInstruction(), getProfileCount(), and isHotCount().
Referenced by invalidate().
| bool ProfileSummaryInfo::isHotCount | ( | uint64_t | C | ) |
Returns true if count C is considered hot.
Definition at line 290 of file ProfileSummaryInfo.cpp.
References llvm::Optional< T >::getValue().
Referenced by getHotness(), invalidate(), isFunctionEntryHot(), isFunctionHotInCallGraph(), isHotBlock(), isHotCallSite(), llvm::pgo::promoteIndirectCall(), and sumEdgeCount().
| bool ProfileSummaryInfo::isHotCountNthPercentile | ( | int | PercentileCutoff, |
| uint64_t | C | ||
| ) |
Returns true if count C is considered hot with regard to a given hot percentile cutoff value.
Definition at line 302 of file ProfileSummaryInfo.cpp.
References CountThreshold.
Referenced by invalidate(), machine_size_opts_detail::isFunctionHotInCallGraphNthPercentile(), isFunctionHotInCallGraphNthPercentile(), machine_size_opts_detail::isHotBlockNthPercentile(), and isHotBlockNthPercentile().
1.8.13