diff options
author | Dehao Chen <dehao@google.com> | 2017-03-10 01:44:37 +0000 |
---|---|---|
committer | Dehao Chen <dehao@google.com> | 2017-03-10 01:44:37 +0000 |
commit | 22645eea7ac2c3c7d014c2f500be36f368647b6e (patch) | |
tree | 3ba7564451c50ea2ae0a0010e922729ee62ec1e2 /llvm | |
parent | 4d86799219c1027ff179824b96a213140b12d448 (diff) | |
download | bcm5719-llvm-22645eea7ac2c3c7d014c2f500be36f368647b6e.tar.gz bcm5719-llvm-22645eea7ac2c3c7d014c2f500be36f368647b6e.zip |
Do not use branch metadata to check if a basic block is hot.
Summary: We should not use that to check basic block hotness as optimization may mess it up.
Reviewers: eraman
Reviewed By: eraman
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D30800
llvm-svn: 297437
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/Analysis/ProfileSummaryInfo.cpp | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/llvm/lib/Analysis/ProfileSummaryInfo.cpp b/llvm/lib/Analysis/ProfileSummaryInfo.cpp index 5ca18303338..623c9fac52a 100644 --- a/llvm/lib/Analysis/ProfileSummaryInfo.cpp +++ b/llvm/lib/Analysis/ProfileSummaryInfo.cpp @@ -124,18 +124,7 @@ bool ProfileSummaryInfo::isColdCount(uint64_t C) { bool ProfileSummaryInfo::isHotBB(const BasicBlock *B, BlockFrequencyInfo *BFI) { auto Count = BFI->getBlockProfileCount(B); - if (Count && isHotCount(*Count)) - return true; - // Use extractProfTotalWeight to get BB count. - // For Sample PGO, BFI may not provide accurate BB count due to errors - // magnified during sample count propagation. This serves as a backup plan - // to ensure all hot BB will not be missed. - // The query currently has false positives as branch instruction cloning does - // not update/scale branch weights. Unlike false negatives, this will not cause - // performance problem. - uint64_t TotalCount; - auto *TI = B->getTerminator(); - return extractProfTotalWeight(TI, TotalCount) && isHotCount(TotalCount); + return Count && isHotCount(*Count); } bool ProfileSummaryInfo::isColdBB(const BasicBlock *B, |