mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-01 12:24:24 +00:00
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
This commit is contained in:
@ -1464,7 +1464,7 @@ void computeKnownBits(Value *V, APInt &KnownZero, APInt &KnownOne,
|
||||
// If the object is defined in the current Module, we'll be giving
|
||||
// it the preferred alignment. Otherwise, we have to assume that it
|
||||
// may only have the minimum ABI alignment.
|
||||
if (!GVar->isDeclaration() && !GVar->isWeakForLinker())
|
||||
if (GVar->isStrongDefinitionForLinker())
|
||||
Align = DL.getPreferredAlignment(GVar);
|
||||
else
|
||||
Align = DL.getABITypeAlignment(ObjectType);
|
||||
|
Reference in New Issue
Block a user