summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ProfileSummaryInfo.cpp
diff options
context:
space:
mode:
authorWei Mi <wmi@google.com>2018-08-07 18:13:10 +0000
committerWei Mi <wmi@google.com>2018-08-07 18:13:10 +0000
commitb1ef2cc53d057123e20b55f806bf2c82861b5967 (patch)
treee20991118b5bde0459848312d4ccdb28cdb52c82 /llvm/lib/Analysis/ProfileSummaryInfo.cpp
parent9ba51579fb331697c09441fdb1f77f267ff82c77 (diff)
downloadbcm5719-llvm-b1ef2cc53d057123e20b55f806bf2c82861b5967.tar.gz
bcm5719-llvm-b1ef2cc53d057123e20b55f806bf2c82861b5967.zip
[SampleFDO] Fix a bug in getOrCompHotCountThreshold/getOrCompColdCountThreshold
getOrCompHotCountThreshold/getOrCompColdCountThreshold introduced in https://reviews.llvm.org/D45377 contain a bad mistake and will only return 1 or 0 instead of the true hot/cold cutoff value. The patch fixes the mistake. But the mistake seems not causing big performance difference according to internal server benchmarks testing. Differential Revision: https://reviews.llvm.org/D50370 llvm-svn: 339162
Diffstat (limited to 'llvm/lib/Analysis/ProfileSummaryInfo.cpp')
-rw-r--r--llvm/lib/Analysis/ProfileSummaryInfo.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ProfileSummaryInfo.cpp b/llvm/lib/Analysis/ProfileSummaryInfo.cpp
index fb591f5d6a6..aeaa5172b3e 100644
--- a/llvm/lib/Analysis/ProfileSummaryInfo.cpp
+++ b/llvm/lib/Analysis/ProfileSummaryInfo.cpp
@@ -226,13 +226,13 @@ bool ProfileSummaryInfo::isColdCount(uint64_t C) {
uint64_t ProfileSummaryInfo::getOrCompHotCountThreshold() {
if (!HotCountThreshold)
computeThresholds();
- return HotCountThreshold && HotCountThreshold.getValue();
+ return HotCountThreshold ? HotCountThreshold.getValue() : UINT64_MAX;
}
uint64_t ProfileSummaryInfo::getOrCompColdCountThreshold() {
if (!ColdCountThreshold)
computeThresholds();
- return ColdCountThreshold && ColdCountThreshold.getValue();
+ return ColdCountThreshold ? ColdCountThreshold.getValue() : 0;
}
bool ProfileSummaryInfo::isHotBB(const BasicBlock *B, BlockFrequencyInfo *BFI) {
OpenPOWER on IntegriCloud