Skip to content

Conversation

@mingmingl-llvm
Copy link
Contributor

Fix the use-of-uninitialized-memory error (https://lab.llvm.org/buildbot/#/builders/94/builds/7373).

Tested: The error is reproduced with https://github.com/llvm/llvm-zorg/blob/main/zorg/buildbot/builders/sanitizers/buildbot_bootstrap_msan.sh without the fix, and test pass with the fix.

Original commit message:

#138170 introduces classes to operate on data access profiles. This change supports the read and write of DataAccessProfData in indexed format of MemProf (v4) as well as its the text (yaml) format.

For indexed format:

  • InstrProfWriter owns (by std::unique_ptr<DataAccessProfData>) the data access profiles, and gives a non-owned copy when it calls writeMemProf.
    • MemProf v4 header has a new uint64_t to record the byte offset of data access profiles. This uint64_t field is zero if data access profile is not set (nullptr).
  • MemProfReader reads the offset from v4 header and de-serializes in-memory bytes into class DataAccessProfData.

For textual format:

  • MemProfYAML.h adds the mapping for DAP class, and make DAP optional for both read and write.

099a0fa (by @snehasish) introduces v4 which contains CalleeGuids in CallSiteInfo, and this change changes the v4 format in place with data access profiles. The current plan is to bump the version and enable v4 profiles with both features, assuming waiting for this change won't delay the callsite change too long.

@mingmingl-llvm mingmingl-llvm marked this pull request as ready for review May 24, 2025 05:07
@mingmingl-llvm mingmingl-llvm merged commit 6bbaef1 into main May 24, 2025
12 of 14 checks passed
@mingmingl-llvm mingmingl-llvm deleted the users/mingmingl-llvm/instr-prof-reader-writer branch May 24, 2025 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants