[llvm] [StaticDataLayout][PGO]Implement reader and writer change for data access profiles (PR #139997)

Mingming Liu via llvm-commits llvm-commits at lists.llvm.org
Mon May 19 16:47:30 PDT 2025


================
@@ -390,6 +419,14 @@ Error IndexedMemProfReader::deserializeRadixTreeBased(
       /*Payload=*/Start + RecordPayloadOffset,
       /*Base=*/Start, memprof::RecordLookupTrait(Version, Schema)));
 
+  if (DataAccessProfOffset > RecordTableOffset) {
----------------
mingmingl-llvm wrote:

Un-do the length changes and added the `assert((!DataAccessProfOffset || DataAccessProfOffset > RecordTableOffset) && "message")` for simplicity.

Recording and checking length makes the code a little more straightforward and readable, but the implementation is a little more complex. I don't feel strong about it.

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


More information about the llvm-commits mailing list