[PATCH] D52893: [ThinLTO] Keep non-prevailing (linkonce|weak)_odr symbols live

Xin Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 4 10:03:59 PDT 2018


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

If we have a symbol with (linkonce|weak)_odr linkage, we do not want
to dead strip it even it is not prevailing.

IR level (linkonce|weak)_odr symbol can become non-prevailing when we mix
ELF objects and IR objects where the (linkonce|weak)_odr symbol in the ELF
object is prevailing and the ones in the IR objects are not. Stripping
them will prevent us from doing optimizations with them.

By not dead stripping them, We will convert these symbols to
available_externally linkage as a result of non-prevailing and eventually
dropping them after inlining.

I modified cache-prevailing.ll to use linkonce linkage as it is
testing whether cache prevailing bit is effective or not, not
we should treat linkonce_odr alive or not


Repository:
  rL LLVM

https://reviews.llvm.org/D52893

Files:
  lib/Transforms/IPO/FunctionImport.cpp
  test/LTO/Resolution/X86/cache-prevailing.ll
  test/ThinLTO/X86/deadstrip.ll
  test/Transforms/FunctionImport/not-prevailing.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52893.168325.patch
Type: text/x-patch
Size: 4821 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181004/00dc8cfa/attachment.bin>


More information about the llvm-commits mailing list