[PATCH] D106228: [LTO] Add SelectionKind to IRSymtab and use it in ld.lld/LLVMgold

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 19 10:21:05 PDT 2021


sbc100 added a comment.

In D106228#2887667 <https://reviews.llvm.org/D106228#2887667>, @MaskRay wrote:

> In D106228#2887624 <https://reviews.llvm.org/D106228#2887624>, @tejohnson wrote:
>
>> I'm not sure I understand the comdat noduplicates selection kind. The lang ref says it means "The linker requires that only section with this COMDAT key exist.". Does that mean that we should never see more than one section with that COMDAT key, in which case it seems like we shouldn't have the case you describe (2 noduplicates comdat with the key "__profc_foo"), or does it mean something else?
>
> "The linker requires that only section with this COMDAT key exist." The sentence looks unclear.
>
> The semantics are: (1) Within a module, a section can be the member of at most one ELF section group or PE/COFF comdat. (2) if two groups in two modules have the same key, they are not deduplicated.
>
> One `comdat noduplicates` may have multiple members. These members will be retained or discarded as a unit. The ability is used by instrumentation to keep some related sections as a unit.
>
> The failure scenario happened for a PGO+ThinLTO case, where two modules have `comdat noduplicates` of the same name. We should not perform deduplication.

So it sounds like the meaning of "noduplicates" is "allow duplicates"  or maybe "do not de-duplicate" ?   Is that right?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106228



More information about the llvm-commits mailing list