aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/ARM/2009-09-24-spill-align.ll
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2009-09-25 14:41:49 +0000
committerBob Wilson <bob.wilson@apple.com>2009-09-25 14:41:49 +0000
commit0035f9c3b9982eeef098b608fceb7572df969b3e (patch)
treea20ebc5d2c18d4e0937add2ef10fbce3e172cf7c /test/CodeGen/ARM/2009-09-24-spill-align.ll
parent0cad4e3f0bf6664d5f1b4bb92c1bbe03c4c89ef8 (diff)
downloadexternal_llvm-0035f9c3b9982eeef098b608fceb7572df969b3e.zip
external_llvm-0035f9c3b9982eeef098b608fceb7572df969b3e.tar.gz
external_llvm-0035f9c3b9982eeef098b608fceb7572df969b3e.tar.bz2
pr4926: ARM requires the stack pointer to be aligned, even for leaf functions.
For the AAPCS ABI, SP must always be 4-byte aligned, and at any "public interface" it must be 8-byte aligned. For the older ARM APCS ABI, the stack alignment is just always 4 bytes. For X86, we currently align SP at entry to a function (e.g., to 16 bytes for Darwin), but no stack alignment is needed at other times, such as for a leaf function. After discussing this with Dan, I decided to go with the approach of adding a new "TransientStackAlignment" field to TargetFrameInfo. This value specifies the stack alignment that must be maintained even in between calls. It defaults to 1 except for ARM, where it is 4. (Some other targets may also want to set this if they have similar stack requirements. It's not currently required for PPC because it sets targetHandlesStackFrameRounding and handles the alignment in target-specific code.) The existing StackAlignment value specifies the alignment upon entry to a function, which is how we've been using it anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82767 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/ARM/2009-09-24-spill-align.ll')
-rw-r--r--test/CodeGen/ARM/2009-09-24-spill-align.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/2009-09-24-spill-align.ll b/test/CodeGen/ARM/2009-09-24-spill-align.ll
new file mode 100644
index 0000000..6281775
--- /dev/null
+++ b/test/CodeGen/ARM/2009-09-24-spill-align.ll
@@ -0,0 +1,17 @@
+; RUN: llc < %s -march=arm -mattr=+neon | FileCheck %s
+; pr4926
+
+define arm_apcscc void @test_vget_lanep16() nounwind {
+entry:
+ %arg0_poly16x4_t = alloca <4 x i16> ; <<4 x i16>*> [#uses=1]
+ %out_poly16_t = alloca i16 ; <i16*> [#uses=1]
+ %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
+; CHECK: fldd
+ %0 = load <4 x i16>* %arg0_poly16x4_t, align 8 ; <<4 x i16>> [#uses=1]
+ %1 = extractelement <4 x i16> %0, i32 1 ; <i16> [#uses=1]
+ store i16 %1, i16* %out_poly16_t, align 2
+ br label %return
+
+return: ; preds = %entry
+ ret void
+}