[PATCH] D93254: [NFC][SampleFDO] Preparation to support multiple sections with the same type in ExtBinary format.

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 14 20:41:19 PST 2020


wmi added a comment.

In D93254#2453629 <https://reviews.llvm.org/D93254#2453629>, @hoy wrote:

> Can you please shed light on how multiple same-typed sections will be used? Thanks.

Sorry for not providing enough background. It will be used for the profile we mentioned here: https://reviews.llvm.org/D89524#inline-834804. To reduce the profile loading time during postlink phase when ThinLTO is enabled, we are going to split profile into two parts. One part contains profiles with inline instance and another part contains flattened profiles without inline instance in them. The split profile will have a shared NameTable section, but separate LBRProfile section and FuncOffsetTable section for each part. In prelink, we will load all the sections in the profile while in postlink we will only load the part containing profiles with inline instance. That is because profile annotation in postlink can only get additional information not available in prelink from profiles with inline instance, and that could reduce the profile loading time for the large synthetic profile we use.



================
Comment at: llvm/lib/ProfileData/SampleProfWriter.cpp:250
     const StringMap<FunctionSamples> &ProfileMap) {
-  if (auto EC = writeOneSection(SecProfSummary, ProfileMap))
+  if (auto EC = writeOneSection(SecProfSummary, 0, ProfileMap))
     return EC;
----------------
hoy wrote:
> How are the constant indices determined? I'm wondering if it's possible to automatically assign indices to avoid collision.
The indice order should match the order in the SampleProfileWriterExtBinary::SectionHdrLayout. I find the indice order in the patch is not up-to-date. I will update the patch.





Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93254/new/

https://reviews.llvm.org/D93254



More information about the llvm-commits mailing list