[PATCH] D84766: Revert D68041 "[PGO] Don't group COMDAT variables for compiler generated profile variables in ELF"

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 28 10:31:15 PDT 2020


MaskRay added a comment.

In D84766#2179180 <https://reviews.llvm.org/D84766#2179180>, @davidxl wrote:

>>> Cost: one or two additional section headers (.group section(s)): 64 or 128 bytes on ELF64.
>
> Yes, a good reason.
>
>>> __profc_, __profd_ and (if exists) __profvp_ should be retained or discarded. Placing them into separate comdat groups is conceptually inferior.
>
> ok as reason -- though with the current linker behavior (using link order),  if exist, they are retained or discarded together essentially.   However if the prevailing module does not define profvp, we will end up with an unused profvp if GC is not on.
>
>>> If the prevailing group does not include __profvp_ (value profiling not used) but a non-prevailing group from another translation unit has __profvp_ (the function is inlined into another and triggers value profiling), there will be a stray __profvp_.
>
> Not sure I understand the stray __profvp part -- __profvp is not directly accessed by user function (but indirectly) -- so the __profvp in this case will be GCed.

Updated: there will be a stray __profvp_ if --gc-sections is not enabled.

I mentioned this in another comment but did not state this in this description.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84766



More information about the llvm-commits mailing list