mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-19 15:13:49 -04:00
[ThinLTO] Represent relative BF using a scaled representation .
Summary: The current integer representation of relative block frequency prevents representing relative block frequencies below 1. This change uses a 8 of the 29 bits to represent the decimal part by using a fixed scale of -8. Reviewers: tejohnson, davidxl Subscribers: mehdi_amini, inglorion, llvm-commits Differential Revision: https://reviews.llvm.org/D43520 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325823 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user