llvm-project/llvm/test/Transforms/FunctionImport
Pirama Arumuga Nainar e61652a384 [LTO] Drop non-prevailing definitions only if linkage is not local or appending
Summary:
This fixes PR 37422

In ELF, 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.
- fix the prevailing version in dead-strip-fulllto.ll
- explicitly pass exported symbols to llvm-lto in fumcimport.ll and
funcimport_var.ll

Reviewers: tejohnson, pcc

Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith,
dang, srhines, llvm-commits

Differential Revision: https://reviews.llvm.org/D54125

llvm-svn: 346436
2018-11-08 20:10:07 +00:00
..
Inputs [ThinLTO] Fix test to require asserts 2018-10-17 00:19:21 +00:00
adjustable_threshold.ll
funcimport.ll [ThinLTO] Recommit of import global variables 2018-03-12 10:30:50 +00:00
funcimport_alias.ll
funcimport_cutoff.ll [ThinLTO] Add an import cutoff for debugging/triaging 2018-04-01 15:54:40 +00:00
funcimport_debug.ll [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
funcimport_forcecold.ll [ThinLTO] Add an option to force summary call edges cold for debugging 2018-03-31 00:18:08 +00:00
funcimport_forcecold_samplepgo.ll [ThinLTO] Add an option to force summary call edges cold for debugging 2018-03-31 00:18:08 +00:00
funcimport_resolved.ll Restore "[ThinLTO] Ensure we always select the same function copy to import" 2018-07-16 15:30:27 +00:00
funcimport_var.ll [LTO] Drop non-prevailing definitions only if linkage is not local or appending 2018-11-08 20:10:07 +00:00
hotness_based_import.ll
import_stats.ll New test requires x86-registered-target 2018-10-17 00:59:14 +00:00
inlineasm.ll
not-prevailing.ll [ThinLTO] Keep non-prevailing (linkonce|weak)_odr symbols live 2018-10-08 15:12:48 +00:00