[llvm] [memprof] Use uint32_t for linear call stack IDs (PR #93924)

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Fri May 31 06:43:19 PDT 2024


================
@@ -89,15 +100,30 @@ static size_t serializedSizeV2(const IndexedMemProfRecord &Record,
   return Result;
 }
 
+static size_t serializedSizeV3(const IndexedMemProfRecord &Record,
+                               const MemProfSchema &Schema) {
+  // The number of alloc sites to serialize.
+  size_t Result = sizeof(uint64_t);
+  for (const IndexedAllocationInfo &N : Record.AllocSites)
+    Result += N.serializedSize(Schema, Version3);
+
+  // The number of callsites we have information for.
+  Result += sizeof(uint64_t);
+  // The linear call stack ID.
+  Result += Record.CallSiteIds.size() * sizeof(uint32_t);
----------------
teresajohnson wrote:

v2 uses sizeof(CallStackId) which is still 64-bits. Should we create a new typename and use it in these functions with a TODO to remove the old one (see also my comment later on about this)?

https://github.com/llvm/llvm-project/pull/93924


More information about the llvm-commits mailing list