xref: /aosp_15_r20/external/llvm/test/CodeGen/AArch64/arm64-abi_align.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=arm64 -mcpu=cyclone -enable-misched=false -disable-fp-elim | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -O0 -disable-fp-elim | FileCheck -check-prefix=FAST %s
3*9880d681SAndroid Build Coastguard Workertarget triple = "arm64-apple-darwin"
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker; rdar://12648441
6*9880d681SAndroid Build Coastguard Worker; Generated from arm64-arguments.c with -O2.
7*9880d681SAndroid Build Coastguard Worker; Test passing structs with size < 8, < 16 and > 16
8*9880d681SAndroid Build Coastguard Worker; with alignment of 16 and without
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Worker; Structs with size < 8
11*9880d681SAndroid Build Coastguard Worker%struct.s38 = type { i32, i16 }
12*9880d681SAndroid Build Coastguard Worker; With alignment of 16, the size will be padded to multiple of 16 bytes.
13*9880d681SAndroid Build Coastguard Worker%struct.s39 = type { i32, i16, [10 x i8] }
14*9880d681SAndroid Build Coastguard Worker; Structs with size < 16
15*9880d681SAndroid Build Coastguard Worker%struct.s40 = type { i32, i16, i32, i16 }
16*9880d681SAndroid Build Coastguard Worker%struct.s41 = type { i32, i16, i32, i16 }
17*9880d681SAndroid Build Coastguard Worker; Structs with size > 16
18*9880d681SAndroid Build Coastguard Worker%struct.s42 = type { i32, i16, i32, i16, i32, i16 }
19*9880d681SAndroid Build Coastguard Worker%struct.s43 = type { i32, i16, i32, i16, i32, i16, [10 x i8] }
20*9880d681SAndroid Build Coastguard Worker
21*9880d681SAndroid Build Coastguard Worker@g38 = common global %struct.s38 zeroinitializer, align 4
22*9880d681SAndroid Build Coastguard Worker@g38_2 = common global %struct.s38 zeroinitializer, align 4
23*9880d681SAndroid Build Coastguard Worker@g39 = common global %struct.s39 zeroinitializer, align 16
24*9880d681SAndroid Build Coastguard Worker@g39_2 = common global %struct.s39 zeroinitializer, align 16
25*9880d681SAndroid Build Coastguard Worker@g40 = common global %struct.s40 zeroinitializer, align 4
26*9880d681SAndroid Build Coastguard Worker@g40_2 = common global %struct.s40 zeroinitializer, align 4
27*9880d681SAndroid Build Coastguard Worker@g41 = common global %struct.s41 zeroinitializer, align 16
28*9880d681SAndroid Build Coastguard Worker@g41_2 = common global %struct.s41 zeroinitializer, align 16
29*9880d681SAndroid Build Coastguard Worker@g42 = common global %struct.s42 zeroinitializer, align 4
30*9880d681SAndroid Build Coastguard Worker@g42_2 = common global %struct.s42 zeroinitializer, align 4
31*9880d681SAndroid Build Coastguard Worker@g43 = common global %struct.s43 zeroinitializer, align 16
32*9880d681SAndroid Build Coastguard Worker@g43_2 = common global %struct.s43 zeroinitializer, align 16
33*9880d681SAndroid Build Coastguard Worker
34*9880d681SAndroid Build Coastguard Worker; structs with size < 8 bytes, passed via i64 in x1 and x2
35*9880d681SAndroid Build Coastguard Workerdefine i32 @f38(i32 %i, i64 %s1.coerce, i64 %s2.coerce) #0 {
36*9880d681SAndroid Build Coastguard Workerentry:
37*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: f38
38*9880d681SAndroid Build Coastguard Worker; CHECK: add w[[A:[0-9]+]], w1, w0
39*9880d681SAndroid Build Coastguard Worker; CHECK: add {{w[0-9]+}}, w[[A]], w2
40*9880d681SAndroid Build Coastguard Worker  %s1.sroa.0.0.extract.trunc = trunc i64 %s1.coerce to i32
41*9880d681SAndroid Build Coastguard Worker  %s1.sroa.1.4.extract.shift = lshr i64 %s1.coerce, 32
42*9880d681SAndroid Build Coastguard Worker  %s2.sroa.0.0.extract.trunc = trunc i64 %s2.coerce to i32
43*9880d681SAndroid Build Coastguard Worker  %s2.sroa.1.4.extract.shift = lshr i64 %s2.coerce, 32
44*9880d681SAndroid Build Coastguard Worker  %sext8 = shl nuw nsw i64 %s1.sroa.1.4.extract.shift, 16
45*9880d681SAndroid Build Coastguard Worker  %sext = trunc i64 %sext8 to i32
46*9880d681SAndroid Build Coastguard Worker  %conv = ashr exact i32 %sext, 16
47*9880d681SAndroid Build Coastguard Worker  %sext1011 = shl nuw nsw i64 %s2.sroa.1.4.extract.shift, 16
48*9880d681SAndroid Build Coastguard Worker  %sext10 = trunc i64 %sext1011 to i32
49*9880d681SAndroid Build Coastguard Worker  %conv6 = ashr exact i32 %sext10, 16
50*9880d681SAndroid Build Coastguard Worker  %add = add i32 %s1.sroa.0.0.extract.trunc, %i
51*9880d681SAndroid Build Coastguard Worker  %add3 = add i32 %add, %s2.sroa.0.0.extract.trunc
52*9880d681SAndroid Build Coastguard Worker  %add4 = add i32 %add3, %conv
53*9880d681SAndroid Build Coastguard Worker  %add7 = add i32 %add4, %conv6
54*9880d681SAndroid Build Coastguard Worker  ret i32 %add7
55*9880d681SAndroid Build Coastguard Worker}
56*9880d681SAndroid Build Coastguard Worker
57*9880d681SAndroid Build Coastguard Workerdefine i32 @caller38() #1 {
58*9880d681SAndroid Build Coastguard Workerentry:
59*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: caller38
60*9880d681SAndroid Build Coastguard Worker; CHECK: ldr x1,
61*9880d681SAndroid Build Coastguard Worker; CHECK: ldr x2,
62*9880d681SAndroid Build Coastguard Worker  %0 = load i64, i64* bitcast (%struct.s38* @g38 to i64*), align 4
63*9880d681SAndroid Build Coastguard Worker  %1 = load i64, i64* bitcast (%struct.s38* @g38_2 to i64*), align 4
64*9880d681SAndroid Build Coastguard Worker  %call = tail call i32 @f38(i32 3, i64 %0, i64 %1) #5
65*9880d681SAndroid Build Coastguard Worker  ret i32 %call
66*9880d681SAndroid Build Coastguard Worker}
67*9880d681SAndroid Build Coastguard Worker
68*9880d681SAndroid Build Coastguard Workerdeclare i32 @f38_stack(i32 %i, i32 %i2, i32 %i3, i32 %i4, i32 %i5, i32 %i6,
69*9880d681SAndroid Build Coastguard Worker                i32 %i7, i32 %i8, i32 %i9, i64 %s1.coerce, i64 %s2.coerce) #0
70*9880d681SAndroid Build Coastguard Worker
71*9880d681SAndroid Build Coastguard Worker; structs with size < 8 bytes, passed on stack at [sp+8] and [sp+16]
72*9880d681SAndroid Build Coastguard Worker; i9 at [sp]
73*9880d681SAndroid Build Coastguard Workerdefine i32 @caller38_stack() #1 {
74*9880d681SAndroid Build Coastguard Workerentry:
75*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: caller38_stack
76*9880d681SAndroid Build Coastguard Worker; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #8]
77*9880d681SAndroid Build Coastguard Worker; CHECK: mov w[[C:[0-9]+]], #9
78*9880d681SAndroid Build Coastguard Worker; CHECK: str w[[C]], [sp]
79*9880d681SAndroid Build Coastguard Worker  %0 = load i64, i64* bitcast (%struct.s38* @g38 to i64*), align 4
80*9880d681SAndroid Build Coastguard Worker  %1 = load i64, i64* bitcast (%struct.s38* @g38_2 to i64*), align 4
81*9880d681SAndroid Build Coastguard Worker  %call = tail call i32 @f38_stack(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6,
82*9880d681SAndroid Build Coastguard Worker                                   i32 7, i32 8, i32 9, i64 %0, i64 %1) #5
83*9880d681SAndroid Build Coastguard Worker  ret i32 %call
84*9880d681SAndroid Build Coastguard Worker}
85*9880d681SAndroid Build Coastguard Worker
86*9880d681SAndroid Build Coastguard Worker; structs with size < 8 bytes, alignment of 16
87*9880d681SAndroid Build Coastguard Worker; passed via i128 in x1 and x3
88*9880d681SAndroid Build Coastguard Workerdefine i32 @f39(i32 %i, i128 %s1.coerce, i128 %s2.coerce) #0 {
89*9880d681SAndroid Build Coastguard Workerentry:
90*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: f39
91*9880d681SAndroid Build Coastguard Worker; CHECK: add w[[A:[0-9]+]], w1, w0
92*9880d681SAndroid Build Coastguard Worker; CHECK: add {{w[0-9]+}}, w[[A]], w3
93*9880d681SAndroid Build Coastguard Worker  %s1.sroa.0.0.extract.trunc = trunc i128 %s1.coerce to i32
94*9880d681SAndroid Build Coastguard Worker  %s1.sroa.1.4.extract.shift = lshr i128 %s1.coerce, 32
95*9880d681SAndroid Build Coastguard Worker  %s2.sroa.0.0.extract.trunc = trunc i128 %s2.coerce to i32
96*9880d681SAndroid Build Coastguard Worker  %s2.sroa.1.4.extract.shift = lshr i128 %s2.coerce, 32
97*9880d681SAndroid Build Coastguard Worker  %sext8 = shl nuw nsw i128 %s1.sroa.1.4.extract.shift, 16
98*9880d681SAndroid Build Coastguard Worker  %sext = trunc i128 %sext8 to i32
99*9880d681SAndroid Build Coastguard Worker  %conv = ashr exact i32 %sext, 16
100*9880d681SAndroid Build Coastguard Worker  %sext1011 = shl nuw nsw i128 %s2.sroa.1.4.extract.shift, 16
101*9880d681SAndroid Build Coastguard Worker  %sext10 = trunc i128 %sext1011 to i32
102*9880d681SAndroid Build Coastguard Worker  %conv6 = ashr exact i32 %sext10, 16
103*9880d681SAndroid Build Coastguard Worker  %add = add i32 %s1.sroa.0.0.extract.trunc, %i
104*9880d681SAndroid Build Coastguard Worker  %add3 = add i32 %add, %s2.sroa.0.0.extract.trunc
105*9880d681SAndroid Build Coastguard Worker  %add4 = add i32 %add3, %conv
106*9880d681SAndroid Build Coastguard Worker  %add7 = add i32 %add4, %conv6
107*9880d681SAndroid Build Coastguard Worker  ret i32 %add7
108*9880d681SAndroid Build Coastguard Worker}
109*9880d681SAndroid Build Coastguard Worker
110*9880d681SAndroid Build Coastguard Workerdefine i32 @caller39() #1 {
111*9880d681SAndroid Build Coastguard Workerentry:
112*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: caller39
113*9880d681SAndroid Build Coastguard Worker; CHECK: ldp x1, x2,
114*9880d681SAndroid Build Coastguard Worker; CHECK: ldp x3, x4,
115*9880d681SAndroid Build Coastguard Worker  %0 = load i128, i128* bitcast (%struct.s39* @g39 to i128*), align 16
116*9880d681SAndroid Build Coastguard Worker  %1 = load i128, i128* bitcast (%struct.s39* @g39_2 to i128*), align 16
117*9880d681SAndroid Build Coastguard Worker  %call = tail call i32 @f39(i32 3, i128 %0, i128 %1) #5
118*9880d681SAndroid Build Coastguard Worker  ret i32 %call
119*9880d681SAndroid Build Coastguard Worker}
120*9880d681SAndroid Build Coastguard Worker
121*9880d681SAndroid Build Coastguard Workerdeclare i32 @f39_stack(i32 %i, i32 %i2, i32 %i3, i32 %i4, i32 %i5, i32 %i6,
122*9880d681SAndroid Build Coastguard Worker                i32 %i7, i32 %i8, i32 %i9, i128 %s1.coerce, i128 %s2.coerce) #0
123*9880d681SAndroid Build Coastguard Worker
124*9880d681SAndroid Build Coastguard Worker; structs with size < 8 bytes, alignment 16
125*9880d681SAndroid Build Coastguard Worker; passed on stack at [sp+16] and [sp+32]
126*9880d681SAndroid Build Coastguard Workerdefine i32 @caller39_stack() #1 {
127*9880d681SAndroid Build Coastguard Workerentry:
128*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: caller39_stack
129*9880d681SAndroid Build Coastguard Worker; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #32]
130*9880d681SAndroid Build Coastguard Worker; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #16]
131*9880d681SAndroid Build Coastguard Worker; CHECK: mov w[[C:[0-9]+]], #9
132*9880d681SAndroid Build Coastguard Worker; CHECK: str w[[C]], [sp]
133*9880d681SAndroid Build Coastguard Worker  %0 = load i128, i128* bitcast (%struct.s39* @g39 to i128*), align 16
134*9880d681SAndroid Build Coastguard Worker  %1 = load i128, i128* bitcast (%struct.s39* @g39_2 to i128*), align 16
135*9880d681SAndroid Build Coastguard Worker  %call = tail call i32 @f39_stack(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6,
136*9880d681SAndroid Build Coastguard Worker                                   i32 7, i32 8, i32 9, i128 %0, i128 %1) #5
137*9880d681SAndroid Build Coastguard Worker  ret i32 %call
138*9880d681SAndroid Build Coastguard Worker}
139*9880d681SAndroid Build Coastguard Worker
140*9880d681SAndroid Build Coastguard Worker; structs with size < 16 bytes
141*9880d681SAndroid Build Coastguard Worker; passed via i128 in x1 and x3
142*9880d681SAndroid Build Coastguard Workerdefine i32 @f40(i32 %i, [2 x i64] %s1.coerce, [2 x i64] %s2.coerce) #0 {
143*9880d681SAndroid Build Coastguard Workerentry:
144*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: f40
145*9880d681SAndroid Build Coastguard Worker; CHECK: add w[[A:[0-9]+]], w1, w0
146*9880d681SAndroid Build Coastguard Worker; CHECK: add {{w[0-9]+}}, w[[A]], w3
147*9880d681SAndroid Build Coastguard Worker  %s1.coerce.fca.0.extract = extractvalue [2 x i64] %s1.coerce, 0
148*9880d681SAndroid Build Coastguard Worker  %s2.coerce.fca.0.extract = extractvalue [2 x i64] %s2.coerce, 0
149*9880d681SAndroid Build Coastguard Worker  %s1.sroa.0.0.extract.trunc = trunc i64 %s1.coerce.fca.0.extract to i32
150*9880d681SAndroid Build Coastguard Worker  %s2.sroa.0.0.extract.trunc = trunc i64 %s2.coerce.fca.0.extract to i32
151*9880d681SAndroid Build Coastguard Worker  %s1.sroa.0.4.extract.shift = lshr i64 %s1.coerce.fca.0.extract, 32
152*9880d681SAndroid Build Coastguard Worker  %sext8 = shl nuw nsw i64 %s1.sroa.0.4.extract.shift, 16
153*9880d681SAndroid Build Coastguard Worker  %sext = trunc i64 %sext8 to i32
154*9880d681SAndroid Build Coastguard Worker  %conv = ashr exact i32 %sext, 16
155*9880d681SAndroid Build Coastguard Worker  %s2.sroa.0.4.extract.shift = lshr i64 %s2.coerce.fca.0.extract, 32
156*9880d681SAndroid Build Coastguard Worker  %sext1011 = shl nuw nsw i64 %s2.sroa.0.4.extract.shift, 16
157*9880d681SAndroid Build Coastguard Worker  %sext10 = trunc i64 %sext1011 to i32
158*9880d681SAndroid Build Coastguard Worker  %conv6 = ashr exact i32 %sext10, 16
159*9880d681SAndroid Build Coastguard Worker  %add = add i32 %s1.sroa.0.0.extract.trunc, %i
160*9880d681SAndroid Build Coastguard Worker  %add3 = add i32 %add, %s2.sroa.0.0.extract.trunc
161*9880d681SAndroid Build Coastguard Worker  %add4 = add i32 %add3, %conv
162*9880d681SAndroid Build Coastguard Worker  %add7 = add i32 %add4, %conv6
163*9880d681SAndroid Build Coastguard Worker  ret i32 %add7
164*9880d681SAndroid Build Coastguard Worker}
165*9880d681SAndroid Build Coastguard Worker
166*9880d681SAndroid Build Coastguard Workerdefine i32 @caller40() #1 {
167*9880d681SAndroid Build Coastguard Workerentry:
168*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: caller40
169*9880d681SAndroid Build Coastguard Worker; CHECK: ldp x1, x2,
170*9880d681SAndroid Build Coastguard Worker; CHECK: ldp x3, x4,
171*9880d681SAndroid Build Coastguard Worker  %0 = load [2 x i64], [2 x i64]* bitcast (%struct.s40* @g40 to [2 x i64]*), align 4
172*9880d681SAndroid Build Coastguard Worker  %1 = load [2 x i64], [2 x i64]* bitcast (%struct.s40* @g40_2 to [2 x i64]*), align 4
173*9880d681SAndroid Build Coastguard Worker  %call = tail call i32 @f40(i32 3, [2 x i64] %0, [2 x i64] %1) #5
174*9880d681SAndroid Build Coastguard Worker  ret i32 %call
175*9880d681SAndroid Build Coastguard Worker}
176*9880d681SAndroid Build Coastguard Worker
177*9880d681SAndroid Build Coastguard Workerdeclare i32 @f40_stack(i32 %i, i32 %i2, i32 %i3, i32 %i4, i32 %i5, i32 %i6,
178*9880d681SAndroid Build Coastguard Worker                i32 %i7, i32 %i8, i32 %i9, [2 x i64] %s1.coerce, [2 x i64] %s2.coerce) #0
179*9880d681SAndroid Build Coastguard Worker
180*9880d681SAndroid Build Coastguard Worker; structs with size < 16 bytes
181*9880d681SAndroid Build Coastguard Worker; passed on stack at [sp+8] and [sp+24]
182*9880d681SAndroid Build Coastguard Workerdefine i32 @caller40_stack() #1 {
183*9880d681SAndroid Build Coastguard Workerentry:
184*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: caller40_stack
185*9880d681SAndroid Build Coastguard Worker; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #24]
186*9880d681SAndroid Build Coastguard Worker; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #8]
187*9880d681SAndroid Build Coastguard Worker; CHECK: mov w[[C:[0-9]+]], #9
188*9880d681SAndroid Build Coastguard Worker; CHECK: str w[[C]], [sp]
189*9880d681SAndroid Build Coastguard Worker  %0 = load [2 x i64], [2 x i64]* bitcast (%struct.s40* @g40 to [2 x i64]*), align 4
190*9880d681SAndroid Build Coastguard Worker  %1 = load [2 x i64], [2 x i64]* bitcast (%struct.s40* @g40_2 to [2 x i64]*), align 4
191*9880d681SAndroid Build Coastguard Worker  %call = tail call i32 @f40_stack(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6,
192*9880d681SAndroid Build Coastguard Worker                         i32 7, i32 8, i32 9, [2 x i64] %0, [2 x i64] %1) #5
193*9880d681SAndroid Build Coastguard Worker  ret i32 %call
194*9880d681SAndroid Build Coastguard Worker}
195*9880d681SAndroid Build Coastguard Worker
196*9880d681SAndroid Build Coastguard Worker; structs with size < 16 bytes, alignment of 16
197*9880d681SAndroid Build Coastguard Worker; passed via i128 in x1 and x3
198*9880d681SAndroid Build Coastguard Workerdefine i32 @f41(i32 %i, i128 %s1.coerce, i128 %s2.coerce) #0 {
199*9880d681SAndroid Build Coastguard Workerentry:
200*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: f41
201*9880d681SAndroid Build Coastguard Worker; CHECK: add w[[A:[0-9]+]], w1, w0
202*9880d681SAndroid Build Coastguard Worker; CHECK: add {{w[0-9]+}}, w[[A]], w3
203*9880d681SAndroid Build Coastguard Worker  %s1.sroa.0.0.extract.trunc = trunc i128 %s1.coerce to i32
204*9880d681SAndroid Build Coastguard Worker  %s1.sroa.1.4.extract.shift = lshr i128 %s1.coerce, 32
205*9880d681SAndroid Build Coastguard Worker  %s2.sroa.0.0.extract.trunc = trunc i128 %s2.coerce to i32
206*9880d681SAndroid Build Coastguard Worker  %s2.sroa.1.4.extract.shift = lshr i128 %s2.coerce, 32
207*9880d681SAndroid Build Coastguard Worker  %sext8 = shl nuw nsw i128 %s1.sroa.1.4.extract.shift, 16
208*9880d681SAndroid Build Coastguard Worker  %sext = trunc i128 %sext8 to i32
209*9880d681SAndroid Build Coastguard Worker  %conv = ashr exact i32 %sext, 16
210*9880d681SAndroid Build Coastguard Worker  %sext1011 = shl nuw nsw i128 %s2.sroa.1.4.extract.shift, 16
211*9880d681SAndroid Build Coastguard Worker  %sext10 = trunc i128 %sext1011 to i32
212*9880d681SAndroid Build Coastguard Worker  %conv6 = ashr exact i32 %sext10, 16
213*9880d681SAndroid Build Coastguard Worker  %add = add i32 %s1.sroa.0.0.extract.trunc, %i
214*9880d681SAndroid Build Coastguard Worker  %add3 = add i32 %add, %s2.sroa.0.0.extract.trunc
215*9880d681SAndroid Build Coastguard Worker  %add4 = add i32 %add3, %conv
216*9880d681SAndroid Build Coastguard Worker  %add7 = add i32 %add4, %conv6
217*9880d681SAndroid Build Coastguard Worker  ret i32 %add7
218*9880d681SAndroid Build Coastguard Worker}
219*9880d681SAndroid Build Coastguard Worker
220*9880d681SAndroid Build Coastguard Workerdefine i32 @caller41() #1 {
221*9880d681SAndroid Build Coastguard Workerentry:
222*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: caller41
223*9880d681SAndroid Build Coastguard Worker; CHECK: ldp x1, x2,
224*9880d681SAndroid Build Coastguard Worker; CHECK: ldp x3, x4,
225*9880d681SAndroid Build Coastguard Worker  %0 = load i128, i128* bitcast (%struct.s41* @g41 to i128*), align 16
226*9880d681SAndroid Build Coastguard Worker  %1 = load i128, i128* bitcast (%struct.s41* @g41_2 to i128*), align 16
227*9880d681SAndroid Build Coastguard Worker  %call = tail call i32 @f41(i32 3, i128 %0, i128 %1) #5
228*9880d681SAndroid Build Coastguard Worker  ret i32 %call
229*9880d681SAndroid Build Coastguard Worker}
230*9880d681SAndroid Build Coastguard Worker
231*9880d681SAndroid Build Coastguard Workerdeclare i32 @f41_stack(i32 %i, i32 %i2, i32 %i3, i32 %i4, i32 %i5, i32 %i6,
232*9880d681SAndroid Build Coastguard Worker                i32 %i7, i32 %i8, i32 %i9, i128 %s1.coerce, i128 %s2.coerce) #0
233*9880d681SAndroid Build Coastguard Worker
234*9880d681SAndroid Build Coastguard Worker; structs with size < 16 bytes, alignment of 16
235*9880d681SAndroid Build Coastguard Worker; passed on stack at [sp+16] and [sp+32]
236*9880d681SAndroid Build Coastguard Workerdefine i32 @caller41_stack() #1 {
237*9880d681SAndroid Build Coastguard Workerentry:
238*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: caller41_stack
239*9880d681SAndroid Build Coastguard Worker; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #32]
240*9880d681SAndroid Build Coastguard Worker; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #16]
241*9880d681SAndroid Build Coastguard Worker; CHECK: mov w[[C:[0-9]+]], #9
242*9880d681SAndroid Build Coastguard Worker; CHECK: str w[[C]], [sp]
243*9880d681SAndroid Build Coastguard Worker  %0 = load i128, i128* bitcast (%struct.s41* @g41 to i128*), align 16
244*9880d681SAndroid Build Coastguard Worker  %1 = load i128, i128* bitcast (%struct.s41* @g41_2 to i128*), align 16
245*9880d681SAndroid Build Coastguard Worker  %call = tail call i32 @f41_stack(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6,
246*9880d681SAndroid Build Coastguard Worker                            i32 7, i32 8, i32 9, i128 %0, i128 %1) #5
247*9880d681SAndroid Build Coastguard Worker  ret i32 %call
248*9880d681SAndroid Build Coastguard Worker}
249*9880d681SAndroid Build Coastguard Worker
250*9880d681SAndroid Build Coastguard Worker; structs with size of 22 bytes, passed indirectly in x1 and x2
251*9880d681SAndroid Build Coastguard Workerdefine i32 @f42(i32 %i, %struct.s42* nocapture %s1, %struct.s42* nocapture %s2) #2 {
252*9880d681SAndroid Build Coastguard Workerentry:
253*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: f42
254*9880d681SAndroid Build Coastguard Worker; CHECK: ldr w[[A:[0-9]+]], [x1]
255*9880d681SAndroid Build Coastguard Worker; CHECK: ldr w[[B:[0-9]+]], [x2]
256*9880d681SAndroid Build Coastguard Worker; CHECK: add w[[C:[0-9]+]], w[[A]], w0
257*9880d681SAndroid Build Coastguard Worker; CHECK: add {{w[0-9]+}}, w[[C]], w[[B]]
258*9880d681SAndroid Build Coastguard Worker; FAST: f42
259*9880d681SAndroid Build Coastguard Worker; FAST: ldr w[[A:[0-9]+]], [x1]
260*9880d681SAndroid Build Coastguard Worker; FAST: ldr w[[B:[0-9]+]], [x2]
261*9880d681SAndroid Build Coastguard Worker; FAST: add w[[C:[0-9]+]], w[[A]], w0
262*9880d681SAndroid Build Coastguard Worker; FAST: add {{w[0-9]+}}, w[[C]], w[[B]]
263*9880d681SAndroid Build Coastguard Worker  %i1 = getelementptr inbounds %struct.s42, %struct.s42* %s1, i64 0, i32 0
264*9880d681SAndroid Build Coastguard Worker  %0 = load i32, i32* %i1, align 4, !tbaa !0
265*9880d681SAndroid Build Coastguard Worker  %i2 = getelementptr inbounds %struct.s42, %struct.s42* %s2, i64 0, i32 0
266*9880d681SAndroid Build Coastguard Worker  %1 = load i32, i32* %i2, align 4, !tbaa !0
267*9880d681SAndroid Build Coastguard Worker  %s = getelementptr inbounds %struct.s42, %struct.s42* %s1, i64 0, i32 1
268*9880d681SAndroid Build Coastguard Worker  %2 = load i16, i16* %s, align 2, !tbaa !3
269*9880d681SAndroid Build Coastguard Worker  %conv = sext i16 %2 to i32
270*9880d681SAndroid Build Coastguard Worker  %s5 = getelementptr inbounds %struct.s42, %struct.s42* %s2, i64 0, i32 1
271*9880d681SAndroid Build Coastguard Worker  %3 = load i16, i16* %s5, align 2, !tbaa !3
272*9880d681SAndroid Build Coastguard Worker  %conv6 = sext i16 %3 to i32
273*9880d681SAndroid Build Coastguard Worker  %add = add i32 %0, %i
274*9880d681SAndroid Build Coastguard Worker  %add3 = add i32 %add, %1
275*9880d681SAndroid Build Coastguard Worker  %add4 = add i32 %add3, %conv
276*9880d681SAndroid Build Coastguard Worker  %add7 = add i32 %add4, %conv6
277*9880d681SAndroid Build Coastguard Worker  ret i32 %add7
278*9880d681SAndroid Build Coastguard Worker}
279*9880d681SAndroid Build Coastguard Worker
280*9880d681SAndroid Build Coastguard Worker; For s1, we allocate a 22-byte space, pass its address via x1
281*9880d681SAndroid Build Coastguard Workerdefine i32 @caller42() #3 {
282*9880d681SAndroid Build Coastguard Workerentry:
283*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: caller42
284*9880d681SAndroid Build Coastguard Worker; CHECK: str {{x[0-9]+}}, [sp, #48]
285*9880d681SAndroid Build Coastguard Worker; CHECK: str {{q[0-9]+}}, [sp, #32]
286*9880d681SAndroid Build Coastguard Worker; CHECK: str {{x[0-9]+}}, [sp, #16]
287*9880d681SAndroid Build Coastguard Worker; CHECK: str {{q[0-9]+}}, [sp]
288*9880d681SAndroid Build Coastguard Worker; CHECK: add x1, sp, #32
289*9880d681SAndroid Build Coastguard Worker; CHECK: mov x2, sp
290*9880d681SAndroid Build Coastguard Worker; Space for s1 is allocated at sp+32
291*9880d681SAndroid Build Coastguard Worker; Space for s2 is allocated at sp
292*9880d681SAndroid Build Coastguard Worker
293*9880d681SAndroid Build Coastguard Worker; FAST-LABEL: caller42
294*9880d681SAndroid Build Coastguard Worker; FAST: sub sp, sp, #112
295*9880d681SAndroid Build Coastguard Worker; Space for s1 is allocated at fp-24 = sp+72
296*9880d681SAndroid Build Coastguard Worker; Space for s2 is allocated at sp+48
297*9880d681SAndroid Build Coastguard Worker; FAST: sub x[[A:[0-9]+]], x29, #24
298*9880d681SAndroid Build Coastguard Worker; FAST: add x[[A:[0-9]+]], sp, #48
299*9880d681SAndroid Build Coastguard Worker; Call memcpy with size = 24 (0x18)
300*9880d681SAndroid Build Coastguard Worker; FAST: orr {{x[0-9]+}}, xzr, #0x18
301*9880d681SAndroid Build Coastguard Worker  %tmp = alloca %struct.s42, align 4
302*9880d681SAndroid Build Coastguard Worker  %tmp1 = alloca %struct.s42, align 4
303*9880d681SAndroid Build Coastguard Worker  %0 = bitcast %struct.s42* %tmp to i8*
304*9880d681SAndroid Build Coastguard Worker  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast (%struct.s42* @g42 to i8*), i64 24, i32 4, i1 false), !tbaa.struct !4
305*9880d681SAndroid Build Coastguard Worker  %1 = bitcast %struct.s42* %tmp1 to i8*
306*9880d681SAndroid Build Coastguard Worker  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* bitcast (%struct.s42* @g42_2 to i8*), i64 24, i32 4, i1 false), !tbaa.struct !4
307*9880d681SAndroid Build Coastguard Worker  %call = call i32 @f42(i32 3, %struct.s42* %tmp, %struct.s42* %tmp1) #5
308*9880d681SAndroid Build Coastguard Worker  ret i32 %call
309*9880d681SAndroid Build Coastguard Worker}
310*9880d681SAndroid Build Coastguard Worker
311*9880d681SAndroid Build Coastguard Workerdeclare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) #4
312*9880d681SAndroid Build Coastguard Worker
313*9880d681SAndroid Build Coastguard Workerdeclare i32 @f42_stack(i32 %i, i32 %i2, i32 %i3, i32 %i4, i32 %i5, i32 %i6,
314*9880d681SAndroid Build Coastguard Worker                       i32 %i7, i32 %i8, i32 %i9, %struct.s42* nocapture %s1,
315*9880d681SAndroid Build Coastguard Worker                       %struct.s42* nocapture %s2) #2
316*9880d681SAndroid Build Coastguard Worker
317*9880d681SAndroid Build Coastguard Workerdefine i32 @caller42_stack() #3 {
318*9880d681SAndroid Build Coastguard Workerentry:
319*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: caller42_stack
320*9880d681SAndroid Build Coastguard Worker; CHECK: sub sp, sp, #112
321*9880d681SAndroid Build Coastguard Worker; CHECK: add x29, sp, #96
322*9880d681SAndroid Build Coastguard Worker; CHECK: stur {{x[0-9]+}}, [x29, #-16]
323*9880d681SAndroid Build Coastguard Worker; CHECK: stur {{q[0-9]+}}, [x29, #-32]
324*9880d681SAndroid Build Coastguard Worker; CHECK: str {{x[0-9]+}}, [sp, #48]
325*9880d681SAndroid Build Coastguard Worker; CHECK: str {{q[0-9]+}}, [sp, #32]
326*9880d681SAndroid Build Coastguard Worker; Space for s1 is allocated at x29-32 = sp+64
327*9880d681SAndroid Build Coastguard Worker; Space for s2 is allocated at sp+32
328*9880d681SAndroid Build Coastguard Worker; CHECK: add x[[B:[0-9]+]], sp, #32
329*9880d681SAndroid Build Coastguard Worker; CHECK: str x[[B]], [sp, #16]
330*9880d681SAndroid Build Coastguard Worker; CHECK: sub x[[A:[0-9]+]], x29, #32
331*9880d681SAndroid Build Coastguard Worker; Address of s1 is passed on stack at sp+8
332*9880d681SAndroid Build Coastguard Worker; CHECK: str x[[A]], [sp, #8]
333*9880d681SAndroid Build Coastguard Worker; CHECK: mov w[[C:[0-9]+]], #9
334*9880d681SAndroid Build Coastguard Worker; CHECK: str w[[C]], [sp]
335*9880d681SAndroid Build Coastguard Worker
336*9880d681SAndroid Build Coastguard Worker; FAST-LABEL: caller42_stack
337*9880d681SAndroid Build Coastguard Worker; Space for s1 is allocated at fp-24
338*9880d681SAndroid Build Coastguard Worker; Space for s2 is allocated at fp-48
339*9880d681SAndroid Build Coastguard Worker; FAST: sub x[[A:[0-9]+]], x29, #24
340*9880d681SAndroid Build Coastguard Worker; FAST: sub x[[B:[0-9]+]], x29, #48
341*9880d681SAndroid Build Coastguard Worker; Call memcpy with size = 24 (0x18)
342*9880d681SAndroid Build Coastguard Worker; FAST: orr {{x[0-9]+}}, xzr, #0x18
343*9880d681SAndroid Build Coastguard Worker; FAST: str {{w[0-9]+}}, [sp]
344*9880d681SAndroid Build Coastguard Worker; Address of s1 is passed on stack at sp+8
345*9880d681SAndroid Build Coastguard Worker; FAST: str {{x[0-9]+}}, [sp, #8]
346*9880d681SAndroid Build Coastguard Worker; FAST: str {{x[0-9]+}}, [sp, #16]
347*9880d681SAndroid Build Coastguard Worker  %tmp = alloca %struct.s42, align 4
348*9880d681SAndroid Build Coastguard Worker  %tmp1 = alloca %struct.s42, align 4
349*9880d681SAndroid Build Coastguard Worker  %0 = bitcast %struct.s42* %tmp to i8*
350*9880d681SAndroid Build Coastguard Worker  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast (%struct.s42* @g42 to i8*), i64 24, i32 4, i1 false), !tbaa.struct !4
351*9880d681SAndroid Build Coastguard Worker  %1 = bitcast %struct.s42* %tmp1 to i8*
352*9880d681SAndroid Build Coastguard Worker  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* bitcast (%struct.s42* @g42_2 to i8*), i64 24, i32 4, i1 false), !tbaa.struct !4
353*9880d681SAndroid Build Coastguard Worker  %call = call i32 @f42_stack(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7,
354*9880d681SAndroid Build Coastguard Worker                       i32 8, i32 9, %struct.s42* %tmp, %struct.s42* %tmp1) #5
355*9880d681SAndroid Build Coastguard Worker  ret i32 %call
356*9880d681SAndroid Build Coastguard Worker}
357*9880d681SAndroid Build Coastguard Worker
358*9880d681SAndroid Build Coastguard Worker; structs with size of 22 bytes, alignment of 16
359*9880d681SAndroid Build Coastguard Worker; passed indirectly in x1 and x2
360*9880d681SAndroid Build Coastguard Workerdefine i32 @f43(i32 %i, %struct.s43* nocapture %s1, %struct.s43* nocapture %s2) #2 {
361*9880d681SAndroid Build Coastguard Workerentry:
362*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: f43
363*9880d681SAndroid Build Coastguard Worker; CHECK: ldr w[[A:[0-9]+]], [x1]
364*9880d681SAndroid Build Coastguard Worker; CHECK: ldr w[[B:[0-9]+]], [x2]
365*9880d681SAndroid Build Coastguard Worker; CHECK: add w[[C:[0-9]+]], w[[A]], w0
366*9880d681SAndroid Build Coastguard Worker; CHECK: add {{w[0-9]+}}, w[[C]], w[[B]]
367*9880d681SAndroid Build Coastguard Worker; FAST-LABEL: f43
368*9880d681SAndroid Build Coastguard Worker; FAST: ldr w[[A:[0-9]+]], [x1]
369*9880d681SAndroid Build Coastguard Worker; FAST: ldr w[[B:[0-9]+]], [x2]
370*9880d681SAndroid Build Coastguard Worker; FAST: add w[[C:[0-9]+]], w[[A]], w0
371*9880d681SAndroid Build Coastguard Worker; FAST: add {{w[0-9]+}}, w[[C]], w[[B]]
372*9880d681SAndroid Build Coastguard Worker  %i1 = getelementptr inbounds %struct.s43, %struct.s43* %s1, i64 0, i32 0
373*9880d681SAndroid Build Coastguard Worker  %0 = load i32, i32* %i1, align 4, !tbaa !0
374*9880d681SAndroid Build Coastguard Worker  %i2 = getelementptr inbounds %struct.s43, %struct.s43* %s2, i64 0, i32 0
375*9880d681SAndroid Build Coastguard Worker  %1 = load i32, i32* %i2, align 4, !tbaa !0
376*9880d681SAndroid Build Coastguard Worker  %s = getelementptr inbounds %struct.s43, %struct.s43* %s1, i64 0, i32 1
377*9880d681SAndroid Build Coastguard Worker  %2 = load i16, i16* %s, align 2, !tbaa !3
378*9880d681SAndroid Build Coastguard Worker  %conv = sext i16 %2 to i32
379*9880d681SAndroid Build Coastguard Worker  %s5 = getelementptr inbounds %struct.s43, %struct.s43* %s2, i64 0, i32 1
380*9880d681SAndroid Build Coastguard Worker  %3 = load i16, i16* %s5, align 2, !tbaa !3
381*9880d681SAndroid Build Coastguard Worker  %conv6 = sext i16 %3 to i32
382*9880d681SAndroid Build Coastguard Worker  %add = add i32 %0, %i
383*9880d681SAndroid Build Coastguard Worker  %add3 = add i32 %add, %1
384*9880d681SAndroid Build Coastguard Worker  %add4 = add i32 %add3, %conv
385*9880d681SAndroid Build Coastguard Worker  %add7 = add i32 %add4, %conv6
386*9880d681SAndroid Build Coastguard Worker  ret i32 %add7
387*9880d681SAndroid Build Coastguard Worker}
388*9880d681SAndroid Build Coastguard Worker
389*9880d681SAndroid Build Coastguard Workerdefine i32 @caller43() #3 {
390*9880d681SAndroid Build Coastguard Workerentry:
391*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: caller43
392*9880d681SAndroid Build Coastguard Worker; CHECK: str {{q[0-9]+}}, [sp, #48]
393*9880d681SAndroid Build Coastguard Worker; CHECK: str {{q[0-9]+}}, [sp, #32]
394*9880d681SAndroid Build Coastguard Worker; CHECK: str {{q[0-9]+}}, [sp, #16]
395*9880d681SAndroid Build Coastguard Worker; CHECK: str {{q[0-9]+}}, [sp]
396*9880d681SAndroid Build Coastguard Worker; CHECK: add x1, sp, #32
397*9880d681SAndroid Build Coastguard Worker; CHECK: mov x2, sp
398*9880d681SAndroid Build Coastguard Worker; Space for s1 is allocated at sp+32
399*9880d681SAndroid Build Coastguard Worker; Space for s2 is allocated at sp
400*9880d681SAndroid Build Coastguard Worker
401*9880d681SAndroid Build Coastguard Worker; FAST-LABEL: caller43
402*9880d681SAndroid Build Coastguard Worker; FAST: add x29, sp, #64
403*9880d681SAndroid Build Coastguard Worker; Space for s1 is allocated at sp+32
404*9880d681SAndroid Build Coastguard Worker; Space for s2 is allocated at sp
405*9880d681SAndroid Build Coastguard Worker; FAST: add x1, sp, #32
406*9880d681SAndroid Build Coastguard Worker; FAST: mov x2, sp
407*9880d681SAndroid Build Coastguard Worker; FAST: str {{x[0-9]+}}, [sp, #32]
408*9880d681SAndroid Build Coastguard Worker; FAST: str {{x[0-9]+}}, [sp, #40]
409*9880d681SAndroid Build Coastguard Worker; FAST: str {{x[0-9]+}}, [sp, #48]
410*9880d681SAndroid Build Coastguard Worker; FAST: str {{x[0-9]+}}, [sp, #56]
411*9880d681SAndroid Build Coastguard Worker; FAST: str {{x[0-9]+}}, [sp]
412*9880d681SAndroid Build Coastguard Worker; FAST: str {{x[0-9]+}}, [sp, #8]
413*9880d681SAndroid Build Coastguard Worker; FAST: str {{x[0-9]+}}, [sp, #16]
414*9880d681SAndroid Build Coastguard Worker; FAST: str {{x[0-9]+}}, [sp, #24]
415*9880d681SAndroid Build Coastguard Worker  %tmp = alloca %struct.s43, align 16
416*9880d681SAndroid Build Coastguard Worker  %tmp1 = alloca %struct.s43, align 16
417*9880d681SAndroid Build Coastguard Worker  %0 = bitcast %struct.s43* %tmp to i8*
418*9880d681SAndroid Build Coastguard Worker  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast (%struct.s43* @g43 to i8*), i64 32, i32 16, i1 false), !tbaa.struct !4
419*9880d681SAndroid Build Coastguard Worker  %1 = bitcast %struct.s43* %tmp1 to i8*
420*9880d681SAndroid Build Coastguard Worker  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* bitcast (%struct.s43* @g43_2 to i8*), i64 32, i32 16, i1 false), !tbaa.struct !4
421*9880d681SAndroid Build Coastguard Worker  %call = call i32 @f43(i32 3, %struct.s43* %tmp, %struct.s43* %tmp1) #5
422*9880d681SAndroid Build Coastguard Worker  ret i32 %call
423*9880d681SAndroid Build Coastguard Worker}
424*9880d681SAndroid Build Coastguard Worker
425*9880d681SAndroid Build Coastguard Workerdeclare i32 @f43_stack(i32 %i, i32 %i2, i32 %i3, i32 %i4, i32 %i5, i32 %i6,
426*9880d681SAndroid Build Coastguard Worker                       i32 %i7, i32 %i8, i32 %i9, %struct.s43* nocapture %s1,
427*9880d681SAndroid Build Coastguard Worker                       %struct.s43* nocapture %s2) #2
428*9880d681SAndroid Build Coastguard Worker
429*9880d681SAndroid Build Coastguard Workerdefine i32 @caller43_stack() #3 {
430*9880d681SAndroid Build Coastguard Workerentry:
431*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: caller43_stack
432*9880d681SAndroid Build Coastguard Worker; CHECK: sub sp, sp, #112
433*9880d681SAndroid Build Coastguard Worker; CHECK: add x29, sp, #96
434*9880d681SAndroid Build Coastguard Worker; CHECK: stur {{q[0-9]+}}, [x29, #-16]
435*9880d681SAndroid Build Coastguard Worker; CHECK: stur {{q[0-9]+}}, [x29, #-32]
436*9880d681SAndroid Build Coastguard Worker; CHECK: str {{q[0-9]+}}, [sp, #48]
437*9880d681SAndroid Build Coastguard Worker; CHECK: str {{q[0-9]+}}, [sp, #32]
438*9880d681SAndroid Build Coastguard Worker; Space for s1 is allocated at x29-32 = sp+64
439*9880d681SAndroid Build Coastguard Worker; Space for s2 is allocated at sp+32
440*9880d681SAndroid Build Coastguard Worker; CHECK: add x[[B:[0-9]+]], sp, #32
441*9880d681SAndroid Build Coastguard Worker; CHECK: str x[[B]], [sp, #16]
442*9880d681SAndroid Build Coastguard Worker; CHECK: sub x[[A:[0-9]+]], x29, #32
443*9880d681SAndroid Build Coastguard Worker; Address of s1 is passed on stack at sp+8
444*9880d681SAndroid Build Coastguard Worker; CHECK: str x[[A]], [sp, #8]
445*9880d681SAndroid Build Coastguard Worker; CHECK: mov w[[C:[0-9]+]], #9
446*9880d681SAndroid Build Coastguard Worker; CHECK: str w[[C]], [sp]
447*9880d681SAndroid Build Coastguard Worker
448*9880d681SAndroid Build Coastguard Worker; FAST-LABEL: caller43_stack
449*9880d681SAndroid Build Coastguard Worker; FAST: sub sp, sp, #112
450*9880d681SAndroid Build Coastguard Worker; Space for s1 is allocated at fp-32 = sp+64
451*9880d681SAndroid Build Coastguard Worker; Space for s2 is allocated at sp+32
452*9880d681SAndroid Build Coastguard Worker; FAST: sub x[[A:[0-9]+]], x29, #32
453*9880d681SAndroid Build Coastguard Worker; FAST: add x[[B:[0-9]+]], sp, #32
454*9880d681SAndroid Build Coastguard Worker; FAST: stur {{x[0-9]+}}, [x29, #-32]
455*9880d681SAndroid Build Coastguard Worker; FAST: stur {{x[0-9]+}}, [x29, #-24]
456*9880d681SAndroid Build Coastguard Worker; FAST: stur {{x[0-9]+}}, [x29, #-16]
457*9880d681SAndroid Build Coastguard Worker; FAST: stur {{x[0-9]+}}, [x29, #-8]
458*9880d681SAndroid Build Coastguard Worker; FAST: str {{x[0-9]+}}, [sp, #32]
459*9880d681SAndroid Build Coastguard Worker; FAST: str {{x[0-9]+}}, [sp, #40]
460*9880d681SAndroid Build Coastguard Worker; FAST: str {{x[0-9]+}}, [sp, #48]
461*9880d681SAndroid Build Coastguard Worker; FAST: str {{x[0-9]+}}, [sp, #56]
462*9880d681SAndroid Build Coastguard Worker; FAST: str {{w[0-9]+}}, [sp]
463*9880d681SAndroid Build Coastguard Worker; Address of s1 is passed on stack at sp+8
464*9880d681SAndroid Build Coastguard Worker; FAST: str {{x[0-9]+}}, [sp, #8]
465*9880d681SAndroid Build Coastguard Worker; FAST: str {{x[0-9]+}}, [sp, #16]
466*9880d681SAndroid Build Coastguard Worker  %tmp = alloca %struct.s43, align 16
467*9880d681SAndroid Build Coastguard Worker  %tmp1 = alloca %struct.s43, align 16
468*9880d681SAndroid Build Coastguard Worker  %0 = bitcast %struct.s43* %tmp to i8*
469*9880d681SAndroid Build Coastguard Worker  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast (%struct.s43* @g43 to i8*), i64 32, i32 16, i1 false), !tbaa.struct !4
470*9880d681SAndroid Build Coastguard Worker  %1 = bitcast %struct.s43* %tmp1 to i8*
471*9880d681SAndroid Build Coastguard Worker  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* bitcast (%struct.s43* @g43_2 to i8*), i64 32, i32 16, i1 false), !tbaa.struct !4
472*9880d681SAndroid Build Coastguard Worker  %call = call i32 @f43_stack(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7,
473*9880d681SAndroid Build Coastguard Worker                       i32 8, i32 9, %struct.s43* %tmp, %struct.s43* %tmp1) #5
474*9880d681SAndroid Build Coastguard Worker  ret i32 %call
475*9880d681SAndroid Build Coastguard Worker}
476*9880d681SAndroid Build Coastguard Worker
477*9880d681SAndroid Build Coastguard Worker; rdar://13668927
478*9880d681SAndroid Build Coastguard Worker; Check that we don't split an i128.
479*9880d681SAndroid Build Coastguard Workerdeclare i32 @callee_i128_split(i32 %i, i32 %i2, i32 %i3, i32 %i4, i32 %i5,
480*9880d681SAndroid Build Coastguard Worker                               i32 %i6, i32 %i7, i128 %s1, i32 %i8)
481*9880d681SAndroid Build Coastguard Worker
482*9880d681SAndroid Build Coastguard Workerdefine i32 @i128_split() {
483*9880d681SAndroid Build Coastguard Workerentry:
484*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: i128_split
485*9880d681SAndroid Build Coastguard Worker; "i128 %0" should be on stack at [sp].
486*9880d681SAndroid Build Coastguard Worker; "i32 8" should be on stack at [sp, #16].
487*9880d681SAndroid Build Coastguard Worker; CHECK: str {{w[0-9]+}}, [sp, #16]
488*9880d681SAndroid Build Coastguard Worker; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp]
489*9880d681SAndroid Build Coastguard Worker; FAST-LABEL: i128_split
490*9880d681SAndroid Build Coastguard Worker; FAST: sub sp, sp
491*9880d681SAndroid Build Coastguard Worker; FAST: mov x[[ADDR:[0-9]+]], sp
492*9880d681SAndroid Build Coastguard Worker; FAST: str {{w[0-9]+}}, [x[[ADDR]], #16]
493*9880d681SAndroid Build Coastguard Worker; Load/Store opt is disabled with -O0, so the i128 is split.
494*9880d681SAndroid Build Coastguard Worker; FAST: str {{x[0-9]+}}, [x[[ADDR]], #8]
495*9880d681SAndroid Build Coastguard Worker; FAST: str {{x[0-9]+}}, [x[[ADDR]]]
496*9880d681SAndroid Build Coastguard Worker  %0 = load i128, i128* bitcast (%struct.s41* @g41 to i128*), align 16
497*9880d681SAndroid Build Coastguard Worker  %call = tail call i32 @callee_i128_split(i32 1, i32 2, i32 3, i32 4, i32 5,
498*9880d681SAndroid Build Coastguard Worker                                           i32 6, i32 7, i128 %0, i32 8) #5
499*9880d681SAndroid Build Coastguard Worker  ret i32 %call
500*9880d681SAndroid Build Coastguard Worker}
501*9880d681SAndroid Build Coastguard Worker
502*9880d681SAndroid Build Coastguard Workerdeclare i32 @callee_i64(i32 %i, i32 %i2, i32 %i3, i32 %i4, i32 %i5,
503*9880d681SAndroid Build Coastguard Worker                               i32 %i6, i32 %i7, i64 %s1, i32 %i8)
504*9880d681SAndroid Build Coastguard Worker
505*9880d681SAndroid Build Coastguard Workerdefine i32 @i64_split() {
506*9880d681SAndroid Build Coastguard Workerentry:
507*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: i64_split
508*9880d681SAndroid Build Coastguard Worker; "i64 %0" should be in register x7.
509*9880d681SAndroid Build Coastguard Worker; "i32 8" should be on stack at [sp].
510*9880d681SAndroid Build Coastguard Worker; CHECK: ldr x7, [{{x[0-9]+}}]
511*9880d681SAndroid Build Coastguard Worker; CHECK: str {{w[0-9]+}}, [sp]
512*9880d681SAndroid Build Coastguard Worker; FAST-LABEL: i64_split
513*9880d681SAndroid Build Coastguard Worker; FAST: ldr x7, [{{x[0-9]+}}]
514*9880d681SAndroid Build Coastguard Worker; FAST: mov x[[R0:[0-9]+]], sp
515*9880d681SAndroid Build Coastguard Worker; FAST: orr w[[R1:[0-9]+]], wzr, #0x8
516*9880d681SAndroid Build Coastguard Worker; FAST: str w[[R1]], {{\[}}x[[R0]]{{\]}}
517*9880d681SAndroid Build Coastguard Worker  %0 = load i64, i64* bitcast (%struct.s41* @g41 to i64*), align 16
518*9880d681SAndroid Build Coastguard Worker  %call = tail call i32 @callee_i64(i32 1, i32 2, i32 3, i32 4, i32 5,
519*9880d681SAndroid Build Coastguard Worker                                    i32 6, i32 7, i64 %0, i32 8) #5
520*9880d681SAndroid Build Coastguard Worker  ret i32 %call
521*9880d681SAndroid Build Coastguard Worker}
522*9880d681SAndroid Build Coastguard Worker
523*9880d681SAndroid Build Coastguard Workerattributes #0 = { noinline nounwind readnone "fp-contract-model"="standard" "relocation-model"="pic" "ssp-buffers-size"="8" }
524*9880d681SAndroid Build Coastguard Workerattributes #1 = { nounwind readonly "fp-contract-model"="standard" "relocation-model"="pic" "ssp-buffers-size"="8" }
525*9880d681SAndroid Build Coastguard Workerattributes #2 = { noinline nounwind readonly "fp-contract-model"="standard" "relocation-model"="pic" "ssp-buffers-size"="8" }
526*9880d681SAndroid Build Coastguard Workerattributes #3 = { nounwind "fp-contract-model"="standard" "relocation-model"="pic" "ssp-buffers-size"="8" }
527*9880d681SAndroid Build Coastguard Workerattributes #4 = { nounwind }
528*9880d681SAndroid Build Coastguard Workerattributes #5 = { nobuiltin }
529*9880d681SAndroid Build Coastguard Worker
530*9880d681SAndroid Build Coastguard Worker!0 = !{!"int", !1}
531*9880d681SAndroid Build Coastguard Worker!1 = !{!"omnipotent char", !2}
532*9880d681SAndroid Build Coastguard Worker!2 = !{!"Simple C/C++ TBAA"}
533*9880d681SAndroid Build Coastguard Worker!3 = !{!"short", !1}
534*9880d681SAndroid Build Coastguard Worker!4 = !{i64 0, i64 4, !0, i64 4, i64 2, !3, i64 8, i64 4, !0, i64 12, i64 2, !3, i64 16, i64 4, !0, i64 20, i64 2, !3}
535