[llvm] e09245b - [memprof] Fix typos in serializedSizeV0 and serializedSizeV2 (#88629)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 15 10:01:01 PDT 2024
Author: Kazu Hirata
Date: 2024-04-15T10:00:56-07:00
New Revision: e09245b3b16fe78e30e79e92f8ce16d1edf7787b
URL: https://github.com/llvm/llvm-project/commit/e09245b3b16fe78e30e79e92f8ce16d1edf7787b
DIFF: https://github.com/llvm/llvm-project/commit/e09245b3b16fe78e30e79e92f8ce16d1edf7787b.diff
LOG: [memprof] Fix typos in serializedSizeV0 and serializedSizeV2 (#88629)
The first field to serialize is the size of
IndexedMemProfRecord::AllocSites. It has nothing to do with
GlobalValue::GUID. This happens to work because of:
using GUID = uint64_t;
Added:
Modified:
llvm/lib/ProfileData/MemProf.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ProfileData/MemProf.cpp b/llvm/lib/ProfileData/MemProf.cpp
index 96aeedf2e6913e..97414505f1c134 100644
--- a/llvm/lib/ProfileData/MemProf.cpp
+++ b/llvm/lib/ProfileData/MemProf.cpp
@@ -42,7 +42,8 @@ size_t IndexedAllocationInfo::serializedSize(IndexedVersion Version) const {
}
static size_t serializedSizeV0(const IndexedMemProfRecord &Record) {
- size_t Result = sizeof(GlobalValue::GUID);
+ // The number of alloc sites to serialize.
+ size_t Result = sizeof(uint64_t);
for (const IndexedAllocationInfo &N : Record.AllocSites)
Result += N.serializedSize(Version0);
@@ -57,7 +58,8 @@ static size_t serializedSizeV0(const IndexedMemProfRecord &Record) {
}
static size_t serializedSizeV2(const IndexedMemProfRecord &Record) {
- size_t Result = sizeof(GlobalValue::GUID);
+ // The number of alloc sites to serialize.
+ size_t Result = sizeof(uint64_t);
for (const IndexedAllocationInfo &N : Record.AllocSites)
Result += N.serializedSize(Version2);
More information about the llvm-commits
mailing list