diff options
author | Bob Wilson <bob.wilson@apple.com> | 2010-09-29 17:54:10 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2010-09-29 17:54:10 +0000 |
commit | 7122ba7efb5430d724ed3a0ac86fa7f7185b43ba (patch) | |
tree | 221bcb00ba6237d7faba0d6bd836515b6782b2cd | |
parent | 6cded231a3a748e4fb1339891c81d385058e571f (diff) | |
download | external_llvm-7122ba7efb5430d724ed3a0ac86fa7f7185b43ba.zip external_llvm-7122ba7efb5430d724ed3a0ac86fa7f7185b43ba.tar.gz external_llvm-7122ba7efb5430d724ed3a0ac86fa7f7185b43ba.tar.bz2 |
Increase ARM APCS preferred alignment for i64 and f64 from 32 bits to 64 bits.
LDM/STM instructions can run one cycle faster on some ARM processors if the
memory address is 64-bit aligned. Radar 8489376.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115047 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/ARM/ARMLoadStoreOptimizer.cpp | 2 | ||||
-rw-r--r-- | lib/Target/ARM/ARMSubtarget.h | 4 | ||||
-rw-r--r-- | test/CodeGen/ARM/align.ll | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/lib/Target/ARM/ARMLoadStoreOptimizer.cpp b/lib/Target/ARM/ARMLoadStoreOptimizer.cpp index ec2b74a..a7d1d9f 100644 --- a/lib/Target/ARM/ARMLoadStoreOptimizer.cpp +++ b/lib/Target/ARM/ARMLoadStoreOptimizer.cpp @@ -1370,7 +1370,7 @@ ARMPreAllocLoadStoreOpt::CanFormLdStDWord(MachineInstr *Op0, MachineInstr *Op1, unsigned Align = (*Op0->memoperands_begin())->getAlignment(); const Function *Func = MF->getFunction(); unsigned ReqAlign = STI->hasV6Ops() - ? TD->getPrefTypeAlignment(Type::getInt64Ty(Func->getContext())) + ? TD->getABITypeAlignment(Type::getInt64Ty(Func->getContext())) : 8; // Pre-v6 need 8-byte align if (Align < ReqAlign) return false; diff --git a/lib/Target/ARM/ARMSubtarget.h b/lib/Target/ARM/ARMSubtarget.h index aefd130..1188c6d 100644 --- a/lib/Target/ARM/ARMSubtarget.h +++ b/lib/Target/ARM/ARMSubtarget.h @@ -218,7 +218,7 @@ protected: std::string getDataLayout() const { if (isThumb()) { if (isAPCS_ABI()) { - return std::string("e-p:32:32-f64:32:32-i64:32:32-" + return std::string("e-p:32:32-f64:32:64-i64:32:64-" "i16:16:32-i8:8:32-i1:8:32-" "v128:32:128-v64:32:64-a:0:32-n32"); } else { @@ -228,7 +228,7 @@ protected: } } else { if (isAPCS_ABI()) { - return std::string("e-p:32:32-f64:32:32-i64:32:32-" + return std::string("e-p:32:32-f64:32:64-i64:32:64-" "v128:32:128-v64:32:64-n32"); } else { return std::string("e-p:32:32-f64:64:64-i64:64:64-" diff --git a/test/CodeGen/ARM/align.ll b/test/CodeGen/ARM/align.ll index d4d0128..d57c159 100644 --- a/test/CodeGen/ARM/align.ll +++ b/test/CodeGen/ARM/align.ll @@ -22,7 +22,7 @@ @e = global i64 4 ;ELF: .align 3 ;ELF: e -;DARWIN: .align 2 +;DARWIN: .align 3 ;DARWIN: _e: @f = global float 5.0 @@ -34,7 +34,7 @@ @g = global double 6.0 ;ELF: .align 3 ;ELF: g: -;DARWIN: .align 2 +;DARWIN: .align 3 ;DARWIN: _g: @bar = common global [75 x i8] zeroinitializer, align 128 |