1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
3 ; RUN: | FileCheck %s -check-prefix=RV32I
4 ; RUN: llc -mtriple=riscv32 -target-abi ilp32e -verify-machineinstrs < %s \
5 ; RUN: | FileCheck %s -check-prefix=RV32I-ILP32E
6 ; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
7 ; RUN: | FileCheck %s -check-prefix=RV64I
8 ; RUN: llc -mtriple=riscv64 -target-abi lp64e -verify-machineinstrs < %s \
9 ; RUN: | FileCheck %s -check-prefix=RV64I-LP64E
11 declare void @callee(ptr)
13 define void @caller16() {
14 ; RV32I-LABEL: caller16:
16 ; RV32I-NEXT: addi sp, sp, -16
17 ; RV32I-NEXT: .cfi_def_cfa_offset 16
18 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
19 ; RV32I-NEXT: .cfi_offset ra, -4
20 ; RV32I-NEXT: mv a0, sp
21 ; RV32I-NEXT: call callee
22 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
23 ; RV32I-NEXT: .cfi_restore ra
24 ; RV32I-NEXT: addi sp, sp, 16
25 ; RV32I-NEXT: .cfi_def_cfa_offset 0
28 ; RV32I-ILP32E-LABEL: caller16:
29 ; RV32I-ILP32E: # %bb.0:
30 ; RV32I-ILP32E-NEXT: addi sp, sp, -16
31 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 16
32 ; RV32I-ILP32E-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
33 ; RV32I-ILP32E-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
34 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
35 ; RV32I-ILP32E-NEXT: .cfi_offset s0, -8
36 ; RV32I-ILP32E-NEXT: addi s0, sp, 16
37 ; RV32I-ILP32E-NEXT: .cfi_def_cfa s0, 0
38 ; RV32I-ILP32E-NEXT: andi sp, sp, -16
39 ; RV32I-ILP32E-NEXT: mv a0, sp
40 ; RV32I-ILP32E-NEXT: call callee
41 ; RV32I-ILP32E-NEXT: addi sp, s0, -16
42 ; RV32I-ILP32E-NEXT: .cfi_def_cfa sp, 16
43 ; RV32I-ILP32E-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
44 ; RV32I-ILP32E-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
45 ; RV32I-ILP32E-NEXT: .cfi_restore ra
46 ; RV32I-ILP32E-NEXT: .cfi_restore s0
47 ; RV32I-ILP32E-NEXT: addi sp, sp, 16
48 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 0
49 ; RV32I-ILP32E-NEXT: ret
51 ; RV64I-LABEL: caller16:
53 ; RV64I-NEXT: addi sp, sp, -16
54 ; RV64I-NEXT: .cfi_def_cfa_offset 16
55 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
56 ; RV64I-NEXT: .cfi_offset ra, -8
57 ; RV64I-NEXT: mv a0, sp
58 ; RV64I-NEXT: call callee
59 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
60 ; RV64I-NEXT: .cfi_restore ra
61 ; RV64I-NEXT: addi sp, sp, 16
62 ; RV64I-NEXT: .cfi_def_cfa_offset 0
65 ; RV64I-LP64E-LABEL: caller16:
66 ; RV64I-LP64E: # %bb.0:
67 ; RV64I-LP64E-NEXT: addi sp, sp, -32
68 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 32
69 ; RV64I-LP64E-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
70 ; RV64I-LP64E-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
71 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
72 ; RV64I-LP64E-NEXT: .cfi_offset s0, -16
73 ; RV64I-LP64E-NEXT: addi s0, sp, 32
74 ; RV64I-LP64E-NEXT: .cfi_def_cfa s0, 0
75 ; RV64I-LP64E-NEXT: andi sp, sp, -16
76 ; RV64I-LP64E-NEXT: mv a0, sp
77 ; RV64I-LP64E-NEXT: call callee
78 ; RV64I-LP64E-NEXT: addi sp, s0, -32
79 ; RV64I-LP64E-NEXT: .cfi_def_cfa sp, 32
80 ; RV64I-LP64E-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
81 ; RV64I-LP64E-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
82 ; RV64I-LP64E-NEXT: .cfi_restore ra
83 ; RV64I-LP64E-NEXT: .cfi_restore s0
84 ; RV64I-LP64E-NEXT: addi sp, sp, 32
85 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 0
86 ; RV64I-LP64E-NEXT: ret
87 %1 = alloca i8, align 16
88 call void @callee(ptr %1)
92 define void @caller_no_realign16() "no-realign-stack" {
93 ; RV32I-LABEL: caller_no_realign16:
95 ; RV32I-NEXT: addi sp, sp, -16
96 ; RV32I-NEXT: .cfi_def_cfa_offset 16
97 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
98 ; RV32I-NEXT: .cfi_offset ra, -4
99 ; RV32I-NEXT: mv a0, sp
100 ; RV32I-NEXT: call callee
101 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
102 ; RV32I-NEXT: .cfi_restore ra
103 ; RV32I-NEXT: addi sp, sp, 16
104 ; RV32I-NEXT: .cfi_def_cfa_offset 0
107 ; RV32I-ILP32E-LABEL: caller_no_realign16:
108 ; RV32I-ILP32E: # %bb.0:
109 ; RV32I-ILP32E-NEXT: addi sp, sp, -8
110 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 8
111 ; RV32I-ILP32E-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
112 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
113 ; RV32I-ILP32E-NEXT: mv a0, sp
114 ; RV32I-ILP32E-NEXT: call callee
115 ; RV32I-ILP32E-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
116 ; RV32I-ILP32E-NEXT: .cfi_restore ra
117 ; RV32I-ILP32E-NEXT: addi sp, sp, 8
118 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 0
119 ; RV32I-ILP32E-NEXT: ret
121 ; RV64I-LABEL: caller_no_realign16:
123 ; RV64I-NEXT: addi sp, sp, -16
124 ; RV64I-NEXT: .cfi_def_cfa_offset 16
125 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
126 ; RV64I-NEXT: .cfi_offset ra, -8
127 ; RV64I-NEXT: mv a0, sp
128 ; RV64I-NEXT: call callee
129 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
130 ; RV64I-NEXT: .cfi_restore ra
131 ; RV64I-NEXT: addi sp, sp, 16
132 ; RV64I-NEXT: .cfi_def_cfa_offset 0
135 ; RV64I-LP64E-LABEL: caller_no_realign16:
136 ; RV64I-LP64E: # %bb.0:
137 ; RV64I-LP64E-NEXT: addi sp, sp, -16
138 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 16
139 ; RV64I-LP64E-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
140 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
141 ; RV64I-LP64E-NEXT: mv a0, sp
142 ; RV64I-LP64E-NEXT: call callee
143 ; RV64I-LP64E-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
144 ; RV64I-LP64E-NEXT: .cfi_restore ra
145 ; RV64I-LP64E-NEXT: addi sp, sp, 16
146 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 0
147 ; RV64I-LP64E-NEXT: ret
148 %1 = alloca i8, align 16
149 call void @callee(ptr %1)
153 define void @caller32() {
154 ; RV32I-LABEL: caller32:
156 ; RV32I-NEXT: addi sp, sp, -32
157 ; RV32I-NEXT: .cfi_def_cfa_offset 32
158 ; RV32I-NEXT: sw ra, 28(sp) # 4-byte Folded Spill
159 ; RV32I-NEXT: sw s0, 24(sp) # 4-byte Folded Spill
160 ; RV32I-NEXT: .cfi_offset ra, -4
161 ; RV32I-NEXT: .cfi_offset s0, -8
162 ; RV32I-NEXT: addi s0, sp, 32
163 ; RV32I-NEXT: .cfi_def_cfa s0, 0
164 ; RV32I-NEXT: andi sp, sp, -32
165 ; RV32I-NEXT: mv a0, sp
166 ; RV32I-NEXT: call callee
167 ; RV32I-NEXT: addi sp, s0, -32
168 ; RV32I-NEXT: .cfi_def_cfa sp, 32
169 ; RV32I-NEXT: lw ra, 28(sp) # 4-byte Folded Reload
170 ; RV32I-NEXT: lw s0, 24(sp) # 4-byte Folded Reload
171 ; RV32I-NEXT: .cfi_restore ra
172 ; RV32I-NEXT: .cfi_restore s0
173 ; RV32I-NEXT: addi sp, sp, 32
174 ; RV32I-NEXT: .cfi_def_cfa_offset 0
177 ; RV32I-ILP32E-LABEL: caller32:
178 ; RV32I-ILP32E: # %bb.0:
179 ; RV32I-ILP32E-NEXT: addi sp, sp, -32
180 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 32
181 ; RV32I-ILP32E-NEXT: sw ra, 28(sp) # 4-byte Folded Spill
182 ; RV32I-ILP32E-NEXT: sw s0, 24(sp) # 4-byte Folded Spill
183 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
184 ; RV32I-ILP32E-NEXT: .cfi_offset s0, -8
185 ; RV32I-ILP32E-NEXT: addi s0, sp, 32
186 ; RV32I-ILP32E-NEXT: .cfi_def_cfa s0, 0
187 ; RV32I-ILP32E-NEXT: andi sp, sp, -32
188 ; RV32I-ILP32E-NEXT: mv a0, sp
189 ; RV32I-ILP32E-NEXT: call callee
190 ; RV32I-ILP32E-NEXT: addi sp, s0, -32
191 ; RV32I-ILP32E-NEXT: .cfi_def_cfa sp, 32
192 ; RV32I-ILP32E-NEXT: lw ra, 28(sp) # 4-byte Folded Reload
193 ; RV32I-ILP32E-NEXT: lw s0, 24(sp) # 4-byte Folded Reload
194 ; RV32I-ILP32E-NEXT: .cfi_restore ra
195 ; RV32I-ILP32E-NEXT: .cfi_restore s0
196 ; RV32I-ILP32E-NEXT: addi sp, sp, 32
197 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 0
198 ; RV32I-ILP32E-NEXT: ret
200 ; RV64I-LABEL: caller32:
202 ; RV64I-NEXT: addi sp, sp, -32
203 ; RV64I-NEXT: .cfi_def_cfa_offset 32
204 ; RV64I-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
205 ; RV64I-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
206 ; RV64I-NEXT: .cfi_offset ra, -8
207 ; RV64I-NEXT: .cfi_offset s0, -16
208 ; RV64I-NEXT: addi s0, sp, 32
209 ; RV64I-NEXT: .cfi_def_cfa s0, 0
210 ; RV64I-NEXT: andi sp, sp, -32
211 ; RV64I-NEXT: mv a0, sp
212 ; RV64I-NEXT: call callee
213 ; RV64I-NEXT: addi sp, s0, -32
214 ; RV64I-NEXT: .cfi_def_cfa sp, 32
215 ; RV64I-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
216 ; RV64I-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
217 ; RV64I-NEXT: .cfi_restore ra
218 ; RV64I-NEXT: .cfi_restore s0
219 ; RV64I-NEXT: addi sp, sp, 32
220 ; RV64I-NEXT: .cfi_def_cfa_offset 0
223 ; RV64I-LP64E-LABEL: caller32:
224 ; RV64I-LP64E: # %bb.0:
225 ; RV64I-LP64E-NEXT: addi sp, sp, -32
226 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 32
227 ; RV64I-LP64E-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
228 ; RV64I-LP64E-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
229 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
230 ; RV64I-LP64E-NEXT: .cfi_offset s0, -16
231 ; RV64I-LP64E-NEXT: addi s0, sp, 32
232 ; RV64I-LP64E-NEXT: .cfi_def_cfa s0, 0
233 ; RV64I-LP64E-NEXT: andi sp, sp, -32
234 ; RV64I-LP64E-NEXT: mv a0, sp
235 ; RV64I-LP64E-NEXT: call callee
236 ; RV64I-LP64E-NEXT: addi sp, s0, -32
237 ; RV64I-LP64E-NEXT: .cfi_def_cfa sp, 32
238 ; RV64I-LP64E-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
239 ; RV64I-LP64E-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
240 ; RV64I-LP64E-NEXT: .cfi_restore ra
241 ; RV64I-LP64E-NEXT: .cfi_restore s0
242 ; RV64I-LP64E-NEXT: addi sp, sp, 32
243 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 0
244 ; RV64I-LP64E-NEXT: ret
245 %1 = alloca i8, align 32
246 call void @callee(ptr %1)
250 define void @caller_no_realign32() "no-realign-stack" {
251 ; RV32I-LABEL: caller_no_realign32:
253 ; RV32I-NEXT: addi sp, sp, -16
254 ; RV32I-NEXT: .cfi_def_cfa_offset 16
255 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
256 ; RV32I-NEXT: .cfi_offset ra, -4
257 ; RV32I-NEXT: mv a0, sp
258 ; RV32I-NEXT: call callee
259 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
260 ; RV32I-NEXT: .cfi_restore ra
261 ; RV32I-NEXT: addi sp, sp, 16
262 ; RV32I-NEXT: .cfi_def_cfa_offset 0
265 ; RV32I-ILP32E-LABEL: caller_no_realign32:
266 ; RV32I-ILP32E: # %bb.0:
267 ; RV32I-ILP32E-NEXT: addi sp, sp, -8
268 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 8
269 ; RV32I-ILP32E-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
270 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
271 ; RV32I-ILP32E-NEXT: mv a0, sp
272 ; RV32I-ILP32E-NEXT: call callee
273 ; RV32I-ILP32E-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
274 ; RV32I-ILP32E-NEXT: .cfi_restore ra
275 ; RV32I-ILP32E-NEXT: addi sp, sp, 8
276 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 0
277 ; RV32I-ILP32E-NEXT: ret
279 ; RV64I-LABEL: caller_no_realign32:
281 ; RV64I-NEXT: addi sp, sp, -16
282 ; RV64I-NEXT: .cfi_def_cfa_offset 16
283 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
284 ; RV64I-NEXT: .cfi_offset ra, -8
285 ; RV64I-NEXT: mv a0, sp
286 ; RV64I-NEXT: call callee
287 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
288 ; RV64I-NEXT: .cfi_restore ra
289 ; RV64I-NEXT: addi sp, sp, 16
290 ; RV64I-NEXT: .cfi_def_cfa_offset 0
293 ; RV64I-LP64E-LABEL: caller_no_realign32:
294 ; RV64I-LP64E: # %bb.0:
295 ; RV64I-LP64E-NEXT: addi sp, sp, -16
296 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 16
297 ; RV64I-LP64E-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
298 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
299 ; RV64I-LP64E-NEXT: mv a0, sp
300 ; RV64I-LP64E-NEXT: call callee
301 ; RV64I-LP64E-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
302 ; RV64I-LP64E-NEXT: .cfi_restore ra
303 ; RV64I-LP64E-NEXT: addi sp, sp, 16
304 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 0
305 ; RV64I-LP64E-NEXT: ret
306 %1 = alloca i8, align 32
307 call void @callee(ptr %1)
311 define void @caller64() {
312 ; RV32I-LABEL: caller64:
314 ; RV32I-NEXT: addi sp, sp, -64
315 ; RV32I-NEXT: .cfi_def_cfa_offset 64
316 ; RV32I-NEXT: sw ra, 60(sp) # 4-byte Folded Spill
317 ; RV32I-NEXT: sw s0, 56(sp) # 4-byte Folded Spill
318 ; RV32I-NEXT: .cfi_offset ra, -4
319 ; RV32I-NEXT: .cfi_offset s0, -8
320 ; RV32I-NEXT: addi s0, sp, 64
321 ; RV32I-NEXT: .cfi_def_cfa s0, 0
322 ; RV32I-NEXT: andi sp, sp, -64
323 ; RV32I-NEXT: mv a0, sp
324 ; RV32I-NEXT: call callee
325 ; RV32I-NEXT: addi sp, s0, -64
326 ; RV32I-NEXT: .cfi_def_cfa sp, 64
327 ; RV32I-NEXT: lw ra, 60(sp) # 4-byte Folded Reload
328 ; RV32I-NEXT: lw s0, 56(sp) # 4-byte Folded Reload
329 ; RV32I-NEXT: .cfi_restore ra
330 ; RV32I-NEXT: .cfi_restore s0
331 ; RV32I-NEXT: addi sp, sp, 64
332 ; RV32I-NEXT: .cfi_def_cfa_offset 0
335 ; RV32I-ILP32E-LABEL: caller64:
336 ; RV32I-ILP32E: # %bb.0:
337 ; RV32I-ILP32E-NEXT: addi sp, sp, -64
338 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 64
339 ; RV32I-ILP32E-NEXT: sw ra, 60(sp) # 4-byte Folded Spill
340 ; RV32I-ILP32E-NEXT: sw s0, 56(sp) # 4-byte Folded Spill
341 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
342 ; RV32I-ILP32E-NEXT: .cfi_offset s0, -8
343 ; RV32I-ILP32E-NEXT: addi s0, sp, 64
344 ; RV32I-ILP32E-NEXT: .cfi_def_cfa s0, 0
345 ; RV32I-ILP32E-NEXT: andi sp, sp, -64
346 ; RV32I-ILP32E-NEXT: mv a0, sp
347 ; RV32I-ILP32E-NEXT: call callee
348 ; RV32I-ILP32E-NEXT: addi sp, s0, -64
349 ; RV32I-ILP32E-NEXT: .cfi_def_cfa sp, 64
350 ; RV32I-ILP32E-NEXT: lw ra, 60(sp) # 4-byte Folded Reload
351 ; RV32I-ILP32E-NEXT: lw s0, 56(sp) # 4-byte Folded Reload
352 ; RV32I-ILP32E-NEXT: .cfi_restore ra
353 ; RV32I-ILP32E-NEXT: .cfi_restore s0
354 ; RV32I-ILP32E-NEXT: addi sp, sp, 64
355 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 0
356 ; RV32I-ILP32E-NEXT: ret
358 ; RV64I-LABEL: caller64:
360 ; RV64I-NEXT: addi sp, sp, -64
361 ; RV64I-NEXT: .cfi_def_cfa_offset 64
362 ; RV64I-NEXT: sd ra, 56(sp) # 8-byte Folded Spill
363 ; RV64I-NEXT: sd s0, 48(sp) # 8-byte Folded Spill
364 ; RV64I-NEXT: .cfi_offset ra, -8
365 ; RV64I-NEXT: .cfi_offset s0, -16
366 ; RV64I-NEXT: addi s0, sp, 64
367 ; RV64I-NEXT: .cfi_def_cfa s0, 0
368 ; RV64I-NEXT: andi sp, sp, -64
369 ; RV64I-NEXT: mv a0, sp
370 ; RV64I-NEXT: call callee
371 ; RV64I-NEXT: addi sp, s0, -64
372 ; RV64I-NEXT: .cfi_def_cfa sp, 64
373 ; RV64I-NEXT: ld ra, 56(sp) # 8-byte Folded Reload
374 ; RV64I-NEXT: ld s0, 48(sp) # 8-byte Folded Reload
375 ; RV64I-NEXT: .cfi_restore ra
376 ; RV64I-NEXT: .cfi_restore s0
377 ; RV64I-NEXT: addi sp, sp, 64
378 ; RV64I-NEXT: .cfi_def_cfa_offset 0
381 ; RV64I-LP64E-LABEL: caller64:
382 ; RV64I-LP64E: # %bb.0:
383 ; RV64I-LP64E-NEXT: addi sp, sp, -64
384 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 64
385 ; RV64I-LP64E-NEXT: sd ra, 56(sp) # 8-byte Folded Spill
386 ; RV64I-LP64E-NEXT: sd s0, 48(sp) # 8-byte Folded Spill
387 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
388 ; RV64I-LP64E-NEXT: .cfi_offset s0, -16
389 ; RV64I-LP64E-NEXT: addi s0, sp, 64
390 ; RV64I-LP64E-NEXT: .cfi_def_cfa s0, 0
391 ; RV64I-LP64E-NEXT: andi sp, sp, -64
392 ; RV64I-LP64E-NEXT: mv a0, sp
393 ; RV64I-LP64E-NEXT: call callee
394 ; RV64I-LP64E-NEXT: addi sp, s0, -64
395 ; RV64I-LP64E-NEXT: .cfi_def_cfa sp, 64
396 ; RV64I-LP64E-NEXT: ld ra, 56(sp) # 8-byte Folded Reload
397 ; RV64I-LP64E-NEXT: ld s0, 48(sp) # 8-byte Folded Reload
398 ; RV64I-LP64E-NEXT: .cfi_restore ra
399 ; RV64I-LP64E-NEXT: .cfi_restore s0
400 ; RV64I-LP64E-NEXT: addi sp, sp, 64
401 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 0
402 ; RV64I-LP64E-NEXT: ret
403 %1 = alloca i8, align 64
404 call void @callee(ptr %1)
408 define void @caller_no_realign64() "no-realign-stack" {
409 ; RV32I-LABEL: caller_no_realign64:
411 ; RV32I-NEXT: addi sp, sp, -16
412 ; RV32I-NEXT: .cfi_def_cfa_offset 16
413 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
414 ; RV32I-NEXT: .cfi_offset ra, -4
415 ; RV32I-NEXT: mv a0, sp
416 ; RV32I-NEXT: call callee
417 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
418 ; RV32I-NEXT: .cfi_restore ra
419 ; RV32I-NEXT: addi sp, sp, 16
420 ; RV32I-NEXT: .cfi_def_cfa_offset 0
423 ; RV32I-ILP32E-LABEL: caller_no_realign64:
424 ; RV32I-ILP32E: # %bb.0:
425 ; RV32I-ILP32E-NEXT: addi sp, sp, -8
426 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 8
427 ; RV32I-ILP32E-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
428 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
429 ; RV32I-ILP32E-NEXT: mv a0, sp
430 ; RV32I-ILP32E-NEXT: call callee
431 ; RV32I-ILP32E-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
432 ; RV32I-ILP32E-NEXT: .cfi_restore ra
433 ; RV32I-ILP32E-NEXT: addi sp, sp, 8
434 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 0
435 ; RV32I-ILP32E-NEXT: ret
437 ; RV64I-LABEL: caller_no_realign64:
439 ; RV64I-NEXT: addi sp, sp, -16
440 ; RV64I-NEXT: .cfi_def_cfa_offset 16
441 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
442 ; RV64I-NEXT: .cfi_offset ra, -8
443 ; RV64I-NEXT: mv a0, sp
444 ; RV64I-NEXT: call callee
445 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
446 ; RV64I-NEXT: .cfi_restore ra
447 ; RV64I-NEXT: addi sp, sp, 16
448 ; RV64I-NEXT: .cfi_def_cfa_offset 0
451 ; RV64I-LP64E-LABEL: caller_no_realign64:
452 ; RV64I-LP64E: # %bb.0:
453 ; RV64I-LP64E-NEXT: addi sp, sp, -16
454 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 16
455 ; RV64I-LP64E-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
456 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
457 ; RV64I-LP64E-NEXT: mv a0, sp
458 ; RV64I-LP64E-NEXT: call callee
459 ; RV64I-LP64E-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
460 ; RV64I-LP64E-NEXT: .cfi_restore ra
461 ; RV64I-LP64E-NEXT: addi sp, sp, 16
462 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 0
463 ; RV64I-LP64E-NEXT: ret
464 %1 = alloca i8, align 64
465 call void @callee(ptr %1)
469 define void @caller128() {
470 ; RV32I-LABEL: caller128:
472 ; RV32I-NEXT: addi sp, sp, -128
473 ; RV32I-NEXT: .cfi_def_cfa_offset 128
474 ; RV32I-NEXT: sw ra, 124(sp) # 4-byte Folded Spill
475 ; RV32I-NEXT: sw s0, 120(sp) # 4-byte Folded Spill
476 ; RV32I-NEXT: .cfi_offset ra, -4
477 ; RV32I-NEXT: .cfi_offset s0, -8
478 ; RV32I-NEXT: addi s0, sp, 128
479 ; RV32I-NEXT: .cfi_def_cfa s0, 0
480 ; RV32I-NEXT: andi sp, sp, -128
481 ; RV32I-NEXT: mv a0, sp
482 ; RV32I-NEXT: call callee
483 ; RV32I-NEXT: addi sp, s0, -128
484 ; RV32I-NEXT: .cfi_def_cfa sp, 128
485 ; RV32I-NEXT: lw ra, 124(sp) # 4-byte Folded Reload
486 ; RV32I-NEXT: lw s0, 120(sp) # 4-byte Folded Reload
487 ; RV32I-NEXT: .cfi_restore ra
488 ; RV32I-NEXT: .cfi_restore s0
489 ; RV32I-NEXT: addi sp, sp, 128
490 ; RV32I-NEXT: .cfi_def_cfa_offset 0
493 ; RV32I-ILP32E-LABEL: caller128:
494 ; RV32I-ILP32E: # %bb.0:
495 ; RV32I-ILP32E-NEXT: addi sp, sp, -128
496 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 128
497 ; RV32I-ILP32E-NEXT: sw ra, 124(sp) # 4-byte Folded Spill
498 ; RV32I-ILP32E-NEXT: sw s0, 120(sp) # 4-byte Folded Spill
499 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
500 ; RV32I-ILP32E-NEXT: .cfi_offset s0, -8
501 ; RV32I-ILP32E-NEXT: addi s0, sp, 128
502 ; RV32I-ILP32E-NEXT: .cfi_def_cfa s0, 0
503 ; RV32I-ILP32E-NEXT: andi sp, sp, -128
504 ; RV32I-ILP32E-NEXT: mv a0, sp
505 ; RV32I-ILP32E-NEXT: call callee
506 ; RV32I-ILP32E-NEXT: addi sp, s0, -128
507 ; RV32I-ILP32E-NEXT: .cfi_def_cfa sp, 128
508 ; RV32I-ILP32E-NEXT: lw ra, 124(sp) # 4-byte Folded Reload
509 ; RV32I-ILP32E-NEXT: lw s0, 120(sp) # 4-byte Folded Reload
510 ; RV32I-ILP32E-NEXT: .cfi_restore ra
511 ; RV32I-ILP32E-NEXT: .cfi_restore s0
512 ; RV32I-ILP32E-NEXT: addi sp, sp, 128
513 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 0
514 ; RV32I-ILP32E-NEXT: ret
516 ; RV64I-LABEL: caller128:
518 ; RV64I-NEXT: addi sp, sp, -128
519 ; RV64I-NEXT: .cfi_def_cfa_offset 128
520 ; RV64I-NEXT: sd ra, 120(sp) # 8-byte Folded Spill
521 ; RV64I-NEXT: sd s0, 112(sp) # 8-byte Folded Spill
522 ; RV64I-NEXT: .cfi_offset ra, -8
523 ; RV64I-NEXT: .cfi_offset s0, -16
524 ; RV64I-NEXT: addi s0, sp, 128
525 ; RV64I-NEXT: .cfi_def_cfa s0, 0
526 ; RV64I-NEXT: andi sp, sp, -128
527 ; RV64I-NEXT: mv a0, sp
528 ; RV64I-NEXT: call callee
529 ; RV64I-NEXT: addi sp, s0, -128
530 ; RV64I-NEXT: .cfi_def_cfa sp, 128
531 ; RV64I-NEXT: ld ra, 120(sp) # 8-byte Folded Reload
532 ; RV64I-NEXT: ld s0, 112(sp) # 8-byte Folded Reload
533 ; RV64I-NEXT: .cfi_restore ra
534 ; RV64I-NEXT: .cfi_restore s0
535 ; RV64I-NEXT: addi sp, sp, 128
536 ; RV64I-NEXT: .cfi_def_cfa_offset 0
539 ; RV64I-LP64E-LABEL: caller128:
540 ; RV64I-LP64E: # %bb.0:
541 ; RV64I-LP64E-NEXT: addi sp, sp, -128
542 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 128
543 ; RV64I-LP64E-NEXT: sd ra, 120(sp) # 8-byte Folded Spill
544 ; RV64I-LP64E-NEXT: sd s0, 112(sp) # 8-byte Folded Spill
545 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
546 ; RV64I-LP64E-NEXT: .cfi_offset s0, -16
547 ; RV64I-LP64E-NEXT: addi s0, sp, 128
548 ; RV64I-LP64E-NEXT: .cfi_def_cfa s0, 0
549 ; RV64I-LP64E-NEXT: andi sp, sp, -128
550 ; RV64I-LP64E-NEXT: mv a0, sp
551 ; RV64I-LP64E-NEXT: call callee
552 ; RV64I-LP64E-NEXT: addi sp, s0, -128
553 ; RV64I-LP64E-NEXT: .cfi_def_cfa sp, 128
554 ; RV64I-LP64E-NEXT: ld ra, 120(sp) # 8-byte Folded Reload
555 ; RV64I-LP64E-NEXT: ld s0, 112(sp) # 8-byte Folded Reload
556 ; RV64I-LP64E-NEXT: .cfi_restore ra
557 ; RV64I-LP64E-NEXT: .cfi_restore s0
558 ; RV64I-LP64E-NEXT: addi sp, sp, 128
559 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 0
560 ; RV64I-LP64E-NEXT: ret
561 %1 = alloca i8, align 128
562 call void @callee(ptr %1)
566 define void @caller_no_realign128() "no-realign-stack" {
567 ; RV32I-LABEL: caller_no_realign128:
569 ; RV32I-NEXT: addi sp, sp, -16
570 ; RV32I-NEXT: .cfi_def_cfa_offset 16
571 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
572 ; RV32I-NEXT: .cfi_offset ra, -4
573 ; RV32I-NEXT: mv a0, sp
574 ; RV32I-NEXT: call callee
575 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
576 ; RV32I-NEXT: .cfi_restore ra
577 ; RV32I-NEXT: addi sp, sp, 16
578 ; RV32I-NEXT: .cfi_def_cfa_offset 0
581 ; RV32I-ILP32E-LABEL: caller_no_realign128:
582 ; RV32I-ILP32E: # %bb.0:
583 ; RV32I-ILP32E-NEXT: addi sp, sp, -8
584 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 8
585 ; RV32I-ILP32E-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
586 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
587 ; RV32I-ILP32E-NEXT: mv a0, sp
588 ; RV32I-ILP32E-NEXT: call callee
589 ; RV32I-ILP32E-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
590 ; RV32I-ILP32E-NEXT: .cfi_restore ra
591 ; RV32I-ILP32E-NEXT: addi sp, sp, 8
592 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 0
593 ; RV32I-ILP32E-NEXT: ret
595 ; RV64I-LABEL: caller_no_realign128:
597 ; RV64I-NEXT: addi sp, sp, -16
598 ; RV64I-NEXT: .cfi_def_cfa_offset 16
599 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
600 ; RV64I-NEXT: .cfi_offset ra, -8
601 ; RV64I-NEXT: mv a0, sp
602 ; RV64I-NEXT: call callee
603 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
604 ; RV64I-NEXT: .cfi_restore ra
605 ; RV64I-NEXT: addi sp, sp, 16
606 ; RV64I-NEXT: .cfi_def_cfa_offset 0
609 ; RV64I-LP64E-LABEL: caller_no_realign128:
610 ; RV64I-LP64E: # %bb.0:
611 ; RV64I-LP64E-NEXT: addi sp, sp, -16
612 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 16
613 ; RV64I-LP64E-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
614 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
615 ; RV64I-LP64E-NEXT: mv a0, sp
616 ; RV64I-LP64E-NEXT: call callee
617 ; RV64I-LP64E-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
618 ; RV64I-LP64E-NEXT: .cfi_restore ra
619 ; RV64I-LP64E-NEXT: addi sp, sp, 16
620 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 0
621 ; RV64I-LP64E-NEXT: ret
622 %1 = alloca i8, align 128
623 call void @callee(ptr %1)
627 define void @caller256() {
628 ; RV32I-LABEL: caller256:
630 ; RV32I-NEXT: addi sp, sp, -256
631 ; RV32I-NEXT: .cfi_def_cfa_offset 256
632 ; RV32I-NEXT: sw ra, 252(sp) # 4-byte Folded Spill
633 ; RV32I-NEXT: sw s0, 248(sp) # 4-byte Folded Spill
634 ; RV32I-NEXT: .cfi_offset ra, -4
635 ; RV32I-NEXT: .cfi_offset s0, -8
636 ; RV32I-NEXT: addi s0, sp, 256
637 ; RV32I-NEXT: .cfi_def_cfa s0, 0
638 ; RV32I-NEXT: andi sp, sp, -256
639 ; RV32I-NEXT: mv a0, sp
640 ; RV32I-NEXT: call callee
641 ; RV32I-NEXT: addi sp, s0, -256
642 ; RV32I-NEXT: .cfi_def_cfa sp, 256
643 ; RV32I-NEXT: lw ra, 252(sp) # 4-byte Folded Reload
644 ; RV32I-NEXT: lw s0, 248(sp) # 4-byte Folded Reload
645 ; RV32I-NEXT: .cfi_restore ra
646 ; RV32I-NEXT: .cfi_restore s0
647 ; RV32I-NEXT: addi sp, sp, 256
648 ; RV32I-NEXT: .cfi_def_cfa_offset 0
651 ; RV32I-ILP32E-LABEL: caller256:
652 ; RV32I-ILP32E: # %bb.0:
653 ; RV32I-ILP32E-NEXT: addi sp, sp, -256
654 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 256
655 ; RV32I-ILP32E-NEXT: sw ra, 252(sp) # 4-byte Folded Spill
656 ; RV32I-ILP32E-NEXT: sw s0, 248(sp) # 4-byte Folded Spill
657 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
658 ; RV32I-ILP32E-NEXT: .cfi_offset s0, -8
659 ; RV32I-ILP32E-NEXT: addi s0, sp, 256
660 ; RV32I-ILP32E-NEXT: .cfi_def_cfa s0, 0
661 ; RV32I-ILP32E-NEXT: andi sp, sp, -256
662 ; RV32I-ILP32E-NEXT: mv a0, sp
663 ; RV32I-ILP32E-NEXT: call callee
664 ; RV32I-ILP32E-NEXT: addi sp, s0, -256
665 ; RV32I-ILP32E-NEXT: .cfi_def_cfa sp, 256
666 ; RV32I-ILP32E-NEXT: lw ra, 252(sp) # 4-byte Folded Reload
667 ; RV32I-ILP32E-NEXT: lw s0, 248(sp) # 4-byte Folded Reload
668 ; RV32I-ILP32E-NEXT: .cfi_restore ra
669 ; RV32I-ILP32E-NEXT: .cfi_restore s0
670 ; RV32I-ILP32E-NEXT: addi sp, sp, 256
671 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 0
672 ; RV32I-ILP32E-NEXT: ret
674 ; RV64I-LABEL: caller256:
676 ; RV64I-NEXT: addi sp, sp, -256
677 ; RV64I-NEXT: .cfi_def_cfa_offset 256
678 ; RV64I-NEXT: sd ra, 248(sp) # 8-byte Folded Spill
679 ; RV64I-NEXT: sd s0, 240(sp) # 8-byte Folded Spill
680 ; RV64I-NEXT: .cfi_offset ra, -8
681 ; RV64I-NEXT: .cfi_offset s0, -16
682 ; RV64I-NEXT: addi s0, sp, 256
683 ; RV64I-NEXT: .cfi_def_cfa s0, 0
684 ; RV64I-NEXT: andi sp, sp, -256
685 ; RV64I-NEXT: mv a0, sp
686 ; RV64I-NEXT: call callee
687 ; RV64I-NEXT: addi sp, s0, -256
688 ; RV64I-NEXT: .cfi_def_cfa sp, 256
689 ; RV64I-NEXT: ld ra, 248(sp) # 8-byte Folded Reload
690 ; RV64I-NEXT: ld s0, 240(sp) # 8-byte Folded Reload
691 ; RV64I-NEXT: .cfi_restore ra
692 ; RV64I-NEXT: .cfi_restore s0
693 ; RV64I-NEXT: addi sp, sp, 256
694 ; RV64I-NEXT: .cfi_def_cfa_offset 0
697 ; RV64I-LP64E-LABEL: caller256:
698 ; RV64I-LP64E: # %bb.0:
699 ; RV64I-LP64E-NEXT: addi sp, sp, -256
700 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 256
701 ; RV64I-LP64E-NEXT: sd ra, 248(sp) # 8-byte Folded Spill
702 ; RV64I-LP64E-NEXT: sd s0, 240(sp) # 8-byte Folded Spill
703 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
704 ; RV64I-LP64E-NEXT: .cfi_offset s0, -16
705 ; RV64I-LP64E-NEXT: addi s0, sp, 256
706 ; RV64I-LP64E-NEXT: .cfi_def_cfa s0, 0
707 ; RV64I-LP64E-NEXT: andi sp, sp, -256
708 ; RV64I-LP64E-NEXT: mv a0, sp
709 ; RV64I-LP64E-NEXT: call callee
710 ; RV64I-LP64E-NEXT: addi sp, s0, -256
711 ; RV64I-LP64E-NEXT: .cfi_def_cfa sp, 256
712 ; RV64I-LP64E-NEXT: ld ra, 248(sp) # 8-byte Folded Reload
713 ; RV64I-LP64E-NEXT: ld s0, 240(sp) # 8-byte Folded Reload
714 ; RV64I-LP64E-NEXT: .cfi_restore ra
715 ; RV64I-LP64E-NEXT: .cfi_restore s0
716 ; RV64I-LP64E-NEXT: addi sp, sp, 256
717 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 0
718 ; RV64I-LP64E-NEXT: ret
719 %1 = alloca i8, align 256
720 call void @callee(ptr %1)
724 define void @caller_no_realign256() "no-realign-stack" {
725 ; RV32I-LABEL: caller_no_realign256:
727 ; RV32I-NEXT: addi sp, sp, -16
728 ; RV32I-NEXT: .cfi_def_cfa_offset 16
729 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
730 ; RV32I-NEXT: .cfi_offset ra, -4
731 ; RV32I-NEXT: mv a0, sp
732 ; RV32I-NEXT: call callee
733 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
734 ; RV32I-NEXT: .cfi_restore ra
735 ; RV32I-NEXT: addi sp, sp, 16
736 ; RV32I-NEXT: .cfi_def_cfa_offset 0
739 ; RV32I-ILP32E-LABEL: caller_no_realign256:
740 ; RV32I-ILP32E: # %bb.0:
741 ; RV32I-ILP32E-NEXT: addi sp, sp, -8
742 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 8
743 ; RV32I-ILP32E-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
744 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
745 ; RV32I-ILP32E-NEXT: mv a0, sp
746 ; RV32I-ILP32E-NEXT: call callee
747 ; RV32I-ILP32E-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
748 ; RV32I-ILP32E-NEXT: .cfi_restore ra
749 ; RV32I-ILP32E-NEXT: addi sp, sp, 8
750 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 0
751 ; RV32I-ILP32E-NEXT: ret
753 ; RV64I-LABEL: caller_no_realign256:
755 ; RV64I-NEXT: addi sp, sp, -16
756 ; RV64I-NEXT: .cfi_def_cfa_offset 16
757 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
758 ; RV64I-NEXT: .cfi_offset ra, -8
759 ; RV64I-NEXT: mv a0, sp
760 ; RV64I-NEXT: call callee
761 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
762 ; RV64I-NEXT: .cfi_restore ra
763 ; RV64I-NEXT: addi sp, sp, 16
764 ; RV64I-NEXT: .cfi_def_cfa_offset 0
767 ; RV64I-LP64E-LABEL: caller_no_realign256:
768 ; RV64I-LP64E: # %bb.0:
769 ; RV64I-LP64E-NEXT: addi sp, sp, -16
770 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 16
771 ; RV64I-LP64E-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
772 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
773 ; RV64I-LP64E-NEXT: mv a0, sp
774 ; RV64I-LP64E-NEXT: call callee
775 ; RV64I-LP64E-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
776 ; RV64I-LP64E-NEXT: .cfi_restore ra
777 ; RV64I-LP64E-NEXT: addi sp, sp, 16
778 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 0
779 ; RV64I-LP64E-NEXT: ret
780 %1 = alloca i8, align 256
781 call void @callee(ptr %1)
785 define void @caller512() {
786 ; RV32I-LABEL: caller512:
788 ; RV32I-NEXT: addi sp, sp, -1024
789 ; RV32I-NEXT: .cfi_def_cfa_offset 1024
790 ; RV32I-NEXT: sw ra, 1020(sp) # 4-byte Folded Spill
791 ; RV32I-NEXT: sw s0, 1016(sp) # 4-byte Folded Spill
792 ; RV32I-NEXT: .cfi_offset ra, -4
793 ; RV32I-NEXT: .cfi_offset s0, -8
794 ; RV32I-NEXT: addi s0, sp, 1024
795 ; RV32I-NEXT: .cfi_def_cfa s0, 0
796 ; RV32I-NEXT: andi sp, sp, -512
797 ; RV32I-NEXT: addi a0, sp, 512
798 ; RV32I-NEXT: call callee
799 ; RV32I-NEXT: addi sp, s0, -1024
800 ; RV32I-NEXT: .cfi_def_cfa sp, 1024
801 ; RV32I-NEXT: lw ra, 1020(sp) # 4-byte Folded Reload
802 ; RV32I-NEXT: lw s0, 1016(sp) # 4-byte Folded Reload
803 ; RV32I-NEXT: .cfi_restore ra
804 ; RV32I-NEXT: .cfi_restore s0
805 ; RV32I-NEXT: addi sp, sp, 1024
806 ; RV32I-NEXT: .cfi_def_cfa_offset 0
809 ; RV32I-ILP32E-LABEL: caller512:
810 ; RV32I-ILP32E: # %bb.0:
811 ; RV32I-ILP32E-NEXT: addi sp, sp, -1024
812 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 1024
813 ; RV32I-ILP32E-NEXT: sw ra, 1020(sp) # 4-byte Folded Spill
814 ; RV32I-ILP32E-NEXT: sw s0, 1016(sp) # 4-byte Folded Spill
815 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
816 ; RV32I-ILP32E-NEXT: .cfi_offset s0, -8
817 ; RV32I-ILP32E-NEXT: addi s0, sp, 1024
818 ; RV32I-ILP32E-NEXT: .cfi_def_cfa s0, 0
819 ; RV32I-ILP32E-NEXT: andi sp, sp, -512
820 ; RV32I-ILP32E-NEXT: addi a0, sp, 512
821 ; RV32I-ILP32E-NEXT: call callee
822 ; RV32I-ILP32E-NEXT: addi sp, s0, -1024
823 ; RV32I-ILP32E-NEXT: .cfi_def_cfa sp, 1024
824 ; RV32I-ILP32E-NEXT: lw ra, 1020(sp) # 4-byte Folded Reload
825 ; RV32I-ILP32E-NEXT: lw s0, 1016(sp) # 4-byte Folded Reload
826 ; RV32I-ILP32E-NEXT: .cfi_restore ra
827 ; RV32I-ILP32E-NEXT: .cfi_restore s0
828 ; RV32I-ILP32E-NEXT: addi sp, sp, 1024
829 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 0
830 ; RV32I-ILP32E-NEXT: ret
832 ; RV64I-LABEL: caller512:
834 ; RV64I-NEXT: addi sp, sp, -1024
835 ; RV64I-NEXT: .cfi_def_cfa_offset 1024
836 ; RV64I-NEXT: sd ra, 1016(sp) # 8-byte Folded Spill
837 ; RV64I-NEXT: sd s0, 1008(sp) # 8-byte Folded Spill
838 ; RV64I-NEXT: .cfi_offset ra, -8
839 ; RV64I-NEXT: .cfi_offset s0, -16
840 ; RV64I-NEXT: addi s0, sp, 1024
841 ; RV64I-NEXT: .cfi_def_cfa s0, 0
842 ; RV64I-NEXT: andi sp, sp, -512
843 ; RV64I-NEXT: addi a0, sp, 512
844 ; RV64I-NEXT: call callee
845 ; RV64I-NEXT: addi sp, s0, -1024
846 ; RV64I-NEXT: .cfi_def_cfa sp, 1024
847 ; RV64I-NEXT: ld ra, 1016(sp) # 8-byte Folded Reload
848 ; RV64I-NEXT: ld s0, 1008(sp) # 8-byte Folded Reload
849 ; RV64I-NEXT: .cfi_restore ra
850 ; RV64I-NEXT: .cfi_restore s0
851 ; RV64I-NEXT: addi sp, sp, 1024
852 ; RV64I-NEXT: .cfi_def_cfa_offset 0
855 ; RV64I-LP64E-LABEL: caller512:
856 ; RV64I-LP64E: # %bb.0:
857 ; RV64I-LP64E-NEXT: addi sp, sp, -1024
858 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 1024
859 ; RV64I-LP64E-NEXT: sd ra, 1016(sp) # 8-byte Folded Spill
860 ; RV64I-LP64E-NEXT: sd s0, 1008(sp) # 8-byte Folded Spill
861 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
862 ; RV64I-LP64E-NEXT: .cfi_offset s0, -16
863 ; RV64I-LP64E-NEXT: addi s0, sp, 1024
864 ; RV64I-LP64E-NEXT: .cfi_def_cfa s0, 0
865 ; RV64I-LP64E-NEXT: andi sp, sp, -512
866 ; RV64I-LP64E-NEXT: addi a0, sp, 512
867 ; RV64I-LP64E-NEXT: call callee
868 ; RV64I-LP64E-NEXT: addi sp, s0, -1024
869 ; RV64I-LP64E-NEXT: .cfi_def_cfa sp, 1024
870 ; RV64I-LP64E-NEXT: ld ra, 1016(sp) # 8-byte Folded Reload
871 ; RV64I-LP64E-NEXT: ld s0, 1008(sp) # 8-byte Folded Reload
872 ; RV64I-LP64E-NEXT: .cfi_restore ra
873 ; RV64I-LP64E-NEXT: .cfi_restore s0
874 ; RV64I-LP64E-NEXT: addi sp, sp, 1024
875 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 0
876 ; RV64I-LP64E-NEXT: ret
877 %1 = alloca i8, align 512
878 call void @callee(ptr %1)
882 define void @caller_no_realign512() "no-realign-stack" {
883 ; RV32I-LABEL: caller_no_realign512:
885 ; RV32I-NEXT: addi sp, sp, -16
886 ; RV32I-NEXT: .cfi_def_cfa_offset 16
887 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
888 ; RV32I-NEXT: .cfi_offset ra, -4
889 ; RV32I-NEXT: mv a0, sp
890 ; RV32I-NEXT: call callee
891 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
892 ; RV32I-NEXT: .cfi_restore ra
893 ; RV32I-NEXT: addi sp, sp, 16
894 ; RV32I-NEXT: .cfi_def_cfa_offset 0
897 ; RV32I-ILP32E-LABEL: caller_no_realign512:
898 ; RV32I-ILP32E: # %bb.0:
899 ; RV32I-ILP32E-NEXT: addi sp, sp, -8
900 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 8
901 ; RV32I-ILP32E-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
902 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
903 ; RV32I-ILP32E-NEXT: mv a0, sp
904 ; RV32I-ILP32E-NEXT: call callee
905 ; RV32I-ILP32E-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
906 ; RV32I-ILP32E-NEXT: .cfi_restore ra
907 ; RV32I-ILP32E-NEXT: addi sp, sp, 8
908 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 0
909 ; RV32I-ILP32E-NEXT: ret
911 ; RV64I-LABEL: caller_no_realign512:
913 ; RV64I-NEXT: addi sp, sp, -16
914 ; RV64I-NEXT: .cfi_def_cfa_offset 16
915 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
916 ; RV64I-NEXT: .cfi_offset ra, -8
917 ; RV64I-NEXT: mv a0, sp
918 ; RV64I-NEXT: call callee
919 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
920 ; RV64I-NEXT: .cfi_restore ra
921 ; RV64I-NEXT: addi sp, sp, 16
922 ; RV64I-NEXT: .cfi_def_cfa_offset 0
925 ; RV64I-LP64E-LABEL: caller_no_realign512:
926 ; RV64I-LP64E: # %bb.0:
927 ; RV64I-LP64E-NEXT: addi sp, sp, -16
928 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 16
929 ; RV64I-LP64E-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
930 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
931 ; RV64I-LP64E-NEXT: mv a0, sp
932 ; RV64I-LP64E-NEXT: call callee
933 ; RV64I-LP64E-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
934 ; RV64I-LP64E-NEXT: .cfi_restore ra
935 ; RV64I-LP64E-NEXT: addi sp, sp, 16
936 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 0
937 ; RV64I-LP64E-NEXT: ret
938 %1 = alloca i8, align 512
939 call void @callee(ptr %1)
943 define void @caller1024() {
944 ; RV32I-LABEL: caller1024:
946 ; RV32I-NEXT: addi sp, sp, -2032
947 ; RV32I-NEXT: .cfi_def_cfa_offset 2032
948 ; RV32I-NEXT: sw ra, 2028(sp) # 4-byte Folded Spill
949 ; RV32I-NEXT: sw s0, 2024(sp) # 4-byte Folded Spill
950 ; RV32I-NEXT: .cfi_offset ra, -4
951 ; RV32I-NEXT: .cfi_offset s0, -8
952 ; RV32I-NEXT: addi s0, sp, 2032
953 ; RV32I-NEXT: .cfi_def_cfa s0, 0
954 ; RV32I-NEXT: addi sp, sp, -16
955 ; RV32I-NEXT: andi sp, sp, -1024
956 ; RV32I-NEXT: addi a0, sp, 1024
957 ; RV32I-NEXT: call callee
958 ; RV32I-NEXT: addi sp, s0, -2032
959 ; RV32I-NEXT: .cfi_def_cfa sp, 2032
960 ; RV32I-NEXT: lw ra, 2028(sp) # 4-byte Folded Reload
961 ; RV32I-NEXT: lw s0, 2024(sp) # 4-byte Folded Reload
962 ; RV32I-NEXT: .cfi_restore ra
963 ; RV32I-NEXT: .cfi_restore s0
964 ; RV32I-NEXT: addi sp, sp, 2032
965 ; RV32I-NEXT: .cfi_def_cfa_offset 0
968 ; RV32I-ILP32E-LABEL: caller1024:
969 ; RV32I-ILP32E: # %bb.0:
970 ; RV32I-ILP32E-NEXT: addi sp, sp, -2044
971 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 2044
972 ; RV32I-ILP32E-NEXT: sw ra, 2040(sp) # 4-byte Folded Spill
973 ; RV32I-ILP32E-NEXT: sw s0, 2036(sp) # 4-byte Folded Spill
974 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
975 ; RV32I-ILP32E-NEXT: .cfi_offset s0, -8
976 ; RV32I-ILP32E-NEXT: addi s0, sp, 2044
977 ; RV32I-ILP32E-NEXT: .cfi_def_cfa s0, 0
978 ; RV32I-ILP32E-NEXT: addi sp, sp, -4
979 ; RV32I-ILP32E-NEXT: andi sp, sp, -1024
980 ; RV32I-ILP32E-NEXT: addi a0, sp, 1024
981 ; RV32I-ILP32E-NEXT: call callee
982 ; RV32I-ILP32E-NEXT: addi sp, s0, -2044
983 ; RV32I-ILP32E-NEXT: .cfi_def_cfa sp, 2044
984 ; RV32I-ILP32E-NEXT: lw ra, 2040(sp) # 4-byte Folded Reload
985 ; RV32I-ILP32E-NEXT: lw s0, 2036(sp) # 4-byte Folded Reload
986 ; RV32I-ILP32E-NEXT: .cfi_restore ra
987 ; RV32I-ILP32E-NEXT: .cfi_restore s0
988 ; RV32I-ILP32E-NEXT: addi sp, sp, 2044
989 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 0
990 ; RV32I-ILP32E-NEXT: ret
992 ; RV64I-LABEL: caller1024:
994 ; RV64I-NEXT: addi sp, sp, -2032
995 ; RV64I-NEXT: .cfi_def_cfa_offset 2032
996 ; RV64I-NEXT: sd ra, 2024(sp) # 8-byte Folded Spill
997 ; RV64I-NEXT: sd s0, 2016(sp) # 8-byte Folded Spill
998 ; RV64I-NEXT: .cfi_offset ra, -8
999 ; RV64I-NEXT: .cfi_offset s0, -16
1000 ; RV64I-NEXT: addi s0, sp, 2032
1001 ; RV64I-NEXT: .cfi_def_cfa s0, 0
1002 ; RV64I-NEXT: addi sp, sp, -16
1003 ; RV64I-NEXT: andi sp, sp, -1024
1004 ; RV64I-NEXT: addi a0, sp, 1024
1005 ; RV64I-NEXT: call callee
1006 ; RV64I-NEXT: addi sp, s0, -2032
1007 ; RV64I-NEXT: .cfi_def_cfa sp, 2032
1008 ; RV64I-NEXT: ld ra, 2024(sp) # 8-byte Folded Reload
1009 ; RV64I-NEXT: ld s0, 2016(sp) # 8-byte Folded Reload
1010 ; RV64I-NEXT: .cfi_restore ra
1011 ; RV64I-NEXT: .cfi_restore s0
1012 ; RV64I-NEXT: addi sp, sp, 2032
1013 ; RV64I-NEXT: .cfi_def_cfa_offset 0
1016 ; RV64I-LP64E-LABEL: caller1024:
1017 ; RV64I-LP64E: # %bb.0:
1018 ; RV64I-LP64E-NEXT: addi sp, sp, -2040
1019 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 2040
1020 ; RV64I-LP64E-NEXT: sd ra, 2032(sp) # 8-byte Folded Spill
1021 ; RV64I-LP64E-NEXT: sd s0, 2024(sp) # 8-byte Folded Spill
1022 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
1023 ; RV64I-LP64E-NEXT: .cfi_offset s0, -16
1024 ; RV64I-LP64E-NEXT: addi s0, sp, 2040
1025 ; RV64I-LP64E-NEXT: .cfi_def_cfa s0, 0
1026 ; RV64I-LP64E-NEXT: addi sp, sp, -8
1027 ; RV64I-LP64E-NEXT: andi sp, sp, -1024
1028 ; RV64I-LP64E-NEXT: addi a0, sp, 1024
1029 ; RV64I-LP64E-NEXT: call callee
1030 ; RV64I-LP64E-NEXT: addi sp, s0, -2040
1031 ; RV64I-LP64E-NEXT: .cfi_def_cfa sp, 2040
1032 ; RV64I-LP64E-NEXT: ld ra, 2032(sp) # 8-byte Folded Reload
1033 ; RV64I-LP64E-NEXT: ld s0, 2024(sp) # 8-byte Folded Reload
1034 ; RV64I-LP64E-NEXT: .cfi_restore ra
1035 ; RV64I-LP64E-NEXT: .cfi_restore s0
1036 ; RV64I-LP64E-NEXT: addi sp, sp, 2040
1037 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 0
1038 ; RV64I-LP64E-NEXT: ret
1039 %1 = alloca i8, align 1024
1040 call void @callee(ptr %1)
1044 define void @caller_no_realign1024() "no-realign-stack" {
1045 ; RV32I-LABEL: caller_no_realign1024:
1047 ; RV32I-NEXT: addi sp, sp, -16
1048 ; RV32I-NEXT: .cfi_def_cfa_offset 16
1049 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1050 ; RV32I-NEXT: .cfi_offset ra, -4
1051 ; RV32I-NEXT: mv a0, sp
1052 ; RV32I-NEXT: call callee
1053 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1054 ; RV32I-NEXT: .cfi_restore ra
1055 ; RV32I-NEXT: addi sp, sp, 16
1056 ; RV32I-NEXT: .cfi_def_cfa_offset 0
1059 ; RV32I-ILP32E-LABEL: caller_no_realign1024:
1060 ; RV32I-ILP32E: # %bb.0:
1061 ; RV32I-ILP32E-NEXT: addi sp, sp, -8
1062 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 8
1063 ; RV32I-ILP32E-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
1064 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
1065 ; RV32I-ILP32E-NEXT: mv a0, sp
1066 ; RV32I-ILP32E-NEXT: call callee
1067 ; RV32I-ILP32E-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
1068 ; RV32I-ILP32E-NEXT: .cfi_restore ra
1069 ; RV32I-ILP32E-NEXT: addi sp, sp, 8
1070 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 0
1071 ; RV32I-ILP32E-NEXT: ret
1073 ; RV64I-LABEL: caller_no_realign1024:
1075 ; RV64I-NEXT: addi sp, sp, -16
1076 ; RV64I-NEXT: .cfi_def_cfa_offset 16
1077 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1078 ; RV64I-NEXT: .cfi_offset ra, -8
1079 ; RV64I-NEXT: mv a0, sp
1080 ; RV64I-NEXT: call callee
1081 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1082 ; RV64I-NEXT: .cfi_restore ra
1083 ; RV64I-NEXT: addi sp, sp, 16
1084 ; RV64I-NEXT: .cfi_def_cfa_offset 0
1087 ; RV64I-LP64E-LABEL: caller_no_realign1024:
1088 ; RV64I-LP64E: # %bb.0:
1089 ; RV64I-LP64E-NEXT: addi sp, sp, -16
1090 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 16
1091 ; RV64I-LP64E-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1092 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
1093 ; RV64I-LP64E-NEXT: mv a0, sp
1094 ; RV64I-LP64E-NEXT: call callee
1095 ; RV64I-LP64E-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1096 ; RV64I-LP64E-NEXT: .cfi_restore ra
1097 ; RV64I-LP64E-NEXT: addi sp, sp, 16
1098 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 0
1099 ; RV64I-LP64E-NEXT: ret
1100 %1 = alloca i8, align 1024
1101 call void @callee(ptr %1)
1105 define void @caller2048() {
1106 ; RV32I-LABEL: caller2048:
1108 ; RV32I-NEXT: addi sp, sp, -2032
1109 ; RV32I-NEXT: .cfi_def_cfa_offset 2032
1110 ; RV32I-NEXT: sw ra, 2028(sp) # 4-byte Folded Spill
1111 ; RV32I-NEXT: sw s0, 2024(sp) # 4-byte Folded Spill
1112 ; RV32I-NEXT: .cfi_offset ra, -4
1113 ; RV32I-NEXT: .cfi_offset s0, -8
1114 ; RV32I-NEXT: addi s0, sp, 2032
1115 ; RV32I-NEXT: .cfi_def_cfa s0, 0
1116 ; RV32I-NEXT: addi sp, sp, -2048
1117 ; RV32I-NEXT: addi sp, sp, -16
1118 ; RV32I-NEXT: andi sp, sp, -2048
1119 ; RV32I-NEXT: addi a0, sp, 2047
1120 ; RV32I-NEXT: addi a0, a0, 1
1121 ; RV32I-NEXT: call callee
1122 ; RV32I-NEXT: addi sp, s0, -2032
1123 ; RV32I-NEXT: .cfi_def_cfa sp, 2032
1124 ; RV32I-NEXT: lw ra, 2028(sp) # 4-byte Folded Reload
1125 ; RV32I-NEXT: lw s0, 2024(sp) # 4-byte Folded Reload
1126 ; RV32I-NEXT: .cfi_restore ra
1127 ; RV32I-NEXT: .cfi_restore s0
1128 ; RV32I-NEXT: addi sp, sp, 2032
1129 ; RV32I-NEXT: .cfi_def_cfa_offset 0
1132 ; RV32I-ILP32E-LABEL: caller2048:
1133 ; RV32I-ILP32E: # %bb.0:
1134 ; RV32I-ILP32E-NEXT: addi sp, sp, -2044
1135 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 2044
1136 ; RV32I-ILP32E-NEXT: sw ra, 2040(sp) # 4-byte Folded Spill
1137 ; RV32I-ILP32E-NEXT: sw s0, 2036(sp) # 4-byte Folded Spill
1138 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
1139 ; RV32I-ILP32E-NEXT: .cfi_offset s0, -8
1140 ; RV32I-ILP32E-NEXT: addi s0, sp, 2044
1141 ; RV32I-ILP32E-NEXT: .cfi_def_cfa s0, 0
1142 ; RV32I-ILP32E-NEXT: addi sp, sp, -2048
1143 ; RV32I-ILP32E-NEXT: addi sp, sp, -4
1144 ; RV32I-ILP32E-NEXT: andi sp, sp, -2048
1145 ; RV32I-ILP32E-NEXT: addi a0, sp, 2047
1146 ; RV32I-ILP32E-NEXT: addi a0, a0, 1
1147 ; RV32I-ILP32E-NEXT: call callee
1148 ; RV32I-ILP32E-NEXT: addi sp, s0, -2044
1149 ; RV32I-ILP32E-NEXT: .cfi_def_cfa sp, 2044
1150 ; RV32I-ILP32E-NEXT: lw ra, 2040(sp) # 4-byte Folded Reload
1151 ; RV32I-ILP32E-NEXT: lw s0, 2036(sp) # 4-byte Folded Reload
1152 ; RV32I-ILP32E-NEXT: .cfi_restore ra
1153 ; RV32I-ILP32E-NEXT: .cfi_restore s0
1154 ; RV32I-ILP32E-NEXT: addi sp, sp, 2044
1155 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 0
1156 ; RV32I-ILP32E-NEXT: ret
1158 ; RV64I-LABEL: caller2048:
1160 ; RV64I-NEXT: addi sp, sp, -2032
1161 ; RV64I-NEXT: .cfi_def_cfa_offset 2032
1162 ; RV64I-NEXT: sd ra, 2024(sp) # 8-byte Folded Spill
1163 ; RV64I-NEXT: sd s0, 2016(sp) # 8-byte Folded Spill
1164 ; RV64I-NEXT: .cfi_offset ra, -8
1165 ; RV64I-NEXT: .cfi_offset s0, -16
1166 ; RV64I-NEXT: addi s0, sp, 2032
1167 ; RV64I-NEXT: .cfi_def_cfa s0, 0
1168 ; RV64I-NEXT: addi sp, sp, -2048
1169 ; RV64I-NEXT: addi sp, sp, -16
1170 ; RV64I-NEXT: andi sp, sp, -2048
1171 ; RV64I-NEXT: addi a0, sp, 2047
1172 ; RV64I-NEXT: addi a0, a0, 1
1173 ; RV64I-NEXT: call callee
1174 ; RV64I-NEXT: addi sp, s0, -2032
1175 ; RV64I-NEXT: .cfi_def_cfa sp, 2032
1176 ; RV64I-NEXT: ld ra, 2024(sp) # 8-byte Folded Reload
1177 ; RV64I-NEXT: ld s0, 2016(sp) # 8-byte Folded Reload
1178 ; RV64I-NEXT: .cfi_restore ra
1179 ; RV64I-NEXT: .cfi_restore s0
1180 ; RV64I-NEXT: addi sp, sp, 2032
1181 ; RV64I-NEXT: .cfi_def_cfa_offset 0
1184 ; RV64I-LP64E-LABEL: caller2048:
1185 ; RV64I-LP64E: # %bb.0:
1186 ; RV64I-LP64E-NEXT: addi sp, sp, -2040
1187 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 2040
1188 ; RV64I-LP64E-NEXT: sd ra, 2032(sp) # 8-byte Folded Spill
1189 ; RV64I-LP64E-NEXT: sd s0, 2024(sp) # 8-byte Folded Spill
1190 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
1191 ; RV64I-LP64E-NEXT: .cfi_offset s0, -16
1192 ; RV64I-LP64E-NEXT: addi s0, sp, 2040
1193 ; RV64I-LP64E-NEXT: .cfi_def_cfa s0, 0
1194 ; RV64I-LP64E-NEXT: addi sp, sp, -2048
1195 ; RV64I-LP64E-NEXT: addi sp, sp, -8
1196 ; RV64I-LP64E-NEXT: andi sp, sp, -2048
1197 ; RV64I-LP64E-NEXT: addi a0, sp, 2047
1198 ; RV64I-LP64E-NEXT: addi a0, a0, 1
1199 ; RV64I-LP64E-NEXT: call callee
1200 ; RV64I-LP64E-NEXT: addi sp, s0, -2040
1201 ; RV64I-LP64E-NEXT: .cfi_def_cfa sp, 2040
1202 ; RV64I-LP64E-NEXT: ld ra, 2032(sp) # 8-byte Folded Reload
1203 ; RV64I-LP64E-NEXT: ld s0, 2024(sp) # 8-byte Folded Reload
1204 ; RV64I-LP64E-NEXT: .cfi_restore ra
1205 ; RV64I-LP64E-NEXT: .cfi_restore s0
1206 ; RV64I-LP64E-NEXT: addi sp, sp, 2040
1207 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 0
1208 ; RV64I-LP64E-NEXT: ret
1209 %1 = alloca i8, align 2048
1210 call void @callee(ptr %1)
1214 define void @caller_no_realign2048() "no-realign-stack" {
1215 ; RV32I-LABEL: caller_no_realign2048:
1217 ; RV32I-NEXT: addi sp, sp, -16
1218 ; RV32I-NEXT: .cfi_def_cfa_offset 16
1219 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1220 ; RV32I-NEXT: .cfi_offset ra, -4
1221 ; RV32I-NEXT: mv a0, sp
1222 ; RV32I-NEXT: call callee
1223 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1224 ; RV32I-NEXT: .cfi_restore ra
1225 ; RV32I-NEXT: addi sp, sp, 16
1226 ; RV32I-NEXT: .cfi_def_cfa_offset 0
1229 ; RV32I-ILP32E-LABEL: caller_no_realign2048:
1230 ; RV32I-ILP32E: # %bb.0:
1231 ; RV32I-ILP32E-NEXT: addi sp, sp, -8
1232 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 8
1233 ; RV32I-ILP32E-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
1234 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
1235 ; RV32I-ILP32E-NEXT: mv a0, sp
1236 ; RV32I-ILP32E-NEXT: call callee
1237 ; RV32I-ILP32E-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
1238 ; RV32I-ILP32E-NEXT: .cfi_restore ra
1239 ; RV32I-ILP32E-NEXT: addi sp, sp, 8
1240 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 0
1241 ; RV32I-ILP32E-NEXT: ret
1243 ; RV64I-LABEL: caller_no_realign2048:
1245 ; RV64I-NEXT: addi sp, sp, -16
1246 ; RV64I-NEXT: .cfi_def_cfa_offset 16
1247 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1248 ; RV64I-NEXT: .cfi_offset ra, -8
1249 ; RV64I-NEXT: mv a0, sp
1250 ; RV64I-NEXT: call callee
1251 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1252 ; RV64I-NEXT: .cfi_restore ra
1253 ; RV64I-NEXT: addi sp, sp, 16
1254 ; RV64I-NEXT: .cfi_def_cfa_offset 0
1257 ; RV64I-LP64E-LABEL: caller_no_realign2048:
1258 ; RV64I-LP64E: # %bb.0:
1259 ; RV64I-LP64E-NEXT: addi sp, sp, -16
1260 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 16
1261 ; RV64I-LP64E-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1262 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
1263 ; RV64I-LP64E-NEXT: mv a0, sp
1264 ; RV64I-LP64E-NEXT: call callee
1265 ; RV64I-LP64E-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1266 ; RV64I-LP64E-NEXT: .cfi_restore ra
1267 ; RV64I-LP64E-NEXT: addi sp, sp, 16
1268 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 0
1269 ; RV64I-LP64E-NEXT: ret
1270 %1 = alloca i8, align 2048
1271 call void @callee(ptr %1)
1275 define void @caller4096() {
1276 ; RV32I-LABEL: caller4096:
1278 ; RV32I-NEXT: addi sp, sp, -2032
1279 ; RV32I-NEXT: .cfi_def_cfa_offset 2032
1280 ; RV32I-NEXT: sw ra, 2028(sp) # 4-byte Folded Spill
1281 ; RV32I-NEXT: sw s0, 2024(sp) # 4-byte Folded Spill
1282 ; RV32I-NEXT: .cfi_offset ra, -4
1283 ; RV32I-NEXT: .cfi_offset s0, -8
1284 ; RV32I-NEXT: addi s0, sp, 2032
1285 ; RV32I-NEXT: .cfi_def_cfa s0, 0
1286 ; RV32I-NEXT: lui a0, 2
1287 ; RV32I-NEXT: addi a0, a0, -2032
1288 ; RV32I-NEXT: sub sp, sp, a0
1289 ; RV32I-NEXT: srli a0, sp, 12
1290 ; RV32I-NEXT: slli sp, a0, 12
1291 ; RV32I-NEXT: lui a0, 1
1292 ; RV32I-NEXT: add a0, sp, a0
1293 ; RV32I-NEXT: call callee
1294 ; RV32I-NEXT: addi sp, s0, -2032
1295 ; RV32I-NEXT: .cfi_def_cfa sp, 2032
1296 ; RV32I-NEXT: lw ra, 2028(sp) # 4-byte Folded Reload
1297 ; RV32I-NEXT: lw s0, 2024(sp) # 4-byte Folded Reload
1298 ; RV32I-NEXT: .cfi_restore ra
1299 ; RV32I-NEXT: .cfi_restore s0
1300 ; RV32I-NEXT: addi sp, sp, 2032
1301 ; RV32I-NEXT: .cfi_def_cfa_offset 0
1304 ; RV32I-ILP32E-LABEL: caller4096:
1305 ; RV32I-ILP32E: # %bb.0:
1306 ; RV32I-ILP32E-NEXT: addi sp, sp, -2044
1307 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 2044
1308 ; RV32I-ILP32E-NEXT: sw ra, 2040(sp) # 4-byte Folded Spill
1309 ; RV32I-ILP32E-NEXT: sw s0, 2036(sp) # 4-byte Folded Spill
1310 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
1311 ; RV32I-ILP32E-NEXT: .cfi_offset s0, -8
1312 ; RV32I-ILP32E-NEXT: addi s0, sp, 2044
1313 ; RV32I-ILP32E-NEXT: .cfi_def_cfa s0, 0
1314 ; RV32I-ILP32E-NEXT: lui a0, 2
1315 ; RV32I-ILP32E-NEXT: addi a0, a0, -2044
1316 ; RV32I-ILP32E-NEXT: sub sp, sp, a0
1317 ; RV32I-ILP32E-NEXT: srli a0, sp, 12
1318 ; RV32I-ILP32E-NEXT: slli sp, a0, 12
1319 ; RV32I-ILP32E-NEXT: lui a0, 1
1320 ; RV32I-ILP32E-NEXT: add a0, sp, a0
1321 ; RV32I-ILP32E-NEXT: call callee
1322 ; RV32I-ILP32E-NEXT: addi sp, s0, -2044
1323 ; RV32I-ILP32E-NEXT: .cfi_def_cfa sp, 2044
1324 ; RV32I-ILP32E-NEXT: lw ra, 2040(sp) # 4-byte Folded Reload
1325 ; RV32I-ILP32E-NEXT: lw s0, 2036(sp) # 4-byte Folded Reload
1326 ; RV32I-ILP32E-NEXT: .cfi_restore ra
1327 ; RV32I-ILP32E-NEXT: .cfi_restore s0
1328 ; RV32I-ILP32E-NEXT: addi sp, sp, 2044
1329 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 0
1330 ; RV32I-ILP32E-NEXT: ret
1332 ; RV64I-LABEL: caller4096:
1334 ; RV64I-NEXT: addi sp, sp, -2032
1335 ; RV64I-NEXT: .cfi_def_cfa_offset 2032
1336 ; RV64I-NEXT: sd ra, 2024(sp) # 8-byte Folded Spill
1337 ; RV64I-NEXT: sd s0, 2016(sp) # 8-byte Folded Spill
1338 ; RV64I-NEXT: .cfi_offset ra, -8
1339 ; RV64I-NEXT: .cfi_offset s0, -16
1340 ; RV64I-NEXT: addi s0, sp, 2032
1341 ; RV64I-NEXT: .cfi_def_cfa s0, 0
1342 ; RV64I-NEXT: lui a0, 2
1343 ; RV64I-NEXT: addiw a0, a0, -2032
1344 ; RV64I-NEXT: sub sp, sp, a0
1345 ; RV64I-NEXT: srli a0, sp, 12
1346 ; RV64I-NEXT: slli sp, a0, 12
1347 ; RV64I-NEXT: lui a0, 1
1348 ; RV64I-NEXT: add a0, sp, a0
1349 ; RV64I-NEXT: call callee
1350 ; RV64I-NEXT: addi sp, s0, -2032
1351 ; RV64I-NEXT: .cfi_def_cfa sp, 2032
1352 ; RV64I-NEXT: ld ra, 2024(sp) # 8-byte Folded Reload
1353 ; RV64I-NEXT: ld s0, 2016(sp) # 8-byte Folded Reload
1354 ; RV64I-NEXT: .cfi_restore ra
1355 ; RV64I-NEXT: .cfi_restore s0
1356 ; RV64I-NEXT: addi sp, sp, 2032
1357 ; RV64I-NEXT: .cfi_def_cfa_offset 0
1360 ; RV64I-LP64E-LABEL: caller4096:
1361 ; RV64I-LP64E: # %bb.0:
1362 ; RV64I-LP64E-NEXT: addi sp, sp, -2040
1363 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 2040
1364 ; RV64I-LP64E-NEXT: sd ra, 2032(sp) # 8-byte Folded Spill
1365 ; RV64I-LP64E-NEXT: sd s0, 2024(sp) # 8-byte Folded Spill
1366 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
1367 ; RV64I-LP64E-NEXT: .cfi_offset s0, -16
1368 ; RV64I-LP64E-NEXT: addi s0, sp, 2040
1369 ; RV64I-LP64E-NEXT: .cfi_def_cfa s0, 0
1370 ; RV64I-LP64E-NEXT: lui a0, 2
1371 ; RV64I-LP64E-NEXT: addiw a0, a0, -2040
1372 ; RV64I-LP64E-NEXT: sub sp, sp, a0
1373 ; RV64I-LP64E-NEXT: srli a0, sp, 12
1374 ; RV64I-LP64E-NEXT: slli sp, a0, 12
1375 ; RV64I-LP64E-NEXT: lui a0, 1
1376 ; RV64I-LP64E-NEXT: add a0, sp, a0
1377 ; RV64I-LP64E-NEXT: call callee
1378 ; RV64I-LP64E-NEXT: addi sp, s0, -2040
1379 ; RV64I-LP64E-NEXT: .cfi_def_cfa sp, 2040
1380 ; RV64I-LP64E-NEXT: ld ra, 2032(sp) # 8-byte Folded Reload
1381 ; RV64I-LP64E-NEXT: ld s0, 2024(sp) # 8-byte Folded Reload
1382 ; RV64I-LP64E-NEXT: .cfi_restore ra
1383 ; RV64I-LP64E-NEXT: .cfi_restore s0
1384 ; RV64I-LP64E-NEXT: addi sp, sp, 2040
1385 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 0
1386 ; RV64I-LP64E-NEXT: ret
1387 %1 = alloca i8, align 4096
1388 call void @callee(ptr %1)
1392 define void @caller_no_realign4096() "no-realign-stack" {
1393 ; RV32I-LABEL: caller_no_realign4096:
1395 ; RV32I-NEXT: addi sp, sp, -16
1396 ; RV32I-NEXT: .cfi_def_cfa_offset 16
1397 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1398 ; RV32I-NEXT: .cfi_offset ra, -4
1399 ; RV32I-NEXT: mv a0, sp
1400 ; RV32I-NEXT: call callee
1401 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1402 ; RV32I-NEXT: .cfi_restore ra
1403 ; RV32I-NEXT: addi sp, sp, 16
1404 ; RV32I-NEXT: .cfi_def_cfa_offset 0
1407 ; RV32I-ILP32E-LABEL: caller_no_realign4096:
1408 ; RV32I-ILP32E: # %bb.0:
1409 ; RV32I-ILP32E-NEXT: addi sp, sp, -8
1410 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 8
1411 ; RV32I-ILP32E-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
1412 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
1413 ; RV32I-ILP32E-NEXT: mv a0, sp
1414 ; RV32I-ILP32E-NEXT: call callee
1415 ; RV32I-ILP32E-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
1416 ; RV32I-ILP32E-NEXT: .cfi_restore ra
1417 ; RV32I-ILP32E-NEXT: addi sp, sp, 8
1418 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 0
1419 ; RV32I-ILP32E-NEXT: ret
1421 ; RV64I-LABEL: caller_no_realign4096:
1423 ; RV64I-NEXT: addi sp, sp, -16
1424 ; RV64I-NEXT: .cfi_def_cfa_offset 16
1425 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1426 ; RV64I-NEXT: .cfi_offset ra, -8
1427 ; RV64I-NEXT: mv a0, sp
1428 ; RV64I-NEXT: call callee
1429 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1430 ; RV64I-NEXT: .cfi_restore ra
1431 ; RV64I-NEXT: addi sp, sp, 16
1432 ; RV64I-NEXT: .cfi_def_cfa_offset 0
1435 ; RV64I-LP64E-LABEL: caller_no_realign4096:
1436 ; RV64I-LP64E: # %bb.0:
1437 ; RV64I-LP64E-NEXT: addi sp, sp, -16
1438 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 16
1439 ; RV64I-LP64E-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1440 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
1441 ; RV64I-LP64E-NEXT: mv a0, sp
1442 ; RV64I-LP64E-NEXT: call callee
1443 ; RV64I-LP64E-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1444 ; RV64I-LP64E-NEXT: .cfi_restore ra
1445 ; RV64I-LP64E-NEXT: addi sp, sp, 16
1446 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 0
1447 ; RV64I-LP64E-NEXT: ret
1448 %1 = alloca i8, align 4096
1449 call void @callee(ptr %1)