[SampleFDO] Port MD5 name table support to extbinary format.
authorWei Mi <wmi@google.com>
Tue, 3 Mar 2020 21:19:32 +0000 (13:19 -0800)
committerWei Mi <wmi@google.com>
Tue, 31 Mar 2020 05:07:08 +0000 (22:07 -0700)
commitebad678857a94c32ce7b6931e9c642b32d278b67
treef275e60b1d1eafc3b4f463eaec8cf0cb31cda986
parent1e8900cc828bd62fdcc314283c991080bae4520c
[SampleFDO] Port MD5 name table support to extbinary format.

Compbinary format uses MD5 to represent strings in name table. That gives smaller profile without the need of compression/decompression when writing/reading the profile. The patch adds the support in extbinary format. It is off by default but user can choose to enable it.

Note the feature of using MD5 in name table can bring very small chance of name conflict leading to profile mismatch. Besides, profile using the feature won't have the profile remapping support.

Differential Revision: https://reviews.llvm.org/D76255
12 files changed:
llvm/include/llvm/ProfileData/SampleProf.h
llvm/include/llvm/ProfileData/SampleProfReader.h
llvm/include/llvm/ProfileData/SampleProfWriter.h
llvm/lib/ProfileData/SampleProf.cpp
llvm/lib/ProfileData/SampleProfReader.cpp
llvm/lib/ProfileData/SampleProfWriter.cpp
llvm/lib/Transforms/IPO/SampleProfile.cpp
llvm/test/Transforms/SampleProfile/Inputs/inline.md5extbinary.afdo [new file with mode: 0644]
llvm/test/Transforms/SampleProfile/profile-format.ll
llvm/test/tools/llvm-profdata/roundtrip.test
llvm/tools/llvm-profdata/llvm-profdata.cpp
llvm/unittests/ProfileData/SampleProfTest.cpp