[all-commits] [llvm/llvm-project] 6ee5ff: [BOLT] Add profile density computation
Amir Ayupov via All-commits
all-commits at lists.llvm.org
Thu Oct 24 18:31:22 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 6ee5ff95abe6ba6dfc4ca3a07a27b796fbf3664e
https://github.com/llvm/llvm-project/commit/6ee5ff95abe6ba6dfc4ca3a07a27b796fbf3664e
Author: Amir Ayupov <aaupov at fb.com>
Date: 2024-10-24 (Thu, 24 Oct 2024)
Changed paths:
M bolt/include/bolt/Core/BinaryFunction.h
M bolt/include/bolt/Utils/CommandLineOpts.h
M bolt/lib/Passes/BinaryPasses.cpp
M bolt/lib/Profile/DataAggregator.cpp
M bolt/lib/Utils/CommandLineOpts.cpp
M bolt/test/X86/pre-aggregated-perf.test
M bolt/tools/driver/llvm-bolt.cpp
Log Message:
-----------
[BOLT] Add profile density computation
Reuse the definition of profile density from llvm-profgen (#92144):
- the density is computed in perf2bolt using raw samples (perf.data or
pre-aggregated data),
- function density is the ratio of dynamically executed function bytes
to the static function size in bytes,
- profile density:
- functions are sorted by density in decreasing order, accumulating
their respective sample counts,
- profile density is the smallest density covering 99% of total sample
count.
In other words, BOLT binary profile density is the minimum amount of
profile information per function (excluding functions in tail 1% sample
count) which is sufficient to optimize the binary well.
The density threshold of 60 was determined through experiments with
large binaries by reducing the sample count and checking resulting
profile density and performance. The threshold is conservative.
perf2bolt would print the warning if the density is below the threshold
and suggest to increase the sampling duration and/or frequency to reach
a given density, e.g.:
```
BOLT-WARNING: BOLT is estimated to optimize better with 2.8x more samples.
```
Test Plan: updated pre-aggregated-perf.test
Reviewers: maksfb, wlei-llvm, rafaelauler, ayermolo, dcci, WenleiHe
Reviewed By: WenleiHe, wlei-llvm
Pull Request: https://github.com/llvm/llvm-project/pull/101094
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list