summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM
diff options
context:
space:
mode:
authorJames Molloy <james.molloy@arm.com>2016-10-06 07:56:00 +0000
committerJames Molloy <james.molloy@arm.com>2016-10-06 07:56:00 +0000
commit6215fad0e901adcafdafb299761973612b92264d (patch)
tree02a59bd867881978653d5a26b3e3ffa6f7e214d7 /llvm/lib/Target/ARM
parent78561c4917bcb77c509aa342180ed3bd7ee7cb5d (diff)
downloadbcm5719-llvm-6215fad0e901adcafdafb299761973612b92264d.tar.gz
bcm5719-llvm-6215fad0e901adcafdafb299761973612b92264d.zip
[ARM] Constant pool promotion - fix alignment calculation
Global variables are GlobalValues, so they have explicit alignment. Querying DataLayout for the alignment was incorrect. Testcase added. llvm-svn: 283423
Diffstat (limited to 'llvm/lib/Target/ARM')
-rw-r--r--llvm/lib/Target/ARM/ARMISelLowering.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp
index 234c3f59858..0e36ea89c5e 100644
--- a/llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -3084,7 +3084,7 @@ static SDValue promoteToConstantPool(const GlobalValue *GV, SelectionDAG &DAG,
// that are strings for simplicity.
auto *CDAInit = dyn_cast<ConstantDataArray>(Init);
unsigned Size = DAG.getDataLayout().getTypeAllocSize(Init->getType());
- unsigned Align = DAG.getDataLayout().getABITypeAlignment(Init->getType());
+ unsigned Align = GVar->getAlignment();
unsigned RequiredPadding = 4 - (Size % 4);
bool PaddingPossible =
RequiredPadding == 4 || (CDAInit && CDAInit->isString());
OpenPOWER on IntegriCloud