This is an archive of the discontinued LLVM Phabricator instance.

[ThinLTO] Don't create a comdat group for a dropped def with initializer
ClosedPublic

Authored by tejohnson on Jan 14 2017, 6:04 PM.

Details

Summary

Non-prevailing weak/linkonce odr symbols will be dropped to
available_externally when possible. If they had an initializer in the
global_ctors list, a comdat group was being created. This code
already had logic to skip available_externally defs, but now the
EliminateAvailableExternally pass will drop these symbols to
declarations earlier. Change the check to skip all declarations for
linker (which includes available_externally along with declarations).

Diff Detail

Repository
rL LLVM

Event Timeline

tejohnson updated this revision to Diff 84469.Jan 14 2017, 6:04 PM
tejohnson retitled this revision from to [ThinLTO] Don't create a comdat group for a dropped def with initializer.
tejohnson updated this object.
tejohnson added a reviewer: mehdi_amini.
tejohnson added a subscriber: llvm-commits.
tejohnson updated this revision to Diff 84675.Jan 17 2017, 7:51 AM

Add llvm-lto and llvm-lto2 based tests

mehdi_amini added inline comments.Jan 18 2017, 12:32 AM
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
1653 ↗(On Diff #84675)

Do we need a ThinLTO importing to expose this case?
Can't you have a "simple" llc test that test the CodeGen for this?

tejohnson updated this revision to Diff 84844.Jan 18 2017, 8:42 AM

Replace ThinLTO-specific tests with a simple llc based test

tejohnson added inline comments.Jan 18 2017, 8:43 AM
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
1653 ↗(On Diff #84675)

Good idea, done.

This revision is now accepted and ready to land.Jan 18 2017, 8:46 AM
This revision was automatically updated to reflect the committed changes.