diff options
Diffstat (limited to 'llvm/lib/Analysis/ProfileSummaryInfo.cpp')
-rw-r--r-- | llvm/lib/Analysis/ProfileSummaryInfo.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ProfileSummaryInfo.cpp b/llvm/lib/Analysis/ProfileSummaryInfo.cpp index bd8459ddb82..4326e53b43b 100644 --- a/llvm/lib/Analysis/ProfileSummaryInfo.cpp +++ b/llvm/lib/Analysis/ProfileSummaryInfo.cpp @@ -261,7 +261,14 @@ bool ProfileSummaryInfo::isHotBlock(const BasicBlock *BB, BlockFrequencyInfo *BF bool ProfileSummaryInfo::isColdBlock(const BasicBlock *BB, BlockFrequencyInfo *BFI) { auto Count = BFI->getBlockProfileCount(BB); - return Count && isColdCount(*Count); + if (Count) + return isColdCount(*Count); + if (!hasSampleProfile()) + return false; + + const Function *F = BB->getParent(); + return ProfileSampleAccurate || + (F && F->hasFnAttribute("profile-sample-accurate")); } bool ProfileSummaryInfo::isHotCallSite(const CallSite &CS, |