mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-21 03:05:26 -04:00
[PGO] Change hardcoded thresholds for cold/inlinehint to use summary
Summary: The PGO counter reading will add cold and inlinehint (hot) attributes to functions that are very cold or hot. This was using hardcoded thresholds, instead of the profile summary cutoffs which are used in other hot/cold detection and are more dynamic and adaptable. Switch to using the summary-based cold/hot detection. The hardcoded limits were causing some code that had a medium level of hotness (per the summary) to be incorrectly marked with a cold attribute, blocking inlining. Reviewers: davidxl Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67673 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372189 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -783,13 +783,13 @@ IndexedInstrProfReader::readSummary(IndexedInstrProf::ProfVersion Version,
|
||||
SummaryData->get(Summary::TotalNumFunctions));
|
||||
return Cur + SummarySize;
|
||||
} else {
|
||||
// For older version of profile data, we need to compute on the fly:
|
||||
using namespace IndexedInstrProf;
|
||||
|
||||
// The older versions do not support a profile summary. This just computes
|
||||
// an empty summary, which will not result in accurate hot/cold detection.
|
||||
// We would need to call addRecord for all NamedInstrProfRecords to get the
|
||||
// correct summary. However, this version is old (prior to early 2016) and
|
||||
// has not been supporting an accurate summary for several years.
|
||||
InstrProfSummaryBuilder Builder(ProfileSummaryBuilder::DefaultCutoffs);
|
||||
// FIXME: This only computes an empty summary. Need to call addRecord for
|
||||
// all NamedInstrProfRecords to get the correct summary.
|
||||
this->Summary = Builder.getSummary();
|
||||
Summary = Builder.getSummary();
|
||||
return Cur;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user