[PATCH] D84723: [PGO] Move __profc_ and __profvp_ from their own comdat groups to __profd_'s comdat group

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 27 22:08:52 PDT 2020


MaskRay created this revision.
MaskRay added reviewers: davidxl, xur, yamauchi.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
Harbormaster failed remote builds in B65952: Diff 281103!
Harbormaster returned this revision to the author for changes because remote builds failed.
MaskRay requested review of this revision.

`__profc_` and `__profvp_` are referenced by `__profd_`. The 3 symbols can and
should be retained or discarded as a whole. We can use one comdat instead of 2
(value profiling not used) or 3 (value profiling used).

If the prevailing group is a translation unit without `__profvp_`, previously we
may add a stray `__profvp_` from a non-prevailing group. This change fixes this
behavior.

For each function which should be placed in a comdat, this saves at most two
section headers (2*sizeof(Elf64_Shdr) = 128 bytes) on an ELF64 platform.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84723

Files:
  llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
  llvm/test/Instrumentation/InstrProfiling/PR23499.ll
  llvm/test/Instrumentation/InstrProfiling/comdat.ll
  llvm/test/Instrumentation/InstrProfiling/icall.ll
  llvm/test/Instrumentation/InstrProfiling/linkage.ll
  llvm/test/Transforms/PGOProfile/comdat_internal.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84723.281103.patch
Type: text/x-patch
Size: 9235 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200728/9f977ac4/attachment.bin>


More information about the llvm-commits mailing list