This is an archive of the discontinued LLVM Phabricator instance.

[ThinLTO] Handle values exported via indirect reference from global
AbandonedPublic

Authored by tejohnson on Nov 18 2016, 12:05 PM.

Details

Reviewers
pcc
mehdi_amini
Summary

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.

Event Timeline

tejohnson updated this revision to Diff 78568.Nov 18 2016, 12:05 PM
tejohnson retitled this revision from to [ThinLTO] Handle values exported via indirect reference from global.
tejohnson updated this object.
tejohnson added a reviewer: mehdi_amini.
tejohnson added subscribers: llvm-commits, krasin.
krasin added a reviewer: pcc.Nov 21 2016, 11:14 PM

Peter,

can you please take a look at this CL, if you have cycles? The CL does not look terribly complicated and it's the only known reason for the Chromium ThinLTO bot being broken:
https://build.chromium.org/p/chromium.fyi/builders/ThinLTO%20Linux%20ToT/builds/551

Thank you in advance!

Oh, I have just learned about the existence of https://reviews.llvm.org/D26880
Probably, my request to review the CL is outdated (I have not yet looked into the other CL to make a real guess)

tejohnson abandoned this revision.Nov 22 2016, 1:40 PM

I've updated D26880 to note that we should go with that approach. Will abandon this fix.