[PATCH] D68601: [SampleFDO] Add indexing for function profiles so they can be loaded on demand in ExtBinary format

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 7 15:13:04 PDT 2019


wmi created this revision.
wmi added reviewers: davidxl, mtrofin.
Herald added subscribers: arphaman, hiraditya.
Herald added a project: LLVM.

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 indexing in ExtBinary format too. 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.


Repository:
  rL LLVM

https://reviews.llvm.org/D68601

Files:
  llvm/include/llvm/ProfileData/SampleProf.h
  llvm/include/llvm/ProfileData/SampleProfReader.h
  llvm/include/llvm/ProfileData/SampleProfWriter.h
  llvm/lib/ProfileData/SampleProfReader.cpp
  llvm/lib/ProfileData/SampleProfWriter.cpp
  llvm/test/Transforms/SampleProfile/Inputs/inline.extbinary.afdo
  llvm/test/Transforms/SampleProfile/Inputs/profsampleacc.extbinary.afdo
  llvm/unittests/ProfileData/SampleProfTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68601.223663.patch
Type: text/x-patch
Size: 11589 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191007/76b7defd/attachment.bin>


More information about the llvm-commits mailing list