[PATCH] D21883: ThinLTO: Do not take into account whether a definition has multiple copies when promoting.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 29 19:00:29 PDT 2016


pcc created this revision.
pcc added reviewers: tejohnson, mehdi_amini.
pcc added a subscriber: llvm-commits.
Herald added a subscriber: mehdi_amini.

We currently do not touch a symbol's linkage in the case where a definition
has a single copy. However, this code is effectively unnecessary: either
the definition is not exported, in which case the internalize phase sets
its linkage to internal, or it is exported, in which case we need to promote
linkage to weak. Those two cases are already handled by existing code.

I believe that the only real functional change here is in the case where we
have a single definition which does not prevail (e.g. because the definition
in a native object file prevails). In that case we now lower linkage to
available_externally following the existing code path for that case.

As a result we can remove the isExported function parameter from the
thinLTOResolveWeakForLinkerInIndex function.

http://reviews.llvm.org/D21883

Files:
  include/llvm/LTO/LTO.h
  lib/LTO/LTO.cpp
  lib/LTO/ThinLTOCodeGenerator.cpp
  test/ThinLTO/X86/alias_import.ll
  test/ThinLTO/X86/weak_resolution.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21883.62327.patch
Type: text/x-patch
Size: 11085 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160630/66ea89fa/attachment.bin>


More information about the llvm-commits mailing list