summaryrefslogtreecommitdiff
path: root/test/CodeGen/ARM/constantpool-align.ll
diff options
context:
space:
mode:
authorJames Molloy <james.molloy@arm.com>2016-10-17 12:54:07 +0000
committerJames Molloy <james.molloy@arm.com>2016-10-17 12:54:07 +0000
commit63b1eba065baf8b2997c5b77ebb40c559ab27715 (patch)
tree8c21f26d9f4000e523734cb81f1bcf88e296d165 /test/CodeGen/ARM/constantpool-align.ll
parente4c66df4b4b90af4c32a73b576e3ddb3ffe81ec1 (diff)
[SDAG] Use ABI type alignment for constant pools when optimizing for size
SelectionDAG::getConstantPool will automatically determine an appropriate alignment if one is not specified. It does this by querying the type's preferred alignment. This can end up creating quite a lot of padding when the preferred alignment for vectors is 128. In optimize-for-size mode, it makes sense to instead query the ABI type alignment which is often smaller and causes less padding. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284381 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/ARM/constantpool-align.ll')
-rw-r--r--test/CodeGen/ARM/constantpool-align.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/constantpool-align.ll b/test/CodeGen/ARM/constantpool-align.ll
new file mode 100644
index 00000000000..1815b87469b
--- /dev/null
+++ b/test/CodeGen/ARM/constantpool-align.ll
@@ -0,0 +1,19 @@
+; RUN: llc < %s | FileCheck %s
+target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
+target triple = "thumbv7-arm-none-eabi"
+
+; CHECK-LABEL: f:
+; CHECK: vld1.64 {{.*}}, [r1:128]
+; CHECK: .p2align 4
+define void @f(<4 x i32>* %p) {
+ store <4 x i32> <i32 -1, i32 0, i32 0, i32 -1>, <4 x i32>* %p, align 4
+ ret void
+}
+
+; CHECK-LABEL: f_optsize:
+; CHECK: vld1.64 {{.*}}, [r1]
+; CHECK: .p2align 3
+define void @f_optsize(<4 x i32>* %p) optsize {
+ store <4 x i32> <i32 -1, i32 0, i32 0, i32 -1>, <4 x i32>* %p, align 4
+ ret void
+}