aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-profdata/llvm-profdata.cpp
diff options
context:
space:
mode:
authorWenlei He <wenlei@fb.com>2021-10-07 21:53:04 -0700
committerWenlei He <wenlei@fb.com>2021-10-10 13:30:18 -0700
commit9978e0e475eb707f4445699dd27bf521c21594e9 (patch)
tree580b88bdba32ae0ee1c41df3f6938bd092272db8 /llvm/tools/llvm-profdata/llvm-profdata.cpp
parentda4e5fc86158c669ddcb335d151fffd7c6e2ed4b (diff)
downloadllvm-9978e0e475eb707f4445699dd27bf521c21594e9.zip
llvm-9978e0e475eb707f4445699dd27bf521c21594e9.tar.gz
llvm-9978e0e475eb707f4445699dd27bf521c21594e9.tar.bz2
[llvm-profdata] Allow overlap/similarity comparison to use custom hot threshold cutoff
Allow overlap/similarity comparison to use custom hot threshold cutoff, instead of using hard coded 990000 as hot cutoff. Differential Revision: https://reviews.llvm.org/D111385
Diffstat (limited to 'llvm/tools/llvm-profdata/llvm-profdata.cpp')
-rw-r--r--llvm/tools/llvm-profdata/llvm-profdata.cpp19
1 files changed, 5 insertions, 14 deletions
diff --git a/llvm/tools/llvm-profdata/llvm-profdata.cpp b/llvm/tools/llvm-profdata/llvm-profdata.cpp
index a153582..7d53b05 100644
--- a/llvm/tools/llvm-profdata/llvm-profdata.cpp
+++ b/llvm/tools/llvm-profdata/llvm-profdata.cpp
@@ -1915,22 +1915,13 @@ std::error_code SampleOverlapAggregator::loadProfiles() {
// Load BaseHotThreshold and TestHotThreshold as 99-percentile threshold in
// profile summary.
- const uint64_t HotCutoff = 990000;
ProfileSummary &BasePS = BaseReader->getSummary();
- for (const auto &SummaryEntry : BasePS.getDetailedSummary()) {
- if (SummaryEntry.Cutoff == HotCutoff) {
- BaseHotThreshold = SummaryEntry.MinCount;
- break;
- }
- }
-
ProfileSummary &TestPS = TestReader->getSummary();
- for (const auto &SummaryEntry : TestPS.getDetailedSummary()) {
- if (SummaryEntry.Cutoff == HotCutoff) {
- TestHotThreshold = SummaryEntry.MinCount;
- break;
- }
- }
+ BaseHotThreshold =
+ ProfileSummaryBuilder::getHotCountThreshold(BasePS.getDetailedSummary());
+ TestHotThreshold =
+ ProfileSummaryBuilder::getHotCountThreshold(TestPS.getDetailedSummary());
+
return std::error_code();
}