llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.78k stars 11.9k forks source link

[memprof] Group MemProf data structures into a struct (NFC) #92343

Closed kazutakahirata closed 5 months ago

kazutakahirata commented 5 months ago

This patch groups the three Memprof data structures into a struct named IndexedMemProfData and teaches InstrProfWriter to use it. This way, we can pass IndexedMemProfData to writeMemProf and its helpers instead of individual data structures.

As a follow-up, we can use the new struct in MemProfReader also. That in turn allows loadInput in llvm-profdata to move the MemProf data into the writer context, saving a few seconds for a large MemProf profile.

kazutakahirata commented 5 months ago

Oops, I accidentally closed this pull request. Please refer to https://github.com/llvm/llvm-project/pull/92360, which I just re-created.