From: Tim Northover Date: Tue, 14 Oct 2014 20:57:29 +0000 (+0000) Subject: ARM: set preferred aggregate alignment to 32 universally. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=404920da32ce86e4280a9122b14c2e42764b4a76;p=clang ARM: set preferred aggregate alignment to 32 universally. Before, ARM and Thumb mode code had different preferred alignments, which could lead to some rather unexpected results. There's justification for reducing it from the default 64-bits (wasted space), but I don't think there is for going below 32-bits. There's no actual ABI change here, just to reassure people. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219720 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 8ecde72422..0ed96eb693 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -638,7 +638,7 @@ public: // RegParmMax is inherited from the underlying architecture this->LongDoubleFormat = &llvm::APFloat::IEEEdouble; if (Triple.getArch() == llvm::Triple::arm) { - this->DescriptionString = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S128"; + this->DescriptionString = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S128"; } else if (Triple.getArch() == llvm::Triple::x86) { this->DescriptionString = "e-m:e-p:32:32-i64:64-n8:16:32-S128"; } else if (Triple.getArch() == llvm::Triple::x86_64) { @@ -3757,13 +3757,13 @@ class ARMTargetInfo : public TargetInfo { } } else { if (T.isOSBinFormatMachO()) - DescriptionString = BigEndian ? - "E-m:o-p:32:32-i64:64-v128:64:128-n32-S64" : - "e-m:o-p:32:32-i64:64-v128:64:128-n32-S64"; + DescriptionString = + BigEndian ? "E-m:o-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" + : "e-m:o-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"; else - DescriptionString = BigEndian ? - "E-m:e-p:32:32-i64:64-v128:64:128-n32-S64" : - "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"; + DescriptionString = + BigEndian ? "E-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" + : "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"; } // FIXME: Enumerated types are variable width in straight AAPCS. diff --git a/test/CodeGen/target-data.c b/test/CodeGen/target-data.c index c374c9d230..ab27a65c57 100644 --- a/test/CodeGen/target-data.c +++ b/test/CodeGen/target-data.c @@ -68,7 +68,7 @@ // RUN: %clang_cc1 -triple arm-nacl-gnueabi -o - -emit-llvm %s | \ // RUN: FileCheck %s -check-prefix=ARM-NACL -// ARM-NACL: target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S128" +// ARM-NACL: target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S128" // RUN: %clang_cc1 -triple mipsel-nacl -o - -emit-llvm %s | \ // RUN: FileCheck %s -check-prefix=MIPS-NACL @@ -132,7 +132,7 @@ // RUN: %clang_cc1 -triple arm-unknown-gnueabi -o - -emit-llvm %s | \ // RUN: FileCheck %s -check-prefix=ARM -// ARM: target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64" +// ARM: target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" // RUN: %clang_cc1 -triple thumb-unknown -o - -emit-llvm -target-abi apcs-gnu \ // RUN: %s | FileCheck %s -check-prefix=THUMB-GNU