This is an archive of the discontinued LLVM Phabricator instance.

[ThinLTO] Don't link module level assembly when importing
ClosedPublic

Authored by tejohnson on Oct 6 2016, 9:36 PM.

Details

Summary

Module inline asm was always being linked/concatenated
when running the IRLinker. This is correct for full LTO but not when
we are importing for ThinLTO, as it can result in multiply defined
symbols when the module asm defines a global symbol.

In order to test with llvm-lto2, I had to work around PR30396,
where a symbol that is defined in module assembly but defined in the
LLVM IR appears twice. Added workaround to llvm-lto2 with a FIXME.

Depends on D25345.

Fixes PR30610.

Diff Detail

Repository
rL LLVM

Event Timeline

tejohnson updated this revision to Diff 73883.Oct 6 2016, 9:36 PM
tejohnson retitled this revision from to [ThinLTO] Handle module level inline assembly.
tejohnson updated this object.
tejohnson added a reviewer: mehdi_amini.
tejohnson added a subscriber: llvm-commits.
davide added a subscriber: davide.Oct 6 2016, 9:42 PM
mehdi_amini accepted this revision.Oct 7 2016, 1:42 PM
mehdi_amini edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Oct 7 2016, 1:42 PM
tejohnson updated this revision to Diff 74409.Oct 12 2016, 11:47 AM
tejohnson retitled this revision from [ThinLTO] Handle module level inline assembly to [ThinLTO] Don't link module level assembly when importing.
tejohnson updated this object.
tejohnson edited edge metadata.

As discussed on IRC, change this patch to just address the immediate issue reported for PR30610 (concatenation of module asm during importing).

We plan to address module asm and inline assembly a different way (per summary record flag to block importing).

This revision was automatically updated to reflect the committed changes.