[all-commits] [llvm/llvm-project] 45f603: [StaticDataLayout][PGO]Implement reader and writer...

Mingming Liu via All-commits all-commits at lists.llvm.org
Thu May 22 12:51:25 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 45f6036533bd30966f5e815568b792a7e293a0e8
      https://github.com/llvm/llvm-project/commit/45f6036533bd30966f5e815568b792a7e293a0e8
  Author: Mingming Liu <mingmingl at google.com>
  Date:   2025-05-22 (Thu, 22 May 2025)

  Changed paths:
    M llvm/include/llvm/ProfileData/DataAccessProf.h
    M llvm/include/llvm/ProfileData/IndexedMemProfData.h
    M llvm/include/llvm/ProfileData/InstrProfReader.h
    M llvm/include/llvm/ProfileData/InstrProfWriter.h
    M llvm/include/llvm/ProfileData/MemProfReader.h
    M llvm/include/llvm/ProfileData/MemProfYAML.h
    M llvm/lib/ProfileData/DataAccessProf.cpp
    M llvm/lib/ProfileData/IndexedMemProfData.cpp
    M llvm/lib/ProfileData/InstrProfReader.cpp
    M llvm/lib/ProfileData/InstrProfWriter.cpp
    M llvm/lib/ProfileData/MemProfReader.cpp
    M llvm/test/tools/llvm-profdata/memprof-yaml.test
    M llvm/tools/llvm-profdata/llvm-profdata.cpp
    M llvm/unittests/ProfileData/DataAccessProfTest.cpp

  Log Message:
  -----------
  [StaticDataLayout][PGO]Implement reader and writer change for data access profiles (#139997)

https://github.com/llvm/llvm-project/pull/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.

---------

Co-authored-by: Kazu Hirata <kazu at google.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list