[llvm] [memprof] Add call stack IDs to IndexedAllocationInfo (PR #85888)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 20 17:13:10 PDT 2024


================
@@ -445,14 +448,20 @@ Error RawMemProfReader::mapRawProfileToRecords() {
       Callstack.append(Frames.begin(), Frames.end());
     }
 
+    auto InsertResult =
+        CallStackToCallStackId.insert({Callstack, CallStacks.size()});
----------------
kazutakahirata wrote:

I just switched to the content hash for call stacks in the latest iteration.  Since computing a hash value requires no data structure to speak of (unlike the sequential `CallStackId`), I've updated the tests to call `hashCallStack` instead of the placeholder `0`.

For now, I am using the same hash function as in `computeStackId` in `MemProfiler.cpp`, but I can switch to `std::hash` also.

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


More information about the llvm-commits mailing list