[all-commits] [llvm/llvm-project] 510e10: [Linker] Replace comdat based bool LinkFromSrc wit...

Fangrui Song via All-commits all-commits at lists.llvm.org
Sat Aug 28 13:56:46 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 510e106fa8635e7f9c51c896180b971de6309b2f
      https://github.com/llvm/llvm-project/commit/510e106fa8635e7f9c51c896180b971de6309b2f
  Author: Fangrui Song <i at maskray.me>
  Date:   2021-08-28 (Sat, 28 Aug 2021)

  Changed paths:
    M llvm/lib/Linker/LinkModules.cpp
    M llvm/test/Linker/comdat-nodeduplicate.ll

  Log Message:
  -----------
  [Linker] Replace comdat based bool LinkFromSrc with enum class LinkFrom and improve nodeduplicate tests. NFC

This is different from symbol resolution based LinkFromSrc.  Rename to be
clearer.

In the future we may support a new enum member 'Both' for nodeduplicate. This is
feasible (by renaming to a private linkage GlobalValue), but we need to be
careful not to break InstrProfiling.cpp's expectation of parallel profd/profc.

The challenge is that current LTO symbol resolution only allows to mark one
profc as prevailing: the other profc in another comdat nodeduplicate may be
discarded while its associated profd isn't.




More information about the All-commits mailing list