[PATCH] D26866: [ThinLTO] Handle values exported via indirect reference from global

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 18 12:05:48 PST 2016


tejohnson created this revision.
tejohnson added a reviewer: mehdi_amini.
tejohnson added subscribers: llvm-commits, krasin.

The function import logic during the thin link currently has handling
for the fact that we will currently import constant unnamed_addr global
variables in the backend. It will conservatively mark all values
referenced in the initializer lists of exported global variables as also
exported.

However, this only handled values referenced directly from the
initializer list of an exported global variable. If the value is itself
a constant unnamed_addr variable, we could end up exporting its
references as well. Therefore, do this by invoking exportGlobalInModule
recursively, instead of just adding the first level of initializer list
references to the ExportList directly.

Fixes PR31052.


https://reviews.llvm.org/D26866

Files:
  lib/Transforms/IPO/FunctionImport.cpp
  test/ThinLTO/X86/Inputs/global_const.ll
  test/ThinLTO/X86/global_const.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26866.78568.patch
Type: text/x-patch
Size: 4646 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161118/ffba8ca8/attachment.bin>


More information about the llvm-commits mailing list