blob: 600fb6aa44b182347ce7fb40be6afedd821dc5ca [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
Ahmed Bougachadb141ac2015-02-19 23:52:41 +000012; NO-REALIGN: mov r[[R2:[0-9]+]], r[[R1:[0-9]+]]
13; NO-REALIGN: vld1.32 {{{d[0-9]+, d[0-9]+}}}, [r[[R2]]:128]!
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]
Ahmed Bougachadb141ac2015-02-19 23:52:41 +000024; NO-REALIGN: vst1.32 {{{d[0-9]+, d[0-9]+}}}, [r[[R1]]:128]!
Ahmed Bougacha9d2d7c12014-12-09 22:08:57 +000025; NO-REALIGN: vst1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R1]]:128]
26
27; NO-REALIGN: add r[[R2:[0-9]+]], r[[R0:0]], #48
28; NO-REALIGN: vst1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R2]]:128]
29; NO-REALIGN: add r[[R2:[0-9]+]], r[[R0]], #32
30; NO-REALIGN: vst1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R2]]:128]
Ahmed Bougachadb141ac2015-02-19 23:52:41 +000031; NO-REALIGN: vst1.32 {{{d[0-9]+, d[0-9]+}}}, [r[[R0]]:128]!
Ahmed Bougacha9d2d7c12014-12-09 22:08:57 +000032; NO-REALIGN: vst1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R0]]:128]
Bob Wilson67bbf3a2013-02-08 20:35:15 +000033 %retval = alloca <16 x float>, align 16
David Blaikiea79ac142015-02-27 21:17:42 +000034 %0 = load <16 x float>, <16 x float>* @T3_retval, align 16
Manman Renf5639412012-12-04 00:52:33 +000035 store <16 x float> %0, <16 x float>* %retval
David Blaikiea79ac142015-02-27 21:17:42 +000036 %1 = load <16 x float>, <16 x float>* %retval
Manman Renf5639412012-12-04 00:52:33 +000037 store <16 x float> %1, <16 x float>* %agg.result, align 16
38 ret void
39}
Bill Wendlinga5c536e2013-08-01 21:42:05 +000040
41define void @test2(<16 x float>* noalias sret %agg.result) nounwind ssp {
42entry:
Ahmed Bougacha9d2d7c12014-12-09 22:08:57 +000043; REALIGN-LABEL: test2
Kristof Beyls933de7a2015-01-08 15:09:14 +000044; REALIGN: bfc sp, #0, #6
Ahmed Bougachadb141ac2015-02-19 23:52:41 +000045; REALIGN: mov r[[R2:[0-9]+]], r[[R1:[0-9]+]]
46; REALIGN: vld1.32 {{{d[0-9]+, d[0-9]+}}}, [r[[R2]]:128]!
Ahmed Bougacha9d2d7c12014-12-09 22:08:57 +000047; REALIGN: vld1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R2]]:128]
48; REALIGN: add r[[R2:[0-9]+]], r[[R1]], #32
49; REALIGN: vld1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R2]]:128]
50; REALIGN: add r[[R2:[0-9]+]], r[[R1]], #48
51; REALIGN: vld1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R2]]:128]
52
53
54; REALIGN: orr r[[R2:[0-9]+]], r[[R1:[0-9]+]], #48
55; REALIGN: vst1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R2]]:128]
56; REALIGN: orr r[[R2:[0-9]+]], r[[R1]], #32
57; REALIGN: vst1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R2]]:128]
58; REALIGN: orr r[[R2:[0-9]+]], r[[R1]], #16
59; REALIGN: vst1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R2]]:128]
60; REALIGN: vst1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R1]]:128]
61
62; REALIGN: add r[[R1:[0-9]+]], r[[R0:0]], #48
63; REALIGN: vst1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R1]]:128]
64; REALIGN: add r[[R1:[0-9]+]], r[[R0]], #32
65; REALIGN: vst1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R1]]:128]
Ahmed Bougachadb141ac2015-02-19 23:52:41 +000066; REALIGN: vst1.32 {{{d[0-9]+, d[0-9]+}}}, [r[[R0]]:128]!
Ahmed Bougacha9d2d7c12014-12-09 22:08:57 +000067; REALIGN: vst1.64 {{{d[0-9]+, d[0-9]+}}}, [r[[R0]]:128]
Bill Wendlinga5c536e2013-08-01 21:42:05 +000068 %retval = alloca <16 x float>, align 16
David Blaikiea79ac142015-02-27 21:17:42 +000069 %0 = load <16 x float>, <16 x float>* @T3_retval, align 16
Bill Wendlinga5c536e2013-08-01 21:42:05 +000070 store <16 x float> %0, <16 x float>* %retval
David Blaikiea79ac142015-02-27 21:17:42 +000071 %1 = load <16 x float>, <16 x float>* %retval
Bill Wendlinga5c536e2013-08-01 21:42:05 +000072 store <16 x float> %1, <16 x float>* %agg.result, align 16
73 ret void
74}