[llvm] [MemProf] Extend CallSite information to include potential callees. (PR #130441)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 11 12:01:02 PDT 2025


================
@@ -202,15 +202,15 @@ static IndexedMemProfRecord deserializeV3(const MemProfSchema &Schema,
   // Read the callsite information.
   const uint64_t NumCtxs =
       endian::readNext<uint64_t, llvm::endianness::little>(Ptr);
-  Record.CallSiteIds.reserve(NumCtxs);
+  Record.CallSites.reserve(NumCtxs);
   for (uint64_t J = 0; J < NumCtxs; J++) {
     // We are storing LinearCallStackId in CallSiteIds, which is a vector of
     // CallStackId.  Assert that CallStackId is no smaller than
     // LinearCallStackId.
     static_assert(sizeof(LinearCallStackId) <= sizeof(CallStackId));
     LinearCallStackId CSId =
         endian::readNext<LinearCallStackId, llvm::endianness::little>(Ptr);
-    Record.CallSiteIds.push_back(CSId);
+    Record.CallSites.push_back(IndexedCallSiteInfo(CSId));
----------------
kazutakahirata wrote:

May I suggest `emplace_back` to drop `IndexedCallSiteInfo`?

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


More information about the llvm-commits mailing list