[llvm] [memprof] Speed up caller-callee pair extraction (PR #116184)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 14 09:04:19 PST 2024


================
@@ -1303,6 +1303,10 @@ Error IndexedMemProfReader::deserializeV3(const unsigned char *Start,
   FrameBase = Ptr;
   CallStackBase = Start + CallStackPayloadOffset;
 
+  // Compute the number of elements in the radix tree array.
+  RadixTreeSize = (RecordPayloadOffset - CallStackPayloadOffset) /
----------------
kazutakahirata wrote:

What kind of assertion do you have in mind on the generator side?  Something like this?

```
// The deserializer relies on the fact that the record section immediately follows
// the radix tree array.
assert(CallStackPayloadOffset <= RecordPayloadOffset);
```

By the way, I've updated the comment in the latest revision.

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


More information about the llvm-commits mailing list