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: addi sp, sp, 16
26 ; RV32I-ILP32E-LABEL: caller16:
27 ; RV32I-ILP32E: # %bb.0:
28 ; RV32I-ILP32E-NEXT: addi sp, sp, -16
29 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 16
30 ; RV32I-ILP32E-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
31 ; RV32I-ILP32E-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
32 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
33 ; RV32I-ILP32E-NEXT: .cfi_offset s0, -8
34 ; RV32I-ILP32E-NEXT: addi s0, sp, 16
35 ; RV32I-ILP32E-NEXT: .cfi_def_cfa s0, 0
36 ; RV32I-ILP32E-NEXT: andi sp, sp, -16
37 ; RV32I-ILP32E-NEXT: mv a0, sp
38 ; RV32I-ILP32E-NEXT: call callee
39 ; RV32I-ILP32E-NEXT: addi sp, s0, -16
40 ; RV32I-ILP32E-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
41 ; RV32I-ILP32E-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
42 ; RV32I-ILP32E-NEXT: addi sp, sp, 16
43 ; RV32I-ILP32E-NEXT: ret
45 ; RV64I-LABEL: caller16:
47 ; RV64I-NEXT: addi sp, sp, -16
48 ; RV64I-NEXT: .cfi_def_cfa_offset 16
49 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
50 ; RV64I-NEXT: .cfi_offset ra, -8
51 ; RV64I-NEXT: mv a0, sp
52 ; RV64I-NEXT: call callee
53 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
54 ; RV64I-NEXT: addi sp, sp, 16
57 ; RV64I-LP64E-LABEL: caller16:
58 ; RV64I-LP64E: # %bb.0:
59 ; RV64I-LP64E-NEXT: addi sp, sp, -32
60 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 32
61 ; RV64I-LP64E-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
62 ; RV64I-LP64E-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
63 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
64 ; RV64I-LP64E-NEXT: .cfi_offset s0, -16
65 ; RV64I-LP64E-NEXT: addi s0, sp, 32
66 ; RV64I-LP64E-NEXT: .cfi_def_cfa s0, 0
67 ; RV64I-LP64E-NEXT: andi sp, sp, -16
68 ; RV64I-LP64E-NEXT: mv a0, sp
69 ; RV64I-LP64E-NEXT: call callee
70 ; RV64I-LP64E-NEXT: addi sp, s0, -32
71 ; RV64I-LP64E-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
72 ; RV64I-LP64E-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
73 ; RV64I-LP64E-NEXT: addi sp, sp, 32
74 ; RV64I-LP64E-NEXT: ret
75 %1 = alloca i8, align 16
76 call void @callee(i8* %1)
80 define void @caller_no_realign16() "no-realign-stack" {
81 ; RV32I-LABEL: caller_no_realign16:
83 ; RV32I-NEXT: addi sp, sp, -16
84 ; RV32I-NEXT: .cfi_def_cfa_offset 16
85 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
86 ; RV32I-NEXT: .cfi_offset ra, -4
87 ; RV32I-NEXT: mv a0, sp
88 ; RV32I-NEXT: call callee
89 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
90 ; RV32I-NEXT: addi sp, sp, 16
93 ; RV32I-ILP32E-LABEL: caller_no_realign16:
94 ; RV32I-ILP32E: # %bb.0:
95 ; RV32I-ILP32E-NEXT: addi sp, sp, -8
96 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 8
97 ; RV32I-ILP32E-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
98 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
99 ; RV32I-ILP32E-NEXT: mv a0, sp
100 ; RV32I-ILP32E-NEXT: call callee
101 ; RV32I-ILP32E-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
102 ; RV32I-ILP32E-NEXT: addi sp, sp, 8
103 ; RV32I-ILP32E-NEXT: ret
105 ; RV64I-LABEL: caller_no_realign16:
107 ; RV64I-NEXT: addi sp, sp, -16
108 ; RV64I-NEXT: .cfi_def_cfa_offset 16
109 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
110 ; RV64I-NEXT: .cfi_offset ra, -8
111 ; RV64I-NEXT: mv a0, sp
112 ; RV64I-NEXT: call callee
113 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
114 ; RV64I-NEXT: addi sp, sp, 16
117 ; RV64I-LP64E-LABEL: caller_no_realign16:
118 ; RV64I-LP64E: # %bb.0:
119 ; RV64I-LP64E-NEXT: addi sp, sp, -16
120 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 16
121 ; RV64I-LP64E-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
122 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
123 ; RV64I-LP64E-NEXT: mv a0, sp
124 ; RV64I-LP64E-NEXT: call callee
125 ; RV64I-LP64E-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
126 ; RV64I-LP64E-NEXT: addi sp, sp, 16
127 ; RV64I-LP64E-NEXT: ret
128 %1 = alloca i8, align 16
129 call void @callee(i8* %1)
133 define void @caller32() {
134 ; RV32I-LABEL: caller32:
136 ; RV32I-NEXT: addi sp, sp, -32
137 ; RV32I-NEXT: .cfi_def_cfa_offset 32
138 ; RV32I-NEXT: sw ra, 28(sp) # 4-byte Folded Spill
139 ; RV32I-NEXT: sw s0, 24(sp) # 4-byte Folded Spill
140 ; RV32I-NEXT: .cfi_offset ra, -4
141 ; RV32I-NEXT: .cfi_offset s0, -8
142 ; RV32I-NEXT: addi s0, sp, 32
143 ; RV32I-NEXT: .cfi_def_cfa s0, 0
144 ; RV32I-NEXT: andi sp, sp, -32
145 ; RV32I-NEXT: mv a0, sp
146 ; RV32I-NEXT: call callee
147 ; RV32I-NEXT: addi sp, s0, -32
148 ; RV32I-NEXT: lw ra, 28(sp) # 4-byte Folded Reload
149 ; RV32I-NEXT: lw s0, 24(sp) # 4-byte Folded Reload
150 ; RV32I-NEXT: addi sp, sp, 32
153 ; RV32I-ILP32E-LABEL: caller32:
154 ; RV32I-ILP32E: # %bb.0:
155 ; RV32I-ILP32E-NEXT: addi sp, sp, -32
156 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 32
157 ; RV32I-ILP32E-NEXT: sw ra, 28(sp) # 4-byte Folded Spill
158 ; RV32I-ILP32E-NEXT: sw s0, 24(sp) # 4-byte Folded Spill
159 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
160 ; RV32I-ILP32E-NEXT: .cfi_offset s0, -8
161 ; RV32I-ILP32E-NEXT: addi s0, sp, 32
162 ; RV32I-ILP32E-NEXT: .cfi_def_cfa s0, 0
163 ; RV32I-ILP32E-NEXT: andi sp, sp, -32
164 ; RV32I-ILP32E-NEXT: mv a0, sp
165 ; RV32I-ILP32E-NEXT: call callee
166 ; RV32I-ILP32E-NEXT: addi sp, s0, -32
167 ; RV32I-ILP32E-NEXT: lw ra, 28(sp) # 4-byte Folded Reload
168 ; RV32I-ILP32E-NEXT: lw s0, 24(sp) # 4-byte Folded Reload
169 ; RV32I-ILP32E-NEXT: addi sp, sp, 32
170 ; RV32I-ILP32E-NEXT: ret
172 ; RV64I-LABEL: caller32:
174 ; RV64I-NEXT: addi sp, sp, -32
175 ; RV64I-NEXT: .cfi_def_cfa_offset 32
176 ; RV64I-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
177 ; RV64I-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
178 ; RV64I-NEXT: .cfi_offset ra, -8
179 ; RV64I-NEXT: .cfi_offset s0, -16
180 ; RV64I-NEXT: addi s0, sp, 32
181 ; RV64I-NEXT: .cfi_def_cfa s0, 0
182 ; RV64I-NEXT: andi sp, sp, -32
183 ; RV64I-NEXT: mv a0, sp
184 ; RV64I-NEXT: call callee
185 ; RV64I-NEXT: addi sp, s0, -32
186 ; RV64I-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
187 ; RV64I-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
188 ; RV64I-NEXT: addi sp, sp, 32
191 ; RV64I-LP64E-LABEL: caller32:
192 ; RV64I-LP64E: # %bb.0:
193 ; RV64I-LP64E-NEXT: addi sp, sp, -32
194 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 32
195 ; RV64I-LP64E-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
196 ; RV64I-LP64E-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
197 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
198 ; RV64I-LP64E-NEXT: .cfi_offset s0, -16
199 ; RV64I-LP64E-NEXT: addi s0, sp, 32
200 ; RV64I-LP64E-NEXT: .cfi_def_cfa s0, 0
201 ; RV64I-LP64E-NEXT: andi sp, sp, -32
202 ; RV64I-LP64E-NEXT: mv a0, sp
203 ; RV64I-LP64E-NEXT: call callee
204 ; RV64I-LP64E-NEXT: addi sp, s0, -32
205 ; RV64I-LP64E-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
206 ; RV64I-LP64E-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
207 ; RV64I-LP64E-NEXT: addi sp, sp, 32
208 ; RV64I-LP64E-NEXT: ret
209 %1 = alloca i8, align 32
210 call void @callee(ptr %1)
214 define void @caller_no_realign32() "no-realign-stack" {
215 ; RV32I-LABEL: caller_no_realign32:
217 ; RV32I-NEXT: addi sp, sp, -16
218 ; RV32I-NEXT: .cfi_def_cfa_offset 16
219 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
220 ; RV32I-NEXT: .cfi_offset ra, -4
221 ; RV32I-NEXT: mv a0, sp
222 ; RV32I-NEXT: call callee
223 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
224 ; RV32I-NEXT: addi sp, sp, 16
227 ; RV32I-ILP32E-LABEL: caller_no_realign32:
228 ; RV32I-ILP32E: # %bb.0:
229 ; RV32I-ILP32E-NEXT: addi sp, sp, -8
230 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 8
231 ; RV32I-ILP32E-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
232 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
233 ; RV32I-ILP32E-NEXT: mv a0, sp
234 ; RV32I-ILP32E-NEXT: call callee
235 ; RV32I-ILP32E-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
236 ; RV32I-ILP32E-NEXT: addi sp, sp, 8
237 ; RV32I-ILP32E-NEXT: ret
239 ; RV64I-LABEL: caller_no_realign32:
241 ; RV64I-NEXT: addi sp, sp, -16
242 ; RV64I-NEXT: .cfi_def_cfa_offset 16
243 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
244 ; RV64I-NEXT: .cfi_offset ra, -8
245 ; RV64I-NEXT: mv a0, sp
246 ; RV64I-NEXT: call callee
247 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
248 ; RV64I-NEXT: addi sp, sp, 16
251 ; RV64I-LP64E-LABEL: caller_no_realign32:
252 ; RV64I-LP64E: # %bb.0:
253 ; RV64I-LP64E-NEXT: addi sp, sp, -16
254 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 16
255 ; RV64I-LP64E-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
256 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
257 ; RV64I-LP64E-NEXT: mv a0, sp
258 ; RV64I-LP64E-NEXT: call callee
259 ; RV64I-LP64E-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
260 ; RV64I-LP64E-NEXT: addi sp, sp, 16
261 ; RV64I-LP64E-NEXT: ret
262 %1 = alloca i8, align 32
263 call void @callee(ptr %1)
267 define void @caller64() {
268 ; RV32I-LABEL: caller64:
270 ; RV32I-NEXT: addi sp, sp, -64
271 ; RV32I-NEXT: .cfi_def_cfa_offset 64
272 ; RV32I-NEXT: sw ra, 60(sp) # 4-byte Folded Spill
273 ; RV32I-NEXT: sw s0, 56(sp) # 4-byte Folded Spill
274 ; RV32I-NEXT: .cfi_offset ra, -4
275 ; RV32I-NEXT: .cfi_offset s0, -8
276 ; RV32I-NEXT: addi s0, sp, 64
277 ; RV32I-NEXT: .cfi_def_cfa s0, 0
278 ; RV32I-NEXT: andi sp, sp, -64
279 ; RV32I-NEXT: mv a0, sp
280 ; RV32I-NEXT: call callee
281 ; RV32I-NEXT: addi sp, s0, -64
282 ; RV32I-NEXT: lw ra, 60(sp) # 4-byte Folded Reload
283 ; RV32I-NEXT: lw s0, 56(sp) # 4-byte Folded Reload
284 ; RV32I-NEXT: addi sp, sp, 64
287 ; RV32I-ILP32E-LABEL: caller64:
288 ; RV32I-ILP32E: # %bb.0:
289 ; RV32I-ILP32E-NEXT: addi sp, sp, -64
290 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 64
291 ; RV32I-ILP32E-NEXT: sw ra, 60(sp) # 4-byte Folded Spill
292 ; RV32I-ILP32E-NEXT: sw s0, 56(sp) # 4-byte Folded Spill
293 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
294 ; RV32I-ILP32E-NEXT: .cfi_offset s0, -8
295 ; RV32I-ILP32E-NEXT: addi s0, sp, 64
296 ; RV32I-ILP32E-NEXT: .cfi_def_cfa s0, 0
297 ; RV32I-ILP32E-NEXT: andi sp, sp, -64
298 ; RV32I-ILP32E-NEXT: mv a0, sp
299 ; RV32I-ILP32E-NEXT: call callee
300 ; RV32I-ILP32E-NEXT: addi sp, s0, -64
301 ; RV32I-ILP32E-NEXT: lw ra, 60(sp) # 4-byte Folded Reload
302 ; RV32I-ILP32E-NEXT: lw s0, 56(sp) # 4-byte Folded Reload
303 ; RV32I-ILP32E-NEXT: addi sp, sp, 64
304 ; RV32I-ILP32E-NEXT: ret
306 ; RV64I-LABEL: caller64:
308 ; RV64I-NEXT: addi sp, sp, -64
309 ; RV64I-NEXT: .cfi_def_cfa_offset 64
310 ; RV64I-NEXT: sd ra, 56(sp) # 8-byte Folded Spill
311 ; RV64I-NEXT: sd s0, 48(sp) # 8-byte Folded Spill
312 ; RV64I-NEXT: .cfi_offset ra, -8
313 ; RV64I-NEXT: .cfi_offset s0, -16
314 ; RV64I-NEXT: addi s0, sp, 64
315 ; RV64I-NEXT: .cfi_def_cfa s0, 0
316 ; RV64I-NEXT: andi sp, sp, -64
317 ; RV64I-NEXT: mv a0, sp
318 ; RV64I-NEXT: call callee
319 ; RV64I-NEXT: addi sp, s0, -64
320 ; RV64I-NEXT: ld ra, 56(sp) # 8-byte Folded Reload
321 ; RV64I-NEXT: ld s0, 48(sp) # 8-byte Folded Reload
322 ; RV64I-NEXT: addi sp, sp, 64
325 ; RV64I-LP64E-LABEL: caller64:
326 ; RV64I-LP64E: # %bb.0:
327 ; RV64I-LP64E-NEXT: addi sp, sp, -64
328 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 64
329 ; RV64I-LP64E-NEXT: sd ra, 56(sp) # 8-byte Folded Spill
330 ; RV64I-LP64E-NEXT: sd s0, 48(sp) # 8-byte Folded Spill
331 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
332 ; RV64I-LP64E-NEXT: .cfi_offset s0, -16
333 ; RV64I-LP64E-NEXT: addi s0, sp, 64
334 ; RV64I-LP64E-NEXT: .cfi_def_cfa s0, 0
335 ; RV64I-LP64E-NEXT: andi sp, sp, -64
336 ; RV64I-LP64E-NEXT: mv a0, sp
337 ; RV64I-LP64E-NEXT: call callee
338 ; RV64I-LP64E-NEXT: addi sp, s0, -64
339 ; RV64I-LP64E-NEXT: ld ra, 56(sp) # 8-byte Folded Reload
340 ; RV64I-LP64E-NEXT: ld s0, 48(sp) # 8-byte Folded Reload
341 ; RV64I-LP64E-NEXT: addi sp, sp, 64
342 ; RV64I-LP64E-NEXT: ret
343 %1 = alloca i8, align 64
344 call void @callee(ptr %1)
348 define void @caller_no_realign64() "no-realign-stack" {
349 ; RV32I-LABEL: caller_no_realign64:
351 ; RV32I-NEXT: addi sp, sp, -16
352 ; RV32I-NEXT: .cfi_def_cfa_offset 16
353 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
354 ; RV32I-NEXT: .cfi_offset ra, -4
355 ; RV32I-NEXT: mv a0, sp
356 ; RV32I-NEXT: call callee
357 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
358 ; RV32I-NEXT: addi sp, sp, 16
361 ; RV32I-ILP32E-LABEL: caller_no_realign64:
362 ; RV32I-ILP32E: # %bb.0:
363 ; RV32I-ILP32E-NEXT: addi sp, sp, -8
364 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 8
365 ; RV32I-ILP32E-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
366 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
367 ; RV32I-ILP32E-NEXT: mv a0, sp
368 ; RV32I-ILP32E-NEXT: call callee
369 ; RV32I-ILP32E-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
370 ; RV32I-ILP32E-NEXT: addi sp, sp, 8
371 ; RV32I-ILP32E-NEXT: ret
373 ; RV64I-LABEL: caller_no_realign64:
375 ; RV64I-NEXT: addi sp, sp, -16
376 ; RV64I-NEXT: .cfi_def_cfa_offset 16
377 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
378 ; RV64I-NEXT: .cfi_offset ra, -8
379 ; RV64I-NEXT: mv a0, sp
380 ; RV64I-NEXT: call callee
381 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
382 ; RV64I-NEXT: addi sp, sp, 16
385 ; RV64I-LP64E-LABEL: caller_no_realign64:
386 ; RV64I-LP64E: # %bb.0:
387 ; RV64I-LP64E-NEXT: addi sp, sp, -16
388 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 16
389 ; RV64I-LP64E-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
390 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
391 ; RV64I-LP64E-NEXT: mv a0, sp
392 ; RV64I-LP64E-NEXT: call callee
393 ; RV64I-LP64E-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
394 ; RV64I-LP64E-NEXT: addi sp, sp, 16
395 ; RV64I-LP64E-NEXT: ret
396 %1 = alloca i8, align 64
397 call void @callee(ptr %1)
401 define void @caller128() {
402 ; RV32I-LABEL: caller128:
404 ; RV32I-NEXT: addi sp, sp, -128
405 ; RV32I-NEXT: .cfi_def_cfa_offset 128
406 ; RV32I-NEXT: sw ra, 124(sp) # 4-byte Folded Spill
407 ; RV32I-NEXT: sw s0, 120(sp) # 4-byte Folded Spill
408 ; RV32I-NEXT: .cfi_offset ra, -4
409 ; RV32I-NEXT: .cfi_offset s0, -8
410 ; RV32I-NEXT: addi s0, sp, 128
411 ; RV32I-NEXT: .cfi_def_cfa s0, 0
412 ; RV32I-NEXT: andi sp, sp, -128
413 ; RV32I-NEXT: mv a0, sp
414 ; RV32I-NEXT: call callee
415 ; RV32I-NEXT: addi sp, s0, -128
416 ; RV32I-NEXT: lw ra, 124(sp) # 4-byte Folded Reload
417 ; RV32I-NEXT: lw s0, 120(sp) # 4-byte Folded Reload
418 ; RV32I-NEXT: addi sp, sp, 128
421 ; RV32I-ILP32E-LABEL: caller128:
422 ; RV32I-ILP32E: # %bb.0:
423 ; RV32I-ILP32E-NEXT: addi sp, sp, -128
424 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 128
425 ; RV32I-ILP32E-NEXT: sw ra, 124(sp) # 4-byte Folded Spill
426 ; RV32I-ILP32E-NEXT: sw s0, 120(sp) # 4-byte Folded Spill
427 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
428 ; RV32I-ILP32E-NEXT: .cfi_offset s0, -8
429 ; RV32I-ILP32E-NEXT: addi s0, sp, 128
430 ; RV32I-ILP32E-NEXT: .cfi_def_cfa s0, 0
431 ; RV32I-ILP32E-NEXT: andi sp, sp, -128
432 ; RV32I-ILP32E-NEXT: mv a0, sp
433 ; RV32I-ILP32E-NEXT: call callee
434 ; RV32I-ILP32E-NEXT: addi sp, s0, -128
435 ; RV32I-ILP32E-NEXT: lw ra, 124(sp) # 4-byte Folded Reload
436 ; RV32I-ILP32E-NEXT: lw s0, 120(sp) # 4-byte Folded Reload
437 ; RV32I-ILP32E-NEXT: addi sp, sp, 128
438 ; RV32I-ILP32E-NEXT: ret
440 ; RV64I-LABEL: caller128:
442 ; RV64I-NEXT: addi sp, sp, -128
443 ; RV64I-NEXT: .cfi_def_cfa_offset 128
444 ; RV64I-NEXT: sd ra, 120(sp) # 8-byte Folded Spill
445 ; RV64I-NEXT: sd s0, 112(sp) # 8-byte Folded Spill
446 ; RV64I-NEXT: .cfi_offset ra, -8
447 ; RV64I-NEXT: .cfi_offset s0, -16
448 ; RV64I-NEXT: addi s0, sp, 128
449 ; RV64I-NEXT: .cfi_def_cfa s0, 0
450 ; RV64I-NEXT: andi sp, sp, -128
451 ; RV64I-NEXT: mv a0, sp
452 ; RV64I-NEXT: call callee
453 ; RV64I-NEXT: addi sp, s0, -128
454 ; RV64I-NEXT: ld ra, 120(sp) # 8-byte Folded Reload
455 ; RV64I-NEXT: ld s0, 112(sp) # 8-byte Folded Reload
456 ; RV64I-NEXT: addi sp, sp, 128
459 ; RV64I-LP64E-LABEL: caller128:
460 ; RV64I-LP64E: # %bb.0:
461 ; RV64I-LP64E-NEXT: addi sp, sp, -128
462 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 128
463 ; RV64I-LP64E-NEXT: sd ra, 120(sp) # 8-byte Folded Spill
464 ; RV64I-LP64E-NEXT: sd s0, 112(sp) # 8-byte Folded Spill
465 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
466 ; RV64I-LP64E-NEXT: .cfi_offset s0, -16
467 ; RV64I-LP64E-NEXT: addi s0, sp, 128
468 ; RV64I-LP64E-NEXT: .cfi_def_cfa s0, 0
469 ; RV64I-LP64E-NEXT: andi sp, sp, -128
470 ; RV64I-LP64E-NEXT: mv a0, sp
471 ; RV64I-LP64E-NEXT: call callee
472 ; RV64I-LP64E-NEXT: addi sp, s0, -128
473 ; RV64I-LP64E-NEXT: ld ra, 120(sp) # 8-byte Folded Reload
474 ; RV64I-LP64E-NEXT: ld s0, 112(sp) # 8-byte Folded Reload
475 ; RV64I-LP64E-NEXT: addi sp, sp, 128
476 ; RV64I-LP64E-NEXT: ret
477 %1 = alloca i8, align 128
478 call void @callee(ptr %1)
482 define void @caller_no_realign128() "no-realign-stack" {
483 ; RV32I-LABEL: caller_no_realign128:
485 ; RV32I-NEXT: addi sp, sp, -16
486 ; RV32I-NEXT: .cfi_def_cfa_offset 16
487 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
488 ; RV32I-NEXT: .cfi_offset ra, -4
489 ; RV32I-NEXT: mv a0, sp
490 ; RV32I-NEXT: call callee
491 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
492 ; RV32I-NEXT: addi sp, sp, 16
495 ; RV32I-ILP32E-LABEL: caller_no_realign128:
496 ; RV32I-ILP32E: # %bb.0:
497 ; RV32I-ILP32E-NEXT: addi sp, sp, -8
498 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 8
499 ; RV32I-ILP32E-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
500 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
501 ; RV32I-ILP32E-NEXT: mv a0, sp
502 ; RV32I-ILP32E-NEXT: call callee
503 ; RV32I-ILP32E-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
504 ; RV32I-ILP32E-NEXT: addi sp, sp, 8
505 ; RV32I-ILP32E-NEXT: ret
507 ; RV64I-LABEL: caller_no_realign128:
509 ; RV64I-NEXT: addi sp, sp, -16
510 ; RV64I-NEXT: .cfi_def_cfa_offset 16
511 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
512 ; RV64I-NEXT: .cfi_offset ra, -8
513 ; RV64I-NEXT: mv a0, sp
514 ; RV64I-NEXT: call callee
515 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
516 ; RV64I-NEXT: addi sp, sp, 16
519 ; RV64I-LP64E-LABEL: caller_no_realign128:
520 ; RV64I-LP64E: # %bb.0:
521 ; RV64I-LP64E-NEXT: addi sp, sp, -16
522 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 16
523 ; RV64I-LP64E-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
524 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
525 ; RV64I-LP64E-NEXT: mv a0, sp
526 ; RV64I-LP64E-NEXT: call callee
527 ; RV64I-LP64E-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
528 ; RV64I-LP64E-NEXT: addi sp, sp, 16
529 ; RV64I-LP64E-NEXT: ret
530 %1 = alloca i8, align 128
531 call void @callee(ptr %1)
535 define void @caller256() {
536 ; RV32I-LABEL: caller256:
538 ; RV32I-NEXT: addi sp, sp, -256
539 ; RV32I-NEXT: .cfi_def_cfa_offset 256
540 ; RV32I-NEXT: sw ra, 252(sp) # 4-byte Folded Spill
541 ; RV32I-NEXT: sw s0, 248(sp) # 4-byte Folded Spill
542 ; RV32I-NEXT: .cfi_offset ra, -4
543 ; RV32I-NEXT: .cfi_offset s0, -8
544 ; RV32I-NEXT: addi s0, sp, 256
545 ; RV32I-NEXT: .cfi_def_cfa s0, 0
546 ; RV32I-NEXT: andi sp, sp, -256
547 ; RV32I-NEXT: mv a0, sp
548 ; RV32I-NEXT: call callee
549 ; RV32I-NEXT: addi sp, s0, -256
550 ; RV32I-NEXT: lw ra, 252(sp) # 4-byte Folded Reload
551 ; RV32I-NEXT: lw s0, 248(sp) # 4-byte Folded Reload
552 ; RV32I-NEXT: addi sp, sp, 256
555 ; RV32I-ILP32E-LABEL: caller256:
556 ; RV32I-ILP32E: # %bb.0:
557 ; RV32I-ILP32E-NEXT: addi sp, sp, -256
558 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 256
559 ; RV32I-ILP32E-NEXT: sw ra, 252(sp) # 4-byte Folded Spill
560 ; RV32I-ILP32E-NEXT: sw s0, 248(sp) # 4-byte Folded Spill
561 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
562 ; RV32I-ILP32E-NEXT: .cfi_offset s0, -8
563 ; RV32I-ILP32E-NEXT: addi s0, sp, 256
564 ; RV32I-ILP32E-NEXT: .cfi_def_cfa s0, 0
565 ; RV32I-ILP32E-NEXT: andi sp, sp, -256
566 ; RV32I-ILP32E-NEXT: mv a0, sp
567 ; RV32I-ILP32E-NEXT: call callee
568 ; RV32I-ILP32E-NEXT: addi sp, s0, -256
569 ; RV32I-ILP32E-NEXT: lw ra, 252(sp) # 4-byte Folded Reload
570 ; RV32I-ILP32E-NEXT: lw s0, 248(sp) # 4-byte Folded Reload
571 ; RV32I-ILP32E-NEXT: addi sp, sp, 256
572 ; RV32I-ILP32E-NEXT: ret
574 ; RV64I-LABEL: caller256:
576 ; RV64I-NEXT: addi sp, sp, -256
577 ; RV64I-NEXT: .cfi_def_cfa_offset 256
578 ; RV64I-NEXT: sd ra, 248(sp) # 8-byte Folded Spill
579 ; RV64I-NEXT: sd s0, 240(sp) # 8-byte Folded Spill
580 ; RV64I-NEXT: .cfi_offset ra, -8
581 ; RV64I-NEXT: .cfi_offset s0, -16
582 ; RV64I-NEXT: addi s0, sp, 256
583 ; RV64I-NEXT: .cfi_def_cfa s0, 0
584 ; RV64I-NEXT: andi sp, sp, -256
585 ; RV64I-NEXT: mv a0, sp
586 ; RV64I-NEXT: call callee
587 ; RV64I-NEXT: addi sp, s0, -256
588 ; RV64I-NEXT: ld ra, 248(sp) # 8-byte Folded Reload
589 ; RV64I-NEXT: ld s0, 240(sp) # 8-byte Folded Reload
590 ; RV64I-NEXT: addi sp, sp, 256
593 ; RV64I-LP64E-LABEL: caller256:
594 ; RV64I-LP64E: # %bb.0:
595 ; RV64I-LP64E-NEXT: addi sp, sp, -256
596 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 256
597 ; RV64I-LP64E-NEXT: sd ra, 248(sp) # 8-byte Folded Spill
598 ; RV64I-LP64E-NEXT: sd s0, 240(sp) # 8-byte Folded Spill
599 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
600 ; RV64I-LP64E-NEXT: .cfi_offset s0, -16
601 ; RV64I-LP64E-NEXT: addi s0, sp, 256
602 ; RV64I-LP64E-NEXT: .cfi_def_cfa s0, 0
603 ; RV64I-LP64E-NEXT: andi sp, sp, -256
604 ; RV64I-LP64E-NEXT: mv a0, sp
605 ; RV64I-LP64E-NEXT: call callee
606 ; RV64I-LP64E-NEXT: addi sp, s0, -256
607 ; RV64I-LP64E-NEXT: ld ra, 248(sp) # 8-byte Folded Reload
608 ; RV64I-LP64E-NEXT: ld s0, 240(sp) # 8-byte Folded Reload
609 ; RV64I-LP64E-NEXT: addi sp, sp, 256
610 ; RV64I-LP64E-NEXT: ret
611 %1 = alloca i8, align 256
612 call void @callee(ptr %1)
616 define void @caller_no_realign256() "no-realign-stack" {
617 ; RV32I-LABEL: caller_no_realign256:
619 ; RV32I-NEXT: addi sp, sp, -16
620 ; RV32I-NEXT: .cfi_def_cfa_offset 16
621 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
622 ; RV32I-NEXT: .cfi_offset ra, -4
623 ; RV32I-NEXT: mv a0, sp
624 ; RV32I-NEXT: call callee
625 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
626 ; RV32I-NEXT: addi sp, sp, 16
629 ; RV32I-ILP32E-LABEL: caller_no_realign256:
630 ; RV32I-ILP32E: # %bb.0:
631 ; RV32I-ILP32E-NEXT: addi sp, sp, -8
632 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 8
633 ; RV32I-ILP32E-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
634 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
635 ; RV32I-ILP32E-NEXT: mv a0, sp
636 ; RV32I-ILP32E-NEXT: call callee
637 ; RV32I-ILP32E-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
638 ; RV32I-ILP32E-NEXT: addi sp, sp, 8
639 ; RV32I-ILP32E-NEXT: ret
641 ; RV64I-LABEL: caller_no_realign256:
643 ; RV64I-NEXT: addi sp, sp, -16
644 ; RV64I-NEXT: .cfi_def_cfa_offset 16
645 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
646 ; RV64I-NEXT: .cfi_offset ra, -8
647 ; RV64I-NEXT: mv a0, sp
648 ; RV64I-NEXT: call callee
649 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
650 ; RV64I-NEXT: addi sp, sp, 16
653 ; RV64I-LP64E-LABEL: caller_no_realign256:
654 ; RV64I-LP64E: # %bb.0:
655 ; RV64I-LP64E-NEXT: addi sp, sp, -16
656 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 16
657 ; RV64I-LP64E-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
658 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
659 ; RV64I-LP64E-NEXT: mv a0, sp
660 ; RV64I-LP64E-NEXT: call callee
661 ; RV64I-LP64E-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
662 ; RV64I-LP64E-NEXT: addi sp, sp, 16
663 ; RV64I-LP64E-NEXT: ret
664 %1 = alloca i8, align 256
665 call void @callee(ptr %1)
669 define void @caller512() {
670 ; RV32I-LABEL: caller512:
672 ; RV32I-NEXT: addi sp, sp, -1024
673 ; RV32I-NEXT: .cfi_def_cfa_offset 1024
674 ; RV32I-NEXT: sw ra, 1020(sp) # 4-byte Folded Spill
675 ; RV32I-NEXT: sw s0, 1016(sp) # 4-byte Folded Spill
676 ; RV32I-NEXT: .cfi_offset ra, -4
677 ; RV32I-NEXT: .cfi_offset s0, -8
678 ; RV32I-NEXT: addi s0, sp, 1024
679 ; RV32I-NEXT: .cfi_def_cfa s0, 0
680 ; RV32I-NEXT: andi sp, sp, -512
681 ; RV32I-NEXT: addi a0, sp, 512
682 ; RV32I-NEXT: call callee
683 ; RV32I-NEXT: addi sp, s0, -1024
684 ; RV32I-NEXT: lw ra, 1020(sp) # 4-byte Folded Reload
685 ; RV32I-NEXT: lw s0, 1016(sp) # 4-byte Folded Reload
686 ; RV32I-NEXT: addi sp, sp, 1024
689 ; RV32I-ILP32E-LABEL: caller512:
690 ; RV32I-ILP32E: # %bb.0:
691 ; RV32I-ILP32E-NEXT: addi sp, sp, -1024
692 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 1024
693 ; RV32I-ILP32E-NEXT: sw ra, 1020(sp) # 4-byte Folded Spill
694 ; RV32I-ILP32E-NEXT: sw s0, 1016(sp) # 4-byte Folded Spill
695 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
696 ; RV32I-ILP32E-NEXT: .cfi_offset s0, -8
697 ; RV32I-ILP32E-NEXT: addi s0, sp, 1024
698 ; RV32I-ILP32E-NEXT: .cfi_def_cfa s0, 0
699 ; RV32I-ILP32E-NEXT: andi sp, sp, -512
700 ; RV32I-ILP32E-NEXT: addi a0, sp, 512
701 ; RV32I-ILP32E-NEXT: call callee
702 ; RV32I-ILP32E-NEXT: addi sp, s0, -1024
703 ; RV32I-ILP32E-NEXT: lw ra, 1020(sp) # 4-byte Folded Reload
704 ; RV32I-ILP32E-NEXT: lw s0, 1016(sp) # 4-byte Folded Reload
705 ; RV32I-ILP32E-NEXT: addi sp, sp, 1024
706 ; RV32I-ILP32E-NEXT: ret
708 ; RV64I-LABEL: caller512:
710 ; RV64I-NEXT: addi sp, sp, -1024
711 ; RV64I-NEXT: .cfi_def_cfa_offset 1024
712 ; RV64I-NEXT: sd ra, 1016(sp) # 8-byte Folded Spill
713 ; RV64I-NEXT: sd s0, 1008(sp) # 8-byte Folded Spill
714 ; RV64I-NEXT: .cfi_offset ra, -8
715 ; RV64I-NEXT: .cfi_offset s0, -16
716 ; RV64I-NEXT: addi s0, sp, 1024
717 ; RV64I-NEXT: .cfi_def_cfa s0, 0
718 ; RV64I-NEXT: andi sp, sp, -512
719 ; RV64I-NEXT: addi a0, sp, 512
720 ; RV64I-NEXT: call callee
721 ; RV64I-NEXT: addi sp, s0, -1024
722 ; RV64I-NEXT: ld ra, 1016(sp) # 8-byte Folded Reload
723 ; RV64I-NEXT: ld s0, 1008(sp) # 8-byte Folded Reload
724 ; RV64I-NEXT: addi sp, sp, 1024
727 ; RV64I-LP64E-LABEL: caller512:
728 ; RV64I-LP64E: # %bb.0:
729 ; RV64I-LP64E-NEXT: addi sp, sp, -1024
730 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 1024
731 ; RV64I-LP64E-NEXT: sd ra, 1016(sp) # 8-byte Folded Spill
732 ; RV64I-LP64E-NEXT: sd s0, 1008(sp) # 8-byte Folded Spill
733 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
734 ; RV64I-LP64E-NEXT: .cfi_offset s0, -16
735 ; RV64I-LP64E-NEXT: addi s0, sp, 1024
736 ; RV64I-LP64E-NEXT: .cfi_def_cfa s0, 0
737 ; RV64I-LP64E-NEXT: andi sp, sp, -512
738 ; RV64I-LP64E-NEXT: addi a0, sp, 512
739 ; RV64I-LP64E-NEXT: call callee
740 ; RV64I-LP64E-NEXT: addi sp, s0, -1024
741 ; RV64I-LP64E-NEXT: ld ra, 1016(sp) # 8-byte Folded Reload
742 ; RV64I-LP64E-NEXT: ld s0, 1008(sp) # 8-byte Folded Reload
743 ; RV64I-LP64E-NEXT: addi sp, sp, 1024
744 ; RV64I-LP64E-NEXT: ret
745 %1 = alloca i8, align 512
746 call void @callee(ptr %1)
750 define void @caller_no_realign512() "no-realign-stack" {
751 ; RV32I-LABEL: caller_no_realign512:
753 ; RV32I-NEXT: addi sp, sp, -16
754 ; RV32I-NEXT: .cfi_def_cfa_offset 16
755 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
756 ; RV32I-NEXT: .cfi_offset ra, -4
757 ; RV32I-NEXT: mv a0, sp
758 ; RV32I-NEXT: call callee
759 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
760 ; RV32I-NEXT: addi sp, sp, 16
763 ; RV32I-ILP32E-LABEL: caller_no_realign512:
764 ; RV32I-ILP32E: # %bb.0:
765 ; RV32I-ILP32E-NEXT: addi sp, sp, -8
766 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 8
767 ; RV32I-ILP32E-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
768 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
769 ; RV32I-ILP32E-NEXT: mv a0, sp
770 ; RV32I-ILP32E-NEXT: call callee
771 ; RV32I-ILP32E-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
772 ; RV32I-ILP32E-NEXT: addi sp, sp, 8
773 ; RV32I-ILP32E-NEXT: ret
775 ; RV64I-LABEL: caller_no_realign512:
777 ; RV64I-NEXT: addi sp, sp, -16
778 ; RV64I-NEXT: .cfi_def_cfa_offset 16
779 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
780 ; RV64I-NEXT: .cfi_offset ra, -8
781 ; RV64I-NEXT: mv a0, sp
782 ; RV64I-NEXT: call callee
783 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
784 ; RV64I-NEXT: addi sp, sp, 16
787 ; RV64I-LP64E-LABEL: caller_no_realign512:
788 ; RV64I-LP64E: # %bb.0:
789 ; RV64I-LP64E-NEXT: addi sp, sp, -16
790 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 16
791 ; RV64I-LP64E-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
792 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
793 ; RV64I-LP64E-NEXT: mv a0, sp
794 ; RV64I-LP64E-NEXT: call callee
795 ; RV64I-LP64E-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
796 ; RV64I-LP64E-NEXT: addi sp, sp, 16
797 ; RV64I-LP64E-NEXT: ret
798 %1 = alloca i8, align 512
799 call void @callee(ptr %1)
803 define void @caller1024() {
804 ; RV32I-LABEL: caller1024:
806 ; RV32I-NEXT: addi sp, sp, -2032
807 ; RV32I-NEXT: .cfi_def_cfa_offset 2032
808 ; RV32I-NEXT: sw ra, 2028(sp) # 4-byte Folded Spill
809 ; RV32I-NEXT: sw s0, 2024(sp) # 4-byte Folded Spill
810 ; RV32I-NEXT: .cfi_offset ra, -4
811 ; RV32I-NEXT: .cfi_offset s0, -8
812 ; RV32I-NEXT: addi s0, sp, 2032
813 ; RV32I-NEXT: .cfi_def_cfa s0, 0
814 ; RV32I-NEXT: addi sp, sp, -16
815 ; RV32I-NEXT: andi sp, sp, -1024
816 ; RV32I-NEXT: addi a0, sp, 1024
817 ; RV32I-NEXT: call callee
818 ; RV32I-NEXT: addi sp, s0, -2048
819 ; RV32I-NEXT: addi sp, sp, 16
820 ; RV32I-NEXT: lw ra, 2028(sp) # 4-byte Folded Reload
821 ; RV32I-NEXT: lw s0, 2024(sp) # 4-byte Folded Reload
822 ; RV32I-NEXT: addi sp, sp, 2032
825 ; RV32I-ILP32E-LABEL: caller1024:
826 ; RV32I-ILP32E: # %bb.0:
827 ; RV32I-ILP32E-NEXT: addi sp, sp, -2044
828 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 2044
829 ; RV32I-ILP32E-NEXT: sw ra, 2040(sp) # 4-byte Folded Spill
830 ; RV32I-ILP32E-NEXT: sw s0, 2036(sp) # 4-byte Folded Spill
831 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
832 ; RV32I-ILP32E-NEXT: .cfi_offset s0, -8
833 ; RV32I-ILP32E-NEXT: addi s0, sp, 2044
834 ; RV32I-ILP32E-NEXT: .cfi_def_cfa s0, 0
835 ; RV32I-ILP32E-NEXT: addi sp, sp, -4
836 ; RV32I-ILP32E-NEXT: andi sp, sp, -1024
837 ; RV32I-ILP32E-NEXT: addi a0, sp, 1024
838 ; RV32I-ILP32E-NEXT: call callee
839 ; RV32I-ILP32E-NEXT: addi sp, s0, -2048
840 ; RV32I-ILP32E-NEXT: addi sp, sp, 4
841 ; RV32I-ILP32E-NEXT: lw ra, 2040(sp) # 4-byte Folded Reload
842 ; RV32I-ILP32E-NEXT: lw s0, 2036(sp) # 4-byte Folded Reload
843 ; RV32I-ILP32E-NEXT: addi sp, sp, 2044
844 ; RV32I-ILP32E-NEXT: ret
846 ; RV64I-LABEL: caller1024:
848 ; RV64I-NEXT: addi sp, sp, -2032
849 ; RV64I-NEXT: .cfi_def_cfa_offset 2032
850 ; RV64I-NEXT: sd ra, 2024(sp) # 8-byte Folded Spill
851 ; RV64I-NEXT: sd s0, 2016(sp) # 8-byte Folded Spill
852 ; RV64I-NEXT: .cfi_offset ra, -8
853 ; RV64I-NEXT: .cfi_offset s0, -16
854 ; RV64I-NEXT: addi s0, sp, 2032
855 ; RV64I-NEXT: .cfi_def_cfa s0, 0
856 ; RV64I-NEXT: addi sp, sp, -16
857 ; RV64I-NEXT: andi sp, sp, -1024
858 ; RV64I-NEXT: addi a0, sp, 1024
859 ; RV64I-NEXT: call callee
860 ; RV64I-NEXT: addi sp, s0, -2048
861 ; RV64I-NEXT: addi sp, sp, 16
862 ; RV64I-NEXT: ld ra, 2024(sp) # 8-byte Folded Reload
863 ; RV64I-NEXT: ld s0, 2016(sp) # 8-byte Folded Reload
864 ; RV64I-NEXT: addi sp, sp, 2032
867 ; RV64I-LP64E-LABEL: caller1024:
868 ; RV64I-LP64E: # %bb.0:
869 ; RV64I-LP64E-NEXT: addi sp, sp, -2040
870 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 2040
871 ; RV64I-LP64E-NEXT: sd ra, 2032(sp) # 8-byte Folded Spill
872 ; RV64I-LP64E-NEXT: sd s0, 2024(sp) # 8-byte Folded Spill
873 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
874 ; RV64I-LP64E-NEXT: .cfi_offset s0, -16
875 ; RV64I-LP64E-NEXT: addi s0, sp, 2040
876 ; RV64I-LP64E-NEXT: .cfi_def_cfa s0, 0
877 ; RV64I-LP64E-NEXT: addi sp, sp, -8
878 ; RV64I-LP64E-NEXT: andi sp, sp, -1024
879 ; RV64I-LP64E-NEXT: addi a0, sp, 1024
880 ; RV64I-LP64E-NEXT: call callee
881 ; RV64I-LP64E-NEXT: addi sp, s0, -2048
882 ; RV64I-LP64E-NEXT: addi sp, sp, 8
883 ; RV64I-LP64E-NEXT: ld ra, 2032(sp) # 8-byte Folded Reload
884 ; RV64I-LP64E-NEXT: ld s0, 2024(sp) # 8-byte Folded Reload
885 ; RV64I-LP64E-NEXT: addi sp, sp, 2040
886 ; RV64I-LP64E-NEXT: ret
887 %1 = alloca i8, align 1024
888 call void @callee(ptr %1)
892 define void @caller_no_realign1024() "no-realign-stack" {
893 ; RV32I-LABEL: caller_no_realign1024:
895 ; RV32I-NEXT: addi sp, sp, -16
896 ; RV32I-NEXT: .cfi_def_cfa_offset 16
897 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
898 ; RV32I-NEXT: .cfi_offset ra, -4
899 ; RV32I-NEXT: mv a0, sp
900 ; RV32I-NEXT: call callee
901 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
902 ; RV32I-NEXT: addi sp, sp, 16
905 ; RV32I-ILP32E-LABEL: caller_no_realign1024:
906 ; RV32I-ILP32E: # %bb.0:
907 ; RV32I-ILP32E-NEXT: addi sp, sp, -8
908 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 8
909 ; RV32I-ILP32E-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
910 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
911 ; RV32I-ILP32E-NEXT: mv a0, sp
912 ; RV32I-ILP32E-NEXT: call callee
913 ; RV32I-ILP32E-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
914 ; RV32I-ILP32E-NEXT: addi sp, sp, 8
915 ; RV32I-ILP32E-NEXT: ret
917 ; RV64I-LABEL: caller_no_realign1024:
919 ; RV64I-NEXT: addi sp, sp, -16
920 ; RV64I-NEXT: .cfi_def_cfa_offset 16
921 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
922 ; RV64I-NEXT: .cfi_offset ra, -8
923 ; RV64I-NEXT: mv a0, sp
924 ; RV64I-NEXT: call callee
925 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
926 ; RV64I-NEXT: addi sp, sp, 16
929 ; RV64I-LP64E-LABEL: caller_no_realign1024:
930 ; RV64I-LP64E: # %bb.0:
931 ; RV64I-LP64E-NEXT: addi sp, sp, -16
932 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 16
933 ; RV64I-LP64E-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
934 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
935 ; RV64I-LP64E-NEXT: mv a0, sp
936 ; RV64I-LP64E-NEXT: call callee
937 ; RV64I-LP64E-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
938 ; RV64I-LP64E-NEXT: addi sp, sp, 16
939 ; RV64I-LP64E-NEXT: ret
940 %1 = alloca i8, align 1024
941 call void @callee(ptr %1)
945 define void @caller2048() {
946 ; RV32I-LABEL: caller2048:
948 ; RV32I-NEXT: addi sp, sp, -2032
949 ; RV32I-NEXT: .cfi_def_cfa_offset 2032
950 ; RV32I-NEXT: sw ra, 2028(sp) # 4-byte Folded Spill
951 ; RV32I-NEXT: sw s0, 2024(sp) # 4-byte Folded Spill
952 ; RV32I-NEXT: .cfi_offset ra, -4
953 ; RV32I-NEXT: .cfi_offset s0, -8
954 ; RV32I-NEXT: addi s0, sp, 2032
955 ; RV32I-NEXT: .cfi_def_cfa s0, 0
956 ; RV32I-NEXT: addi sp, sp, -2048
957 ; RV32I-NEXT: addi sp, sp, -16
958 ; RV32I-NEXT: andi sp, sp, -2048
959 ; RV32I-NEXT: addi a0, sp, 2047
960 ; RV32I-NEXT: addi a0, a0, 1
961 ; RV32I-NEXT: call callee
962 ; RV32I-NEXT: lui a0, 1
963 ; RV32I-NEXT: sub sp, s0, a0
964 ; RV32I-NEXT: addi sp, sp, 2032
965 ; RV32I-NEXT: addi sp, sp, 32
966 ; RV32I-NEXT: lw ra, 2028(sp) # 4-byte Folded Reload
967 ; RV32I-NEXT: lw s0, 2024(sp) # 4-byte Folded Reload
968 ; RV32I-NEXT: addi sp, sp, 2032
971 ; RV32I-ILP32E-LABEL: caller2048:
972 ; RV32I-ILP32E: # %bb.0:
973 ; RV32I-ILP32E-NEXT: addi sp, sp, -2044
974 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 2044
975 ; RV32I-ILP32E-NEXT: sw ra, 2040(sp) # 4-byte Folded Spill
976 ; RV32I-ILP32E-NEXT: sw s0, 2036(sp) # 4-byte Folded Spill
977 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
978 ; RV32I-ILP32E-NEXT: .cfi_offset s0, -8
979 ; RV32I-ILP32E-NEXT: addi s0, sp, 2044
980 ; RV32I-ILP32E-NEXT: .cfi_def_cfa s0, 0
981 ; RV32I-ILP32E-NEXT: addi sp, sp, -2048
982 ; RV32I-ILP32E-NEXT: addi sp, sp, -4
983 ; RV32I-ILP32E-NEXT: andi sp, sp, -2048
984 ; RV32I-ILP32E-NEXT: addi a0, sp, 2047
985 ; RV32I-ILP32E-NEXT: addi a0, a0, 1
986 ; RV32I-ILP32E-NEXT: call callee
987 ; RV32I-ILP32E-NEXT: lui a0, 1
988 ; RV32I-ILP32E-NEXT: sub sp, s0, a0
989 ; RV32I-ILP32E-NEXT: addi sp, sp, 2044
990 ; RV32I-ILP32E-NEXT: addi sp, sp, 8
991 ; RV32I-ILP32E-NEXT: lw ra, 2040(sp) # 4-byte Folded Reload
992 ; RV32I-ILP32E-NEXT: lw s0, 2036(sp) # 4-byte Folded Reload
993 ; RV32I-ILP32E-NEXT: addi sp, sp, 2044
994 ; RV32I-ILP32E-NEXT: ret
996 ; RV64I-LABEL: caller2048:
998 ; RV64I-NEXT: addi sp, sp, -2032
999 ; RV64I-NEXT: .cfi_def_cfa_offset 2032
1000 ; RV64I-NEXT: sd ra, 2024(sp) # 8-byte Folded Spill
1001 ; RV64I-NEXT: sd s0, 2016(sp) # 8-byte Folded Spill
1002 ; RV64I-NEXT: .cfi_offset ra, -8
1003 ; RV64I-NEXT: .cfi_offset s0, -16
1004 ; RV64I-NEXT: addi s0, sp, 2032
1005 ; RV64I-NEXT: .cfi_def_cfa s0, 0
1006 ; RV64I-NEXT: addi sp, sp, -2048
1007 ; RV64I-NEXT: addi sp, sp, -16
1008 ; RV64I-NEXT: andi sp, sp, -2048
1009 ; RV64I-NEXT: addi a0, sp, 2047
1010 ; RV64I-NEXT: addi a0, a0, 1
1011 ; RV64I-NEXT: call callee
1012 ; RV64I-NEXT: lui a0, 1
1013 ; RV64I-NEXT: sub sp, s0, a0
1014 ; RV64I-NEXT: addi sp, sp, 2032
1015 ; RV64I-NEXT: addi sp, sp, 32
1016 ; RV64I-NEXT: ld ra, 2024(sp) # 8-byte Folded Reload
1017 ; RV64I-NEXT: ld s0, 2016(sp) # 8-byte Folded Reload
1018 ; RV64I-NEXT: addi sp, sp, 2032
1021 ; RV64I-LP64E-LABEL: caller2048:
1022 ; RV64I-LP64E: # %bb.0:
1023 ; RV64I-LP64E-NEXT: addi sp, sp, -2040
1024 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 2040
1025 ; RV64I-LP64E-NEXT: sd ra, 2032(sp) # 8-byte Folded Spill
1026 ; RV64I-LP64E-NEXT: sd s0, 2024(sp) # 8-byte Folded Spill
1027 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
1028 ; RV64I-LP64E-NEXT: .cfi_offset s0, -16
1029 ; RV64I-LP64E-NEXT: addi s0, sp, 2040
1030 ; RV64I-LP64E-NEXT: .cfi_def_cfa s0, 0
1031 ; RV64I-LP64E-NEXT: addi sp, sp, -2048
1032 ; RV64I-LP64E-NEXT: addi sp, sp, -8
1033 ; RV64I-LP64E-NEXT: andi sp, sp, -2048
1034 ; RV64I-LP64E-NEXT: addi a0, sp, 2047
1035 ; RV64I-LP64E-NEXT: addi a0, a0, 1
1036 ; RV64I-LP64E-NEXT: call callee
1037 ; RV64I-LP64E-NEXT: lui a0, 1
1038 ; RV64I-LP64E-NEXT: sub sp, s0, a0
1039 ; RV64I-LP64E-NEXT: addi sp, sp, 2040
1040 ; RV64I-LP64E-NEXT: addi sp, sp, 16
1041 ; RV64I-LP64E-NEXT: ld ra, 2032(sp) # 8-byte Folded Reload
1042 ; RV64I-LP64E-NEXT: ld s0, 2024(sp) # 8-byte Folded Reload
1043 ; RV64I-LP64E-NEXT: addi sp, sp, 2040
1044 ; RV64I-LP64E-NEXT: ret
1045 %1 = alloca i8, align 2048
1046 call void @callee(ptr %1)
1050 define void @caller_no_realign2048() "no-realign-stack" {
1051 ; RV32I-LABEL: caller_no_realign2048:
1053 ; RV32I-NEXT: addi sp, sp, -16
1054 ; RV32I-NEXT: .cfi_def_cfa_offset 16
1055 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1056 ; RV32I-NEXT: .cfi_offset ra, -4
1057 ; RV32I-NEXT: mv a0, sp
1058 ; RV32I-NEXT: call callee
1059 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1060 ; RV32I-NEXT: addi sp, sp, 16
1063 ; RV32I-ILP32E-LABEL: caller_no_realign2048:
1064 ; RV32I-ILP32E: # %bb.0:
1065 ; RV32I-ILP32E-NEXT: addi sp, sp, -8
1066 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 8
1067 ; RV32I-ILP32E-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
1068 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
1069 ; RV32I-ILP32E-NEXT: mv a0, sp
1070 ; RV32I-ILP32E-NEXT: call callee
1071 ; RV32I-ILP32E-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
1072 ; RV32I-ILP32E-NEXT: addi sp, sp, 8
1073 ; RV32I-ILP32E-NEXT: ret
1075 ; RV64I-LABEL: caller_no_realign2048:
1077 ; RV64I-NEXT: addi sp, sp, -16
1078 ; RV64I-NEXT: .cfi_def_cfa_offset 16
1079 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1080 ; RV64I-NEXT: .cfi_offset ra, -8
1081 ; RV64I-NEXT: mv a0, sp
1082 ; RV64I-NEXT: call callee
1083 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1084 ; RV64I-NEXT: addi sp, sp, 16
1087 ; RV64I-LP64E-LABEL: caller_no_realign2048:
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: addi sp, sp, 16
1097 ; RV64I-LP64E-NEXT: ret
1098 %1 = alloca i8, align 2048
1099 call void @callee(ptr %1)
1103 define void @caller4096() {
1104 ; RV32I-LABEL: caller4096:
1106 ; RV32I-NEXT: addi sp, sp, -2032
1107 ; RV32I-NEXT: .cfi_def_cfa_offset 2032
1108 ; RV32I-NEXT: sw ra, 2028(sp) # 4-byte Folded Spill
1109 ; RV32I-NEXT: sw s0, 2024(sp) # 4-byte Folded Spill
1110 ; RV32I-NEXT: .cfi_offset ra, -4
1111 ; RV32I-NEXT: .cfi_offset s0, -8
1112 ; RV32I-NEXT: addi s0, sp, 2032
1113 ; RV32I-NEXT: .cfi_def_cfa s0, 0
1114 ; RV32I-NEXT: lui a0, 2
1115 ; RV32I-NEXT: addi a0, a0, -2032
1116 ; RV32I-NEXT: sub sp, sp, a0
1117 ; RV32I-NEXT: srli a0, sp, 12
1118 ; RV32I-NEXT: slli sp, a0, 12
1119 ; RV32I-NEXT: lui a0, 1
1120 ; RV32I-NEXT: add a0, sp, a0
1121 ; RV32I-NEXT: call callee
1122 ; RV32I-NEXT: lui a0, 2
1123 ; RV32I-NEXT: sub sp, s0, a0
1124 ; RV32I-NEXT: addi a0, a0, -2032
1125 ; RV32I-NEXT: add sp, sp, a0
1126 ; RV32I-NEXT: lw ra, 2028(sp) # 4-byte Folded Reload
1127 ; RV32I-NEXT: lw s0, 2024(sp) # 4-byte Folded Reload
1128 ; RV32I-NEXT: addi sp, sp, 2032
1131 ; RV32I-ILP32E-LABEL: caller4096:
1132 ; RV32I-ILP32E: # %bb.0:
1133 ; RV32I-ILP32E-NEXT: addi sp, sp, -2044
1134 ; RV32I-ILP32E-NEXT: .cfi_def_cfa_offset 2044
1135 ; RV32I-ILP32E-NEXT: sw ra, 2040(sp) # 4-byte Folded Spill
1136 ; RV32I-ILP32E-NEXT: sw s0, 2036(sp) # 4-byte Folded Spill
1137 ; RV32I-ILP32E-NEXT: .cfi_offset ra, -4
1138 ; RV32I-ILP32E-NEXT: .cfi_offset s0, -8
1139 ; RV32I-ILP32E-NEXT: addi s0, sp, 2044
1140 ; RV32I-ILP32E-NEXT: .cfi_def_cfa s0, 0
1141 ; RV32I-ILP32E-NEXT: lui a0, 2
1142 ; RV32I-ILP32E-NEXT: addi a0, a0, -2044
1143 ; RV32I-ILP32E-NEXT: sub sp, sp, a0
1144 ; RV32I-ILP32E-NEXT: srli a0, sp, 12
1145 ; RV32I-ILP32E-NEXT: slli sp, a0, 12
1146 ; RV32I-ILP32E-NEXT: lui a0, 1
1147 ; RV32I-ILP32E-NEXT: add a0, sp, a0
1148 ; RV32I-ILP32E-NEXT: call callee
1149 ; RV32I-ILP32E-NEXT: lui a0, 2
1150 ; RV32I-ILP32E-NEXT: sub sp, s0, a0
1151 ; RV32I-ILP32E-NEXT: addi a0, a0, -2044
1152 ; RV32I-ILP32E-NEXT: add sp, sp, a0
1153 ; RV32I-ILP32E-NEXT: lw ra, 2040(sp) # 4-byte Folded Reload
1154 ; RV32I-ILP32E-NEXT: lw s0, 2036(sp) # 4-byte Folded Reload
1155 ; RV32I-ILP32E-NEXT: addi sp, sp, 2044
1156 ; RV32I-ILP32E-NEXT: ret
1158 ; RV64I-LABEL: caller4096:
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: lui a0, 2
1169 ; RV64I-NEXT: addiw a0, a0, -2032
1170 ; RV64I-NEXT: sub sp, sp, a0
1171 ; RV64I-NEXT: srli a0, sp, 12
1172 ; RV64I-NEXT: slli sp, a0, 12
1173 ; RV64I-NEXT: lui a0, 1
1174 ; RV64I-NEXT: add a0, sp, a0
1175 ; RV64I-NEXT: call callee
1176 ; RV64I-NEXT: lui a0, 2
1177 ; RV64I-NEXT: sub sp, s0, a0
1178 ; RV64I-NEXT: addiw a0, a0, -2032
1179 ; RV64I-NEXT: add sp, sp, a0
1180 ; RV64I-NEXT: ld ra, 2024(sp) # 8-byte Folded Reload
1181 ; RV64I-NEXT: ld s0, 2016(sp) # 8-byte Folded Reload
1182 ; RV64I-NEXT: addi sp, sp, 2032
1185 ; RV64I-LP64E-LABEL: caller4096:
1186 ; RV64I-LP64E: # %bb.0:
1187 ; RV64I-LP64E-NEXT: addi sp, sp, -2040
1188 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 2040
1189 ; RV64I-LP64E-NEXT: sd ra, 2032(sp) # 8-byte Folded Spill
1190 ; RV64I-LP64E-NEXT: sd s0, 2024(sp) # 8-byte Folded Spill
1191 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
1192 ; RV64I-LP64E-NEXT: .cfi_offset s0, -16
1193 ; RV64I-LP64E-NEXT: addi s0, sp, 2040
1194 ; RV64I-LP64E-NEXT: .cfi_def_cfa s0, 0
1195 ; RV64I-LP64E-NEXT: lui a0, 2
1196 ; RV64I-LP64E-NEXT: addiw a0, a0, -2040
1197 ; RV64I-LP64E-NEXT: sub sp, sp, a0
1198 ; RV64I-LP64E-NEXT: srli a0, sp, 12
1199 ; RV64I-LP64E-NEXT: slli sp, a0, 12
1200 ; RV64I-LP64E-NEXT: lui a0, 1
1201 ; RV64I-LP64E-NEXT: add a0, sp, a0
1202 ; RV64I-LP64E-NEXT: call callee
1203 ; RV64I-LP64E-NEXT: lui a0, 2
1204 ; RV64I-LP64E-NEXT: sub sp, s0, a0
1205 ; RV64I-LP64E-NEXT: addiw a0, a0, -2040
1206 ; RV64I-LP64E-NEXT: add sp, sp, a0
1207 ; RV64I-LP64E-NEXT: ld ra, 2032(sp) # 8-byte Folded Reload
1208 ; RV64I-LP64E-NEXT: ld s0, 2024(sp) # 8-byte Folded Reload
1209 ; RV64I-LP64E-NEXT: addi sp, sp, 2040
1210 ; RV64I-LP64E-NEXT: ret
1211 %1 = alloca i8, align 4096
1212 call void @callee(ptr %1)
1216 define void @caller_no_realign4096() "no-realign-stack" {
1217 ; RV32I-LABEL: caller_no_realign4096:
1219 ; RV32I-NEXT: addi sp, sp, -16
1220 ; RV32I-NEXT: .cfi_def_cfa_offset 16
1221 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1222 ; RV32I-NEXT: .cfi_offset ra, -4
1223 ; RV32I-NEXT: mv a0, sp
1224 ; RV32I-NEXT: call callee
1225 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1226 ; RV32I-NEXT: addi sp, sp, 16
1229 ; RV32I-ILP32E-LABEL: caller_no_realign4096:
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: addi sp, sp, 8
1239 ; RV32I-ILP32E-NEXT: ret
1241 ; RV64I-LABEL: caller_no_realign4096:
1243 ; RV64I-NEXT: addi sp, sp, -16
1244 ; RV64I-NEXT: .cfi_def_cfa_offset 16
1245 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1246 ; RV64I-NEXT: .cfi_offset ra, -8
1247 ; RV64I-NEXT: mv a0, sp
1248 ; RV64I-NEXT: call callee
1249 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1250 ; RV64I-NEXT: addi sp, sp, 16
1253 ; RV64I-LP64E-LABEL: caller_no_realign4096:
1254 ; RV64I-LP64E: # %bb.0:
1255 ; RV64I-LP64E-NEXT: addi sp, sp, -16
1256 ; RV64I-LP64E-NEXT: .cfi_def_cfa_offset 16
1257 ; RV64I-LP64E-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1258 ; RV64I-LP64E-NEXT: .cfi_offset ra, -8
1259 ; RV64I-LP64E-NEXT: mv a0, sp
1260 ; RV64I-LP64E-NEXT: call callee
1261 ; RV64I-LP64E-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1262 ; RV64I-LP64E-NEXT: addi sp, sp, 16
1263 ; RV64I-LP64E-NEXT: ret
1264 %1 = alloca i8, align 4096
1265 call void @callee(ptr %1)