blob: 24c28baff881e0df9f4d1854521869471496a81c [file] [log] [blame]
Bill Wendlinga5c536e2013-08-01 21:42:05 +00001; RUN: llc < %s -mtriple=armv7-apple-ios -O0 | FileCheck %s -check-prefix=NO-REALIGN
2; RUN: llc < %s -mtriple=armv7-apple-ios -O0 | FileCheck %s -check-prefix=REALIGN
Manman Renf5639412012-12-04 00:52:33 +00003
4; rdar://12713765
5; When realign-stack is set to false, make sure we are not creating stack
6; objects that are assumed to be 64-byte aligned.
7@T3_retval = common global <16 x float> zeroinitializer, align 16
8
Bill Wendlinga5c536e2013-08-01 21:42:05 +00009define void @test1(<16 x float>* noalias sret %agg.result) nounwind ssp "no-realign-stack" {
Manman Renf5639412012-12-04 00:52:33 +000010entry:
Ahmed Bougacha9d2d7c12014-12-09 22:08:57 +000011; NO-REALIGN-LABEL: test1
Renato Golin2a5c0a52015-02-04 10:11:59 +000012; NO-REALIGN: vld1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R1:[0-9]+]]:128]
13; NO-REALIGN: add r[[R2:[0-9]+]], r[[R1]], #16
Ahmed Bougacha9d2d7c12014-12-09 22:08:57 +000014; NO-REALIGN: vld1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R2]]:128]
15; NO-REALIGN: add r[[R2:[0-9]+]], r[[R1]], #32
16; NO-REALIGN: vld1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R2]]:128]
17; NO-REALIGN: add r[[R2:[0-9]+]], r[[R1]], #48
18; NO-REALIGN: vld1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R2]]:128]
19
20; NO-REALIGN: add r[[R2:[0-9]+]], r[[R1:[0-9]+]], #48
21; NO-REALIGN: vst1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R2]]:128]
22; NO-REALIGN: add r[[R2:[0-9]+]], r[[R1]], #32
23; NO-REALIGN: vst1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R2]]:128]
Renato Golin2a5c0a52015-02-04 10:11:59 +000024; NO-REALIGN: add r[[R2:[0-9]+]], r[[R1]], #16
25; NO-REALIGN: vst1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R2]]:128]
Ahmed Bougacha9d2d7c12014-12-09 22:08:57 +000026; NO-REALIGN: vst1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R1]]:128]
27
28; NO-REALIGN: add r[[R2:[0-9]+]], r[[R0:0]], #48
29; NO-REALIGN: vst1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R2]]:128]
30; NO-REALIGN: add r[[R2:[0-9]+]], r[[R0]], #32
31; NO-REALIGN: vst1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R2]]:128]
Renato Golin2a5c0a52015-02-04 10:11:59 +000032; NO-REALIGN: add r[[R2:[0-9]+]], r[[R1]], #16
33; NO-REALIGN: vst1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R2]]:128]
Ahmed Bougacha9d2d7c12014-12-09 22:08:57 +000034; NO-REALIGN: vst1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R0]]:128]
Bob Wilson67bbf3a2013-02-08 20:35:15 +000035 %retval = alloca <16 x float>, align 16
Manman Renf5639412012-12-04 00:52:33 +000036 %0 = load <16 x float>* @T3_retval, align 16
37 store <16 x float> %0, <16 x float>* %retval
38 %1 = load <16 x float>* %retval
39 store <16 x float> %1, <16 x float>* %agg.result, align 16
40 ret void
41}
Bill Wendlinga5c536e2013-08-01 21:42:05 +000042
43define void @test2(<16 x float>* noalias sret %agg.result) nounwind ssp {
44entry:
Ahmed Bougacha9d2d7c12014-12-09 22:08:57 +000045; REALIGN-LABEL: test2
Kristof Beyls933de7a2015-01-08 15:09:14 +000046; REALIGN: bfc sp, #0, #6
Renato Golin2a5c0a52015-02-04 10:11:59 +000047; REALIGN: vld1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R1:[0-9]+]]:128]
48; REALIGN: add r[[R2:[0-9]+]], r[[R1]], #16
Ahmed Bougacha9d2d7c12014-12-09 22:08:57 +000049; REALIGN: vld1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R2]]:128]
50; REALIGN: add r[[R2:[0-9]+]], r[[R1]], #32
51; REALIGN: vld1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R2]]:128]
52; REALIGN: add r[[R2:[0-9]+]], r[[R1]], #48
53; REALIGN: vld1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R2]]:128]
54
55
56; REALIGN: orr r[[R2:[0-9]+]], r[[R1:[0-9]+]], #48
57; REALIGN: vst1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R2]]:128]
58; REALIGN: orr r[[R2:[0-9]+]], r[[R1]], #32
59; REALIGN: vst1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R2]]:128]
60; REALIGN: orr r[[R2:[0-9]+]], r[[R1]], #16
61; REALIGN: vst1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R2]]:128]
62; REALIGN: vst1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R1]]:128]
63
64; REALIGN: add r[[R1:[0-9]+]], r[[R0:0]], #48
65; REALIGN: vst1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R1]]:128]
66; REALIGN: add r[[R1:[0-9]+]], r[[R0]], #32
67; REALIGN: vst1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R1]]:128]
Renato Golin2a5c0a52015-02-04 10:11:59 +000068; REALIGN: add r[[R1:[0-9]+]], r[[R0]], #16
69; REALIGN: vst1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R1]]:128]
Ahmed Bougacha9d2d7c12014-12-09 22:08:57 +000070; REALIGN: vst1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R0]]:128]
Bill Wendlinga5c536e2013-08-01 21:42:05 +000071 %retval = alloca <16 x float>, align 16
72 %0 = load <16 x float>* @T3_retval, align 16
73 store <16 x float> %0, <16 x float>* %retval
74 %1 = load <16 x float>* %retval
75 store <16 x float> %1, <16 x float>* %agg.result, align 16
76 ret void
77}