[PATCH] D54125: [LTO] Drop non-prevailing definitions for non-local linkage types

Pirama Arumuga Nainar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 5 14:53:08 PST 2018


pirama created this revision.
pirama added reviewers: tejohnson, pcc.
Herald added subscribers: dang, dexonsmith, steven_wu, eraman, inglorion, mehdi_amini.

This fixes PR 37422

In ELF, symbols non-weak symbols can also be non-prevailing.  In this
particular PR, the __llvm_profile_* symbols are non-prevailing but
weren't getting dropped - causing multiply-defined errors with lld.

Also add a test, strong_non_prevailing.ll, to ensure that multiple
copies of a strong symbol are dropped.

To fix the test regressions exposed by this fix,

- do not mark prevailing copies for symbols with 'appending' linkage.

There's no one prevailing copy for such symbols.

- do not propagate linkage from GlobalValueSummary to the actual symbol

for declarations or symbols with appending linkage.

- fix the prevailing version in dead-strip-fulllto.ll
- explicitly pass exported symbols to llvm-lto in fumcimport.ll and

funcimport_var.ll


Repository:
  rL LLVM

https://reviews.llvm.org/D54125

Files:
  lib/LTO/LTO.cpp
  lib/LTO/ThinLTOCodeGenerator.cpp
  lib/Transforms/IPO/FunctionImport.cpp
  test/LTO/Resolution/X86/dead-strip-fulllto.ll
  test/ThinLTO/X86/Inputs/strong_non_prevailing.ll
  test/ThinLTO/X86/funcimport.ll
  test/ThinLTO/X86/strong_non_prevailing.ll
  test/Transforms/FunctionImport/funcimport_var.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54125.172666.patch
Type: text/x-patch
Size: 6041 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181105/f3cb2801/attachment.bin>


More information about the llvm-commits mailing list