[PATCH] D68901: [SampleFDO] Add profile remapping support for profile on-demand loading used by ExtBinary format profile

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 11 17:10:35 PDT 2019


wmi created this revision.
wmi added reviewers: davidxl, rsmith, wenlei.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

profile on-demand loading was added for ExtBinary format profile in https://reviews.llvm.org/rL374233, but currently profile on-demand loading doesn't work well with profile remapping. The patch adds the support.

Suppose a function in the current module has outline instance in the profile. The function name in the module is different from the name of the outline instance, but remapper knows the two names are equal. When loading profile on-demand, the outline instance has to be loaded with remapper's help.

Before the patch, the steps to read the profile is as follows:

- create the profile reader
- profile reader read the profile.
- create the profile remapper
- remapper set the underlying reader.
- reset the profile reader to remapper.

With the patch, the steps to read the profile is changed to:

- create the profile reader
- create the profile remapper
- profile reader set the underlying remapper.
- profile reader read the profile.
- remapper set the underlying reader.
- reset the profile reader to remapper.


Repository:
  rL LLVM

https://reviews.llvm.org/D68901

Files:
  llvm/include/llvm/ProfileData/SampleProfReader.h
  llvm/lib/ProfileData/SampleProfReader.cpp
  llvm/lib/Transforms/IPO/SampleProfile.cpp
  llvm/test/Transforms/SampleProfile/remap.ll
  llvm/unittests/ProfileData/SampleProfTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68901.224710.patch
Type: text/x-patch
Size: 15728 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191012/008962e9/attachment.bin>


More information about the llvm-commits mailing list