]> granicus.if.org Git - llvm/commit
[SampleFDO] Add indexing for function profiles so they can be loaded on demand
authorWei Mi <wmi@google.com>
Wed, 9 Oct 2019 21:36:03 +0000 (21:36 +0000)
committerWei Mi <wmi@google.com>
Wed, 9 Oct 2019 21:36:03 +0000 (21:36 +0000)
commitd37615673fc802f66d5120d3402f5ba02e097281
tree6ed1fe34f19655938465d28015a3577d71e4e3ed
parent230cf52e6e54649bffbafeedaf053d37502223c5
[SampleFDO] Add indexing for function profiles so they can be loaded on demand
in ExtBinary format

Currently for Text, Binary and ExtBinary format profiles, when we compile a
module with samplefdo, even if there is no function showing up in the profile,
we have to load all the function profiles from the profile input. That is a
waste of compile time.

CompactBinary format profile has already had the support of loading function
profiles on demand. In this patch, we add the support to load profile on
demand for ExtBinary format. It will work no matter the sections in ExtBinary
format profile are compressed or not. Experiment shows it reduces the time to
compile a server benchmark by 30%.

When profile remapping and loading function profiles on demand are both used,
extra work needs to be done so that the loading on demand process will take
the name remapping into consideration. It will be addressed in a follow-up
patch.

Differential Revision: https://reviews.llvm.org/D68601

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374233 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ProfileData/SampleProf.h
include/llvm/ProfileData/SampleProfReader.h
include/llvm/ProfileData/SampleProfWriter.h
lib/ProfileData/SampleProfReader.cpp
lib/ProfileData/SampleProfWriter.cpp
lib/Transforms/IPO/SampleProfile.cpp
test/Transforms/SampleProfile/Inputs/inline.extbinary.afdo
test/Transforms/SampleProfile/Inputs/profsampleacc.extbinary.afdo
unittests/ProfileData/SampleProfTest.cpp