summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2016-07-18 18:28:52 +0000
committerTim Northover <tnorthover@apple.com>2016-07-18 18:28:52 +0000
commit918f05063c5e32fe9c468ef569bf0ea9b1a81c22 (patch)
tree2908fe22d420d8b400b41d246b2b86561106c521 /llvm/lib/CodeGen
parent01c078966d384e41653a0c3cb390ba259c0dd333 (diff)
downloadbcm5719-llvm-918f05063c5e32fe9c468ef569bf0ea9b1a81c22.tar.gz
bcm5719-llvm-918f05063c5e32fe9c468ef569bf0ea9b1a81c22.zip
CodeGenPrep: use correct function to determine Global's alignment.
Elsewhere (particularly computeKnownBits) we assume that a global will be aligned to the value returned by Value::getPointerAlignment. This is used to boost the alignment on memcpy/memset, so any target-specific request can only increase that value. llvm-svn: 275866
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index d396137fa31..ede404149a1 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -1780,7 +1780,7 @@ bool CodeGenPrepare::optimizeCallInst(CallInst *CI, bool& ModifiedDT) {
// forbidden.
GlobalVariable *GV;
if ((GV = dyn_cast<GlobalVariable>(Val)) && GV->canIncreaseAlignment() &&
- GV->getAlignment() < PrefAlign &&
+ GV->getPointerAlignment(*DL) < PrefAlign &&
DL->getTypeAllocSize(GV->getValueType()) >=
MinSize + Offset2)
GV->setAlignment(PrefAlign);
OpenPOWER on IntegriCloud