[all-commits] [llvm/llvm-project] 2c1def: [ThinLTO] Don't emit original GUID for locals to d...

Teresa Johnson via All-commits all-commits at lists.llvm.org
Thu Sep 23 17:36:07 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2c1defeee40cf643ea6f0fa5e01164c9a4c48c30
      https://github.com/llvm/llvm-project/commit/2c1defeee40cf643ea6f0fa5e01164c9a4c48c30
  Author: Teresa Johnson <tejohnson at google.com>
  Date:   2021-09-23 (Thu, 23 Sep 2021)

  Changed paths:
    M llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
    M llvm/test/ThinLTO/X86/distributed_indexes.ll

  Log Message:
  -----------
  [ThinLTO] Don't emit original GUID for locals to distributed indexes

In ThinLTO for locals we normally compute the GUID from the name after
prepending the source path to get a unique global id. SamplePGO indirect
call profiles contain the target GUID without this uniquification,
however (unless compiling with -funique-internal-linkage-names).
Therefore, the index contains the original GUID of the local symbols
(without module path prepended to uniquify), in order to correctly
handle the call edges added for these indirect call profile targets
with SamplePGO.

We were emitting these to the combined index when writing it out as
bitcode, which is unnecessary and causes overhead when writing out the
indexes for distributed backends. The only use of the original GUID name
is in the thin link. Suppress it in that case. This reduced the thin
link time for a large distributed build by about 7%, and the aggregate
size of the serialized indexes by over 2%.

Continue to print it when writing out the full index, since that is just
used for debugging and testing.

Update a distributed thinlto index test to contain a local and ensure
that we don't get a COMBINED_ORIGINAL_NAME record.

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




More information about the All-commits mailing list