summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis/ModuleSummaryAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/ModuleSummaryAnalysis.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
index 9293f603479..4a84816f616 100644
--- a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
+++ b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
@@ -279,17 +279,9 @@ computeFunctionSummary(ModuleSummaryIndex &Index, const Module &M,
// Add the relative block frequency to CalleeInfo if there is no profile
// information.
if (BFI != nullptr && Hotness == CalleeInfo::HotnessType::Unknown) {
- auto BBFreq = BFI->getBlockFreq(&BB).getFrequency();
- // FIXME: This might need some scaling to prevent BBFreq values from
- // being rounded down to 0.
- auto EntryFreq = BFI->getEntryFreq();
- // Block frequencies can be directly set for a block and so we need to
- // handle the case of entry frequency being 0.
- if (EntryFreq)
- BBFreq /= EntryFreq;
- else
- BBFreq = 0;
- ValueInfo.updateRelBlockFreq(BBFreq);
+ uint64_t BBFreq = BFI->getBlockFreq(&BB).getFrequency();
+ uint64_t EntryFreq = BFI->getEntryFreq();
+ ValueInfo.updateRelBlockFreq(BBFreq, EntryFreq);
}
} else {
// Skip inline assembly calls.
OpenPOWER on IntegriCloud