1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

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
This commit is contained in:
Dehao Chen 2017-03-10 01:44:37 +00:00
parent 5cdc61055e
commit fada41d5e0

View File

@ -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,