This is an archive of the discontinued LLVM Phabricator instance.

IR: Do not consider available_externally linkage to be linker-weak.
ClosedPublic

Authored by pcc on Jul 3 2015, 8:45 PM.

Details

Summary

From the linker's perspective, an available_externally global is equivalent
to an external declaration (per isDeclarationForLinker()), so it is incorrect
to consider it to be a weak definition.

Also clean up some logic in the dead argument elimination pass and clarify
its comments to better explain how its behavior depends on linkage,
introduce GlobalValue::isStrongDefinitionForLinker() and start using
it throughout the optimizers and backend.

Diff Detail

Repository
rL LLVM

Event Timeline

pcc updated this revision to Diff 29043.Jul 3 2015, 8:45 PM
pcc retitled this revision from to IR: Do not consider available_externally linkage to be linker-weak..
pcc updated this object.
pcc added a reviewer: majnemer.
pcc added a subscriber: llvm-commits.
rafael accepted this revision.Jul 5 2015, 4:13 AM
rafael added a reviewer: rafael.
rafael added a subscriber: rafael.

LGTM with a nit

lib/Transforms/IPO/DeadArgumentElimination.cpp
340 ↗(On Diff #29043)

! isStrongDefinitionForLinker

This revision is now accepted and ready to land.Jul 5 2015, 4:13 AM
This revision was automatically updated to reflect the committed changes.