diff options
author | James Y Knight <jyknight@google.com> | 2016-01-14 16:33:21 +0000 |
---|---|---|
committer | James Y Knight <jyknight@google.com> | 2016-01-14 16:33:21 +0000 |
commit | 582f556251615bb6483ed5fcc83acd0e5ac4b84c (patch) | |
tree | 32ce9cab42f4668d817519e6dd170696dcc8c2ba /llvm/lib/CodeGen/CodeGenPrepare.cpp | |
parent | 6ad8f61297194f990e759ccc3e107b36800e56dc (diff) | |
download | bcm5719-llvm-582f556251615bb6483ed5fcc83acd0e5ac4b84c.tar.gz bcm5719-llvm-582f556251615bb6483ed5fcc83acd0e5ac4b84c.zip |
Revert "Stop increasing alignment of externally-visible globals on ELF platforms."
This reverts commit r257719, due to PR26144.
llvm-svn: 257775
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r-- | llvm/lib/CodeGen/CodeGenPrepare.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index fd4ee464337..03e57787307 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -1742,8 +1742,8 @@ bool CodeGenPrepare::optimizeCallInst(CallInst *CI, bool& ModifiedDT) { // over-aligning global variables that have an explicit section is // forbidden. GlobalVariable *GV; - if ((GV = dyn_cast<GlobalVariable>(Val)) && GV->canIncreaseAlignment() && - GV->getAlignment() < PrefAlign && + if ((GV = dyn_cast<GlobalVariable>(Val)) && GV->hasUniqueInitializer() && + !GV->hasSection() && GV->getAlignment() < PrefAlign && DL->getTypeAllocSize(GV->getType()->getElementType()) >= MinSize + Offset2) GV->setAlignment(PrefAlign); |