IR: Do not consider available_externally linkage to be linker-weak.
authorPeter Collingbourne <peter@pcc.me.uk>
Sun, 5 Jul 2015 20:52:35 +0000 (20:52 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Sun, 5 Jul 2015 20:52:35 +0000 (20:52 +0000)
commitce2b45bd7dc5dc17de6b50234f8d24ef1fed1d3b
tree98c7ad6a7c8b5d9f173a343e343ba7181c941b78
parent3b19ca3a2e9aac7146390160020beb7cb2393f10
IR: Do not consider available_externally linkage to be linker-weak.

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.

Differential Revision: http://reviews.llvm.org/D10941

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241413 91177308-0d34-0410-b5e6-96231b3b80d8
14 files changed:
include/llvm/IR/GlobalValue.h
lib/Analysis/ValueTracking.cpp
lib/CodeGen/SelectionDAG/TargetLowering.cpp
lib/Target/AArch64/AArch64Subtarget.cpp
lib/Target/ARM/ARMISelLowering.cpp
lib/Target/ARM/ARMSubtarget.cpp
lib/Target/PowerPC/PPCAsmPrinter.cpp
lib/Target/PowerPC/PPCFastISel.cpp
lib/Target/PowerPC/PPCISelDAGToDAG.cpp
lib/Target/PowerPC/PPCISelLowering.cpp
lib/Target/X86/X86FastISel.cpp
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86Subtarget.cpp
lib/Transforms/IPO/DeadArgumentElimination.cpp