[memprof] Deduplicate and outline frame storage in the memprof profile.
authorSnehasish Kumar <snehasishk@google.com>
Tue, 22 Mar 2022 02:39:24 +0000 (19:39 -0700)
committerSnehasish Kumar <snehasishk@google.com>
Fri, 8 Apr 2022 16:15:20 +0000 (09:15 -0700)
commit6dd6a6161f3a5c25162af9dc3625c8dfcc62a1ed
treecbb80987fdf31edb688183c3f357b58443102ae1
parent575a1d48e781a03a1bb892ff52e16ee0485d0a34
[memprof] Deduplicate and outline frame storage in the memprof profile.

The current implementation of memprof information in the indexed profile
format stores the representation of each calling context fram inline.
This patch uses an interned representation where the frame contents are
stored in a separate on-disk hash table. The table is indexed via a hash
of the contents of the frame. With this patch, the compressed size of a
large memprof profile reduces by ~22%.

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D123094
llvm/include/llvm/ProfileData/InstrProfReader.h
llvm/include/llvm/ProfileData/InstrProfWriter.h
llvm/include/llvm/ProfileData/MemProf.h
llvm/include/llvm/ProfileData/RawMemProfReader.h
llvm/lib/ProfileData/InstrProfReader.cpp
llvm/lib/ProfileData/InstrProfWriter.cpp
llvm/lib/ProfileData/MemProf.cpp
llvm/lib/ProfileData/RawMemProfReader.cpp
llvm/tools/llvm-profdata/llvm-profdata.cpp
llvm/unittests/ProfileData/InstrProfTest.cpp
llvm/unittests/ProfileData/MemProfTest.cpp