forked from OSchip/llvm-project
parent
c0093609b0
commit
fc13db477a
|
@ -896,14 +896,16 @@ static unsigned enforceKnownAlignment(Value *V, unsigned Align,
|
||||||
return PrefAlign;
|
return PrefAlign;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GlobalValue *GV = dyn_cast<GlobalValue>(V)) {
|
if (auto *GV = dyn_cast<GlobalValue>(V)) {
|
||||||
// If there is a large requested alignment and we can, bump up the alignment
|
// If there is a large requested alignment and we can, bump up the alignment
|
||||||
// of the global.
|
// of the global.
|
||||||
if (GV->isDeclaration()) return Align;
|
if (GV->isDeclaration())
|
||||||
|
return Align;
|
||||||
// If the memory we set aside for the global may not be the memory used by
|
// If the memory we set aside for the global may not be the memory used by
|
||||||
// the final program then it is impossible for us to reliably enforce the
|
// the final program then it is impossible for us to reliably enforce the
|
||||||
// preferred alignment.
|
// preferred alignment.
|
||||||
if (GV->isWeakForLinker()) return Align;
|
if (GV->isWeakForLinker())
|
||||||
|
return Align;
|
||||||
|
|
||||||
if (GV->getAlignment() >= PrefAlign)
|
if (GV->getAlignment() >= PrefAlign)
|
||||||
return GV->getAlignment();
|
return GV->getAlignment();
|
||||||
|
|
Loading…
Reference in New Issue