[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
Fri May 16 16:29:50 PDT 2025


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

I realized checking the length of data access profile payload before creating the class or calling its 'deserialize' method will do it. Since it's towards the end of the working week and the change is ~20 lines , I took the liberty to go ahead :)

I'm open to make the length field more general (e.g., recording the length of the total memprof profile will make it useful when there are new payloads after data access profiles) and would like to hear thoughts on it.

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


More information about the llvm-commits mailing list