This is an archive of the discontinued LLVM Phabricator instance.

[lto] set AvailableExternallyLinkage for non-prevailing GlobalValues
AbandonedPublic

Authored by inglorion on Jan 31 2017, 7:15 PM.

Details

Summary

This allows using definitions that are not prevailing, but equivalent to the prevailing one, to be used for link-time optimization.

Event Timeline

inglorion created this revision.Jan 31 2017, 7:15 PM

D29059 needs this so that when we have a definition in a regular object and one in LTO, and we select the one in the regular object, we can still use the knowledge of the definition in LTO. The COFF linker has a test (lto-comdat.ll) that will fail without this.

mehdi_amini edited edge metadata.Jan 31 2017, 7:18 PM

Can you add a test please?

Also, make sure the test verifies that if the first module to be added contains a non-prevailing copy, and then the second one contains the prevailing copy, the prevailing one overwrite the one you kept as available_externally from the first module.

pcc edited edge metadata.Jan 31 2017, 7:28 PM

I have a local change (with a test) that does something similar, I'll pull it out of my local branch and send it out.

@inglorion, sorry for the conflict!

inglorion abandoned this revision.Feb 1 2017, 10:26 AM

Yeah, I was going to add a test once we agree that this is the functional change we want, but let's go with @pcc's D29367, which already has a test.