aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ProfileData
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2024-05-28 07:31:29 -0700
committerGitHub <noreply@github.com>2024-05-28 07:31:29 -0700
commitd2a103e682d65c3bfdff1d6a6f7b114e6cf4ff76 (patch)
treeb0fc7f8c8a7f81ee5d9ed63ba0e2e839127ff715 /llvm/lib/ProfileData
parent3864bfd2e0ce7e32fd623c550660885599383e6a (diff)
downloadllvm-d2a103e682d65c3bfdff1d6a6f7b114e6cf4ff76.zip
llvm-d2a103e682d65c3bfdff1d6a6f7b114e6cf4ff76.tar.gz
llvm-d2a103e682d65c3bfdff1d6a6f7b114e6cf4ff76.tar.bz2
[memprof] Remove const from the return type of toMemProfRecord (#93415)
"const" being removed in this patch prevents the move semantics from being used in: AI.CallStack = Callback(IndexedAI.CSId); With this patch on an indexed MemProf Version 2 profile, the cycle count and instruction count go down by 13.3% and 26.3%, respectively, with "llvm-profdata show" modified to deserialize all MemProfRecords.
Diffstat (limited to 'llvm/lib/ProfileData')
-rw-r--r--llvm/lib/ProfileData/MemProf.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/ProfileData/MemProf.cpp b/llvm/lib/ProfileData/MemProf.cpp
index e560864..89afe7c 100644
--- a/llvm/lib/ProfileData/MemProf.cpp
+++ b/llvm/lib/ProfileData/MemProf.cpp
@@ -245,8 +245,8 @@ IndexedMemProfRecord::deserialize(const MemProfSchema &Schema,
}
MemProfRecord IndexedMemProfRecord::toMemProfRecord(
- llvm::function_ref<const llvm::SmallVector<Frame>(const CallStackId)>
- Callback) const {
+ llvm::function_ref<llvm::SmallVector<Frame>(const CallStackId)> Callback)
+ const {
MemProfRecord Record;
Record.AllocSites.reserve(AllocSites.size());