1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -verify-machineinstrs \
3 ; RUN: | FileCheck -check-prefix=ILP32-ILP32F-FPELIM %s
4 ; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -verify-machineinstrs -frame-pointer=all \
5 ; RUN: | FileCheck -check-prefix=ILP32-ILP32F-WITHFP %s
6 ; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+d -verify-machineinstrs \
7 ; RUN: | FileCheck -check-prefix=RV32D-ILP32-ILP32F-ILP32D-FPELIM %s
8 ; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+d -target-abi ilp32f \
9 ; RUN: -verify-machineinstrs \
10 ; RUN: | FileCheck -check-prefix=RV32D-ILP32-ILP32F-ILP32D-FPELIM %s
11 ; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+d -target-abi ilp32d \
12 ; RUN: -verify-machineinstrs \
13 ; RUN: | FileCheck -check-prefix=RV32D-ILP32-ILP32F-ILP32D-FPELIM %s
14 ; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -target-abi ilp32e \
15 ; RUN: -verify-machineinstrs \
16 ; RUN: | FileCheck -check-prefix=ILP32E-FPELIM %s
17 ; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -target-abi ilp32e -frame-pointer=all \
18 ; RUN: -verify-machineinstrs \
19 ; RUN: | FileCheck -check-prefix=ILP32E-WITHFP %s
20 ; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -verify-machineinstrs \
21 ; RUN: | FileCheck -check-prefix=LP64-LP64F-LP64D-FPELIM %s
22 ; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+d -target-abi lp64f \
23 ; RUN: -verify-machineinstrs \
24 ; RUN: | FileCheck -check-prefix=LP64-LP64F-LP64D-FPELIM %s
25 ; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+d -target-abi lp64d \
26 ; RUN: -verify-machineinstrs \
27 ; RUN: | FileCheck -check-prefix=LP64-LP64F-LP64D-FPELIM %s
28 ; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -verify-machineinstrs -frame-pointer=all \
29 ; RUN: | FileCheck -check-prefix=LP64-LP64F-LP64D-WITHFP %s
30 ; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -target-abi lp64e \
31 ; RUN: -verify-machineinstrs \
32 ; RUN: | FileCheck -check-prefix=LP64E-FPELIM %s
33 ; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -target-abi lp64e -frame-pointer=all \
34 ; RUN: -verify-machineinstrs \
35 ; RUN: | FileCheck -check-prefix=LP64E-WITHFP %s
37 ; The same vararg calling convention is used for ilp32/ilp32f/ilp32d and for
38 ; lp64/lp64f/lp64d. Different CHECK lines are required for RV32D due to slight
39 ; codegen differences due to the way the f64 load operations are lowered.
40 ; The nounwind attribute is omitted for some of the tests, to check that CFI
41 ; directives are correctly generated.
43 declare void @llvm.va_start(ptr)
44 declare void @llvm.va_end(ptr)
46 declare void @notdead(ptr)
48 ; Although frontends are recommended to not generate va_arg due to the lack of
49 ; support for aggregate types, we test simple cases here to ensure they are
52 define i32 @va1(ptr %fmt, ...) {
53 ; ILP32-ILP32F-FPELIM-LABEL: va1:
54 ; ILP32-ILP32F-FPELIM: # %bb.0:
55 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, -48
56 ; ILP32-ILP32F-FPELIM-NEXT: .cfi_def_cfa_offset 48
57 ; ILP32-ILP32F-FPELIM-NEXT: mv a0, a1
58 ; ILP32-ILP32F-FPELIM-NEXT: sw a5, 36(sp)
59 ; ILP32-ILP32F-FPELIM-NEXT: sw a6, 40(sp)
60 ; ILP32-ILP32F-FPELIM-NEXT: sw a7, 44(sp)
61 ; ILP32-ILP32F-FPELIM-NEXT: sw a1, 20(sp)
62 ; ILP32-ILP32F-FPELIM-NEXT: sw a2, 24(sp)
63 ; ILP32-ILP32F-FPELIM-NEXT: sw a3, 28(sp)
64 ; ILP32-ILP32F-FPELIM-NEXT: sw a4, 32(sp)
65 ; ILP32-ILP32F-FPELIM-NEXT: addi a1, sp, 24
66 ; ILP32-ILP32F-FPELIM-NEXT: sw a1, 12(sp)
67 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, 48
68 ; ILP32-ILP32F-FPELIM-NEXT: .cfi_def_cfa_offset 0
69 ; ILP32-ILP32F-FPELIM-NEXT: ret
71 ; ILP32-ILP32F-WITHFP-LABEL: va1:
72 ; ILP32-ILP32F-WITHFP: # %bb.0:
73 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, -48
74 ; ILP32-ILP32F-WITHFP-NEXT: .cfi_def_cfa_offset 48
75 ; ILP32-ILP32F-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
76 ; ILP32-ILP32F-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
77 ; ILP32-ILP32F-WITHFP-NEXT: .cfi_offset ra, -36
78 ; ILP32-ILP32F-WITHFP-NEXT: .cfi_offset s0, -40
79 ; ILP32-ILP32F-WITHFP-NEXT: addi s0, sp, 16
80 ; ILP32-ILP32F-WITHFP-NEXT: .cfi_def_cfa s0, 32
81 ; ILP32-ILP32F-WITHFP-NEXT: mv a0, a1
82 ; ILP32-ILP32F-WITHFP-NEXT: sw a5, 20(s0)
83 ; ILP32-ILP32F-WITHFP-NEXT: sw a6, 24(s0)
84 ; ILP32-ILP32F-WITHFP-NEXT: sw a7, 28(s0)
85 ; ILP32-ILP32F-WITHFP-NEXT: sw a1, 4(s0)
86 ; ILP32-ILP32F-WITHFP-NEXT: sw a2, 8(s0)
87 ; ILP32-ILP32F-WITHFP-NEXT: sw a3, 12(s0)
88 ; ILP32-ILP32F-WITHFP-NEXT: sw a4, 16(s0)
89 ; ILP32-ILP32F-WITHFP-NEXT: addi a1, s0, 8
90 ; ILP32-ILP32F-WITHFP-NEXT: sw a1, -12(s0)
91 ; ILP32-ILP32F-WITHFP-NEXT: .cfi_def_cfa sp, 48
92 ; ILP32-ILP32F-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
93 ; ILP32-ILP32F-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
94 ; ILP32-ILP32F-WITHFP-NEXT: .cfi_restore ra
95 ; ILP32-ILP32F-WITHFP-NEXT: .cfi_restore s0
96 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, 48
97 ; ILP32-ILP32F-WITHFP-NEXT: .cfi_def_cfa_offset 0
98 ; ILP32-ILP32F-WITHFP-NEXT: ret
100 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-LABEL: va1:
101 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM: # %bb.0:
102 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, -48
103 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: .cfi_def_cfa_offset 48
104 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: mv a0, a1
105 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a5, 36(sp)
106 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a6, 40(sp)
107 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a7, 44(sp)
108 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 20(sp)
109 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a2, 24(sp)
110 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a3, 28(sp)
111 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a4, 32(sp)
112 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a1, sp, 24
113 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 12(sp)
114 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, 48
115 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: .cfi_def_cfa_offset 0
116 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: ret
118 ; ILP32E-FPELIM-LABEL: va1:
119 ; ILP32E-FPELIM: # %bb.0:
120 ; ILP32E-FPELIM-NEXT: addi sp, sp, -28
121 ; ILP32E-FPELIM-NEXT: .cfi_def_cfa_offset 28
122 ; ILP32E-FPELIM-NEXT: mv a0, a1
123 ; ILP32E-FPELIM-NEXT: sw a5, 24(sp)
124 ; ILP32E-FPELIM-NEXT: sw a1, 8(sp)
125 ; ILP32E-FPELIM-NEXT: sw a2, 12(sp)
126 ; ILP32E-FPELIM-NEXT: sw a3, 16(sp)
127 ; ILP32E-FPELIM-NEXT: sw a4, 20(sp)
128 ; ILP32E-FPELIM-NEXT: addi a1, sp, 12
129 ; ILP32E-FPELIM-NEXT: sw a1, 0(sp)
130 ; ILP32E-FPELIM-NEXT: addi sp, sp, 28
131 ; ILP32E-FPELIM-NEXT: .cfi_def_cfa_offset 0
132 ; ILP32E-FPELIM-NEXT: ret
134 ; ILP32E-WITHFP-LABEL: va1:
135 ; ILP32E-WITHFP: # %bb.0:
136 ; ILP32E-WITHFP-NEXT: addi sp, sp, -36
137 ; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 36
138 ; ILP32E-WITHFP-NEXT: sw ra, 8(sp) # 4-byte Folded Spill
139 ; ILP32E-WITHFP-NEXT: sw s0, 4(sp) # 4-byte Folded Spill
140 ; ILP32E-WITHFP-NEXT: .cfi_offset ra, -28
141 ; ILP32E-WITHFP-NEXT: .cfi_offset s0, -32
142 ; ILP32E-WITHFP-NEXT: addi s0, sp, 12
143 ; ILP32E-WITHFP-NEXT: .cfi_def_cfa s0, 24
144 ; ILP32E-WITHFP-NEXT: mv a0, a1
145 ; ILP32E-WITHFP-NEXT: sw a5, 20(s0)
146 ; ILP32E-WITHFP-NEXT: sw a1, 4(s0)
147 ; ILP32E-WITHFP-NEXT: sw a2, 8(s0)
148 ; ILP32E-WITHFP-NEXT: sw a3, 12(s0)
149 ; ILP32E-WITHFP-NEXT: sw a4, 16(s0)
150 ; ILP32E-WITHFP-NEXT: addi a1, s0, 8
151 ; ILP32E-WITHFP-NEXT: sw a1, -12(s0)
152 ; ILP32E-WITHFP-NEXT: .cfi_def_cfa sp, 36
153 ; ILP32E-WITHFP-NEXT: lw ra, 8(sp) # 4-byte Folded Reload
154 ; ILP32E-WITHFP-NEXT: lw s0, 4(sp) # 4-byte Folded Reload
155 ; ILP32E-WITHFP-NEXT: .cfi_restore ra
156 ; ILP32E-WITHFP-NEXT: .cfi_restore s0
157 ; ILP32E-WITHFP-NEXT: addi sp, sp, 36
158 ; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 0
159 ; ILP32E-WITHFP-NEXT: ret
161 ; LP64-LP64F-LP64D-FPELIM-LABEL: va1:
162 ; LP64-LP64F-LP64D-FPELIM: # %bb.0:
163 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, -80
164 ; LP64-LP64F-LP64D-FPELIM-NEXT: .cfi_def_cfa_offset 80
165 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a1, 24(sp)
166 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a0, sp, 28
167 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a0, 8(sp)
168 ; LP64-LP64F-LP64D-FPELIM-NEXT: lw a0, 24(sp)
169 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a5, 56(sp)
170 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a6, 64(sp)
171 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a7, 72(sp)
172 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a2, 32(sp)
173 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a3, 40(sp)
174 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a4, 48(sp)
175 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, 80
176 ; LP64-LP64F-LP64D-FPELIM-NEXT: .cfi_def_cfa_offset 0
177 ; LP64-LP64F-LP64D-FPELIM-NEXT: ret
179 ; LP64-LP64F-LP64D-WITHFP-LABEL: va1:
180 ; LP64-LP64F-LP64D-WITHFP: # %bb.0:
181 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, -96
182 ; LP64-LP64F-LP64D-WITHFP-NEXT: .cfi_def_cfa_offset 96
183 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
184 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
185 ; LP64-LP64F-LP64D-WITHFP-NEXT: .cfi_offset ra, -72
186 ; LP64-LP64F-LP64D-WITHFP-NEXT: .cfi_offset s0, -80
187 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi s0, sp, 32
188 ; LP64-LP64F-LP64D-WITHFP-NEXT: .cfi_def_cfa s0, 64
189 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a1, 8(s0)
190 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a0, s0, 12
191 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a0, -24(s0)
192 ; LP64-LP64F-LP64D-WITHFP-NEXT: lw a0, 8(s0)
193 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a5, 40(s0)
194 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a6, 48(s0)
195 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a7, 56(s0)
196 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a2, 16(s0)
197 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a3, 24(s0)
198 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a4, 32(s0)
199 ; LP64-LP64F-LP64D-WITHFP-NEXT: .cfi_def_cfa sp, 96
200 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
201 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
202 ; LP64-LP64F-LP64D-WITHFP-NEXT: .cfi_restore ra
203 ; LP64-LP64F-LP64D-WITHFP-NEXT: .cfi_restore s0
204 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, 96
205 ; LP64-LP64F-LP64D-WITHFP-NEXT: .cfi_def_cfa_offset 0
206 ; LP64-LP64F-LP64D-WITHFP-NEXT: ret
208 ; LP64E-FPELIM-LABEL: va1:
209 ; LP64E-FPELIM: # %bb.0:
210 ; LP64E-FPELIM-NEXT: addi sp, sp, -56
211 ; LP64E-FPELIM-NEXT: .cfi_def_cfa_offset 56
212 ; LP64E-FPELIM-NEXT: addi a0, sp, 20
213 ; LP64E-FPELIM-NEXT: sd a0, 0(sp)
214 ; LP64E-FPELIM-NEXT: sd a1, 16(sp)
215 ; LP64E-FPELIM-NEXT: lw a0, 16(sp)
216 ; LP64E-FPELIM-NEXT: sd a5, 48(sp)
217 ; LP64E-FPELIM-NEXT: sd a2, 24(sp)
218 ; LP64E-FPELIM-NEXT: sd a3, 32(sp)
219 ; LP64E-FPELIM-NEXT: sd a4, 40(sp)
220 ; LP64E-FPELIM-NEXT: addi sp, sp, 56
221 ; LP64E-FPELIM-NEXT: .cfi_def_cfa_offset 0
222 ; LP64E-FPELIM-NEXT: ret
224 ; LP64E-WITHFP-LABEL: va1:
225 ; LP64E-WITHFP: # %bb.0:
226 ; LP64E-WITHFP-NEXT: addi sp, sp, -72
227 ; LP64E-WITHFP-NEXT: .cfi_def_cfa_offset 72
228 ; LP64E-WITHFP-NEXT: sd ra, 16(sp) # 8-byte Folded Spill
229 ; LP64E-WITHFP-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
230 ; LP64E-WITHFP-NEXT: .cfi_offset ra, -56
231 ; LP64E-WITHFP-NEXT: .cfi_offset s0, -64
232 ; LP64E-WITHFP-NEXT: addi s0, sp, 24
233 ; LP64E-WITHFP-NEXT: .cfi_def_cfa s0, 48
234 ; LP64E-WITHFP-NEXT: addi a0, s0, 12
235 ; LP64E-WITHFP-NEXT: sd a0, -24(s0)
236 ; LP64E-WITHFP-NEXT: sd a1, 8(s0)
237 ; LP64E-WITHFP-NEXT: lw a0, 8(s0)
238 ; LP64E-WITHFP-NEXT: sd a5, 40(s0)
239 ; LP64E-WITHFP-NEXT: sd a2, 16(s0)
240 ; LP64E-WITHFP-NEXT: sd a3, 24(s0)
241 ; LP64E-WITHFP-NEXT: sd a4, 32(s0)
242 ; LP64E-WITHFP-NEXT: .cfi_def_cfa sp, 72
243 ; LP64E-WITHFP-NEXT: ld ra, 16(sp) # 8-byte Folded Reload
244 ; LP64E-WITHFP-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
245 ; LP64E-WITHFP-NEXT: .cfi_restore ra
246 ; LP64E-WITHFP-NEXT: .cfi_restore s0
247 ; LP64E-WITHFP-NEXT: addi sp, sp, 72
248 ; LP64E-WITHFP-NEXT: .cfi_def_cfa_offset 0
249 ; LP64E-WITHFP-NEXT: ret
251 call void @llvm.va_start(ptr %va)
252 %argp.cur = load ptr, ptr %va, align 4
253 %argp.next = getelementptr inbounds i8, ptr %argp.cur, i32 4
254 store ptr %argp.next, ptr %va, align 4
255 %1 = load i32, ptr %argp.cur, align 4
256 call void @llvm.va_end(ptr %va)
260 define i32 @va1_va_arg(ptr %fmt, ...) nounwind {
261 ; ILP32-ILP32F-FPELIM-LABEL: va1_va_arg:
262 ; ILP32-ILP32F-FPELIM: # %bb.0:
263 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, -48
264 ; ILP32-ILP32F-FPELIM-NEXT: mv a0, a1
265 ; ILP32-ILP32F-FPELIM-NEXT: sw a5, 36(sp)
266 ; ILP32-ILP32F-FPELIM-NEXT: sw a6, 40(sp)
267 ; ILP32-ILP32F-FPELIM-NEXT: sw a7, 44(sp)
268 ; ILP32-ILP32F-FPELIM-NEXT: sw a1, 20(sp)
269 ; ILP32-ILP32F-FPELIM-NEXT: sw a2, 24(sp)
270 ; ILP32-ILP32F-FPELIM-NEXT: sw a3, 28(sp)
271 ; ILP32-ILP32F-FPELIM-NEXT: sw a4, 32(sp)
272 ; ILP32-ILP32F-FPELIM-NEXT: addi a1, sp, 24
273 ; ILP32-ILP32F-FPELIM-NEXT: sw a1, 12(sp)
274 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, 48
275 ; ILP32-ILP32F-FPELIM-NEXT: ret
277 ; ILP32-ILP32F-WITHFP-LABEL: va1_va_arg:
278 ; ILP32-ILP32F-WITHFP: # %bb.0:
279 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, -48
280 ; ILP32-ILP32F-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
281 ; ILP32-ILP32F-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
282 ; ILP32-ILP32F-WITHFP-NEXT: addi s0, sp, 16
283 ; ILP32-ILP32F-WITHFP-NEXT: mv a0, a1
284 ; ILP32-ILP32F-WITHFP-NEXT: sw a5, 20(s0)
285 ; ILP32-ILP32F-WITHFP-NEXT: sw a6, 24(s0)
286 ; ILP32-ILP32F-WITHFP-NEXT: sw a7, 28(s0)
287 ; ILP32-ILP32F-WITHFP-NEXT: sw a1, 4(s0)
288 ; ILP32-ILP32F-WITHFP-NEXT: sw a2, 8(s0)
289 ; ILP32-ILP32F-WITHFP-NEXT: sw a3, 12(s0)
290 ; ILP32-ILP32F-WITHFP-NEXT: sw a4, 16(s0)
291 ; ILP32-ILP32F-WITHFP-NEXT: addi a1, s0, 8
292 ; ILP32-ILP32F-WITHFP-NEXT: sw a1, -12(s0)
293 ; ILP32-ILP32F-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
294 ; ILP32-ILP32F-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
295 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, 48
296 ; ILP32-ILP32F-WITHFP-NEXT: ret
298 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-LABEL: va1_va_arg:
299 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM: # %bb.0:
300 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, -48
301 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: mv a0, a1
302 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a5, 36(sp)
303 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a6, 40(sp)
304 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a7, 44(sp)
305 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 20(sp)
306 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a2, 24(sp)
307 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a3, 28(sp)
308 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a4, 32(sp)
309 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a1, sp, 24
310 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 12(sp)
311 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, 48
312 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: ret
314 ; ILP32E-FPELIM-LABEL: va1_va_arg:
315 ; ILP32E-FPELIM: # %bb.0:
316 ; ILP32E-FPELIM-NEXT: addi sp, sp, -28
317 ; ILP32E-FPELIM-NEXT: mv a0, a1
318 ; ILP32E-FPELIM-NEXT: sw a5, 24(sp)
319 ; ILP32E-FPELIM-NEXT: sw a1, 8(sp)
320 ; ILP32E-FPELIM-NEXT: sw a2, 12(sp)
321 ; ILP32E-FPELIM-NEXT: sw a3, 16(sp)
322 ; ILP32E-FPELIM-NEXT: sw a4, 20(sp)
323 ; ILP32E-FPELIM-NEXT: addi a1, sp, 12
324 ; ILP32E-FPELIM-NEXT: sw a1, 0(sp)
325 ; ILP32E-FPELIM-NEXT: addi sp, sp, 28
326 ; ILP32E-FPELIM-NEXT: ret
328 ; ILP32E-WITHFP-LABEL: va1_va_arg:
329 ; ILP32E-WITHFP: # %bb.0:
330 ; ILP32E-WITHFP-NEXT: addi sp, sp, -36
331 ; ILP32E-WITHFP-NEXT: sw ra, 8(sp) # 4-byte Folded Spill
332 ; ILP32E-WITHFP-NEXT: sw s0, 4(sp) # 4-byte Folded Spill
333 ; ILP32E-WITHFP-NEXT: addi s0, sp, 12
334 ; ILP32E-WITHFP-NEXT: mv a0, a1
335 ; ILP32E-WITHFP-NEXT: sw a5, 20(s0)
336 ; ILP32E-WITHFP-NEXT: sw a1, 4(s0)
337 ; ILP32E-WITHFP-NEXT: sw a2, 8(s0)
338 ; ILP32E-WITHFP-NEXT: sw a3, 12(s0)
339 ; ILP32E-WITHFP-NEXT: sw a4, 16(s0)
340 ; ILP32E-WITHFP-NEXT: addi a1, s0, 8
341 ; ILP32E-WITHFP-NEXT: sw a1, -12(s0)
342 ; ILP32E-WITHFP-NEXT: lw ra, 8(sp) # 4-byte Folded Reload
343 ; ILP32E-WITHFP-NEXT: lw s0, 4(sp) # 4-byte Folded Reload
344 ; ILP32E-WITHFP-NEXT: addi sp, sp, 36
345 ; ILP32E-WITHFP-NEXT: ret
347 ; LP64-LP64F-LP64D-FPELIM-LABEL: va1_va_arg:
348 ; LP64-LP64F-LP64D-FPELIM: # %bb.0:
349 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, -80
350 ; LP64-LP64F-LP64D-FPELIM-NEXT: mv a0, a1
351 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a5, 56(sp)
352 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a6, 64(sp)
353 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a7, 72(sp)
354 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a1, 24(sp)
355 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a2, 32(sp)
356 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a3, 40(sp)
357 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a4, 48(sp)
358 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a1, sp, 32
359 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a1, 8(sp)
360 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, 80
361 ; LP64-LP64F-LP64D-FPELIM-NEXT: ret
363 ; LP64-LP64F-LP64D-WITHFP-LABEL: va1_va_arg:
364 ; LP64-LP64F-LP64D-WITHFP: # %bb.0:
365 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, -96
366 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
367 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
368 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi s0, sp, 32
369 ; LP64-LP64F-LP64D-WITHFP-NEXT: mv a0, a1
370 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a5, 40(s0)
371 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a6, 48(s0)
372 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a7, 56(s0)
373 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a1, 8(s0)
374 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a2, 16(s0)
375 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a3, 24(s0)
376 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a4, 32(s0)
377 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a1, s0, 16
378 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a1, -24(s0)
379 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
380 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
381 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, 96
382 ; LP64-LP64F-LP64D-WITHFP-NEXT: ret
384 ; LP64E-FPELIM-LABEL: va1_va_arg:
385 ; LP64E-FPELIM: # %bb.0:
386 ; LP64E-FPELIM-NEXT: addi sp, sp, -56
387 ; LP64E-FPELIM-NEXT: mv a0, a1
388 ; LP64E-FPELIM-NEXT: sd a5, 48(sp)
389 ; LP64E-FPELIM-NEXT: sd a1, 16(sp)
390 ; LP64E-FPELIM-NEXT: sd a2, 24(sp)
391 ; LP64E-FPELIM-NEXT: sd a3, 32(sp)
392 ; LP64E-FPELIM-NEXT: sd a4, 40(sp)
393 ; LP64E-FPELIM-NEXT: addi a1, sp, 24
394 ; LP64E-FPELIM-NEXT: sd a1, 0(sp)
395 ; LP64E-FPELIM-NEXT: addi sp, sp, 56
396 ; LP64E-FPELIM-NEXT: ret
398 ; LP64E-WITHFP-LABEL: va1_va_arg:
399 ; LP64E-WITHFP: # %bb.0:
400 ; LP64E-WITHFP-NEXT: addi sp, sp, -72
401 ; LP64E-WITHFP-NEXT: sd ra, 16(sp) # 8-byte Folded Spill
402 ; LP64E-WITHFP-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
403 ; LP64E-WITHFP-NEXT: addi s0, sp, 24
404 ; LP64E-WITHFP-NEXT: mv a0, a1
405 ; LP64E-WITHFP-NEXT: sd a5, 40(s0)
406 ; LP64E-WITHFP-NEXT: sd a1, 8(s0)
407 ; LP64E-WITHFP-NEXT: sd a2, 16(s0)
408 ; LP64E-WITHFP-NEXT: sd a3, 24(s0)
409 ; LP64E-WITHFP-NEXT: sd a4, 32(s0)
410 ; LP64E-WITHFP-NEXT: addi a1, s0, 16
411 ; LP64E-WITHFP-NEXT: sd a1, -24(s0)
412 ; LP64E-WITHFP-NEXT: ld ra, 16(sp) # 8-byte Folded Reload
413 ; LP64E-WITHFP-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
414 ; LP64E-WITHFP-NEXT: addi sp, sp, 72
415 ; LP64E-WITHFP-NEXT: ret
417 call void @llvm.va_start(ptr %va)
418 %1 = va_arg ptr %va, i32
419 call void @llvm.va_end(ptr %va)
423 ; Ensure the adjustment when restoring the stack pointer using the frame
425 define i32 @va1_va_arg_alloca(ptr %fmt, ...) nounwind {
426 ; ILP32-ILP32F-FPELIM-LABEL: va1_va_arg_alloca:
427 ; ILP32-ILP32F-FPELIM: # %bb.0:
428 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, -48
429 ; ILP32-ILP32F-FPELIM-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
430 ; ILP32-ILP32F-FPELIM-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
431 ; ILP32-ILP32F-FPELIM-NEXT: sw s1, 4(sp) # 4-byte Folded Spill
432 ; ILP32-ILP32F-FPELIM-NEXT: addi s0, sp, 16
433 ; ILP32-ILP32F-FPELIM-NEXT: mv s1, a1
434 ; ILP32-ILP32F-FPELIM-NEXT: sw a5, 20(s0)
435 ; ILP32-ILP32F-FPELIM-NEXT: sw a6, 24(s0)
436 ; ILP32-ILP32F-FPELIM-NEXT: sw a7, 28(s0)
437 ; ILP32-ILP32F-FPELIM-NEXT: sw a1, 4(s0)
438 ; ILP32-ILP32F-FPELIM-NEXT: sw a2, 8(s0)
439 ; ILP32-ILP32F-FPELIM-NEXT: sw a3, 12(s0)
440 ; ILP32-ILP32F-FPELIM-NEXT: sw a4, 16(s0)
441 ; ILP32-ILP32F-FPELIM-NEXT: addi a0, s0, 8
442 ; ILP32-ILP32F-FPELIM-NEXT: sw a0, -16(s0)
443 ; ILP32-ILP32F-FPELIM-NEXT: addi a0, a1, 15
444 ; ILP32-ILP32F-FPELIM-NEXT: andi a0, a0, -16
445 ; ILP32-ILP32F-FPELIM-NEXT: sub a0, sp, a0
446 ; ILP32-ILP32F-FPELIM-NEXT: mv sp, a0
447 ; ILP32-ILP32F-FPELIM-NEXT: call notdead
448 ; ILP32-ILP32F-FPELIM-NEXT: mv a0, s1
449 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, s0, -16
450 ; ILP32-ILP32F-FPELIM-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
451 ; ILP32-ILP32F-FPELIM-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
452 ; ILP32-ILP32F-FPELIM-NEXT: lw s1, 4(sp) # 4-byte Folded Reload
453 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, 48
454 ; ILP32-ILP32F-FPELIM-NEXT: ret
456 ; ILP32-ILP32F-WITHFP-LABEL: va1_va_arg_alloca:
457 ; ILP32-ILP32F-WITHFP: # %bb.0:
458 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, -48
459 ; ILP32-ILP32F-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
460 ; ILP32-ILP32F-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
461 ; ILP32-ILP32F-WITHFP-NEXT: sw s1, 4(sp) # 4-byte Folded Spill
462 ; ILP32-ILP32F-WITHFP-NEXT: addi s0, sp, 16
463 ; ILP32-ILP32F-WITHFP-NEXT: mv s1, a1
464 ; ILP32-ILP32F-WITHFP-NEXT: sw a5, 20(s0)
465 ; ILP32-ILP32F-WITHFP-NEXT: sw a6, 24(s0)
466 ; ILP32-ILP32F-WITHFP-NEXT: sw a7, 28(s0)
467 ; ILP32-ILP32F-WITHFP-NEXT: sw a1, 4(s0)
468 ; ILP32-ILP32F-WITHFP-NEXT: sw a2, 8(s0)
469 ; ILP32-ILP32F-WITHFP-NEXT: sw a3, 12(s0)
470 ; ILP32-ILP32F-WITHFP-NEXT: sw a4, 16(s0)
471 ; ILP32-ILP32F-WITHFP-NEXT: addi a0, s0, 8
472 ; ILP32-ILP32F-WITHFP-NEXT: sw a0, -16(s0)
473 ; ILP32-ILP32F-WITHFP-NEXT: addi a0, a1, 15
474 ; ILP32-ILP32F-WITHFP-NEXT: andi a0, a0, -16
475 ; ILP32-ILP32F-WITHFP-NEXT: sub a0, sp, a0
476 ; ILP32-ILP32F-WITHFP-NEXT: mv sp, a0
477 ; ILP32-ILP32F-WITHFP-NEXT: call notdead
478 ; ILP32-ILP32F-WITHFP-NEXT: mv a0, s1
479 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, s0, -16
480 ; ILP32-ILP32F-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
481 ; ILP32-ILP32F-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
482 ; ILP32-ILP32F-WITHFP-NEXT: lw s1, 4(sp) # 4-byte Folded Reload
483 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, 48
484 ; ILP32-ILP32F-WITHFP-NEXT: ret
486 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-LABEL: va1_va_arg_alloca:
487 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM: # %bb.0:
488 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, -48
489 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
490 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
491 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw s1, 4(sp) # 4-byte Folded Spill
492 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi s0, sp, 16
493 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: mv s1, a1
494 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a5, 20(s0)
495 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a6, 24(s0)
496 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a7, 28(s0)
497 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 4(s0)
498 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a2, 8(s0)
499 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a3, 12(s0)
500 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a4, 16(s0)
501 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a0, s0, 8
502 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a0, -16(s0)
503 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a0, a1, 15
504 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: andi a0, a0, -16
505 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sub a0, sp, a0
506 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: mv sp, a0
507 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: call notdead
508 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: mv a0, s1
509 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, s0, -16
510 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
511 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
512 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw s1, 4(sp) # 4-byte Folded Reload
513 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, 48
514 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: ret
516 ; ILP32E-FPELIM-LABEL: va1_va_arg_alloca:
517 ; ILP32E-FPELIM: # %bb.0:
518 ; ILP32E-FPELIM-NEXT: addi sp, sp, -40
519 ; ILP32E-FPELIM-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
520 ; ILP32E-FPELIM-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
521 ; ILP32E-FPELIM-NEXT: sw s1, 4(sp) # 4-byte Folded Spill
522 ; ILP32E-FPELIM-NEXT: addi s0, sp, 16
523 ; ILP32E-FPELIM-NEXT: mv s1, a1
524 ; ILP32E-FPELIM-NEXT: sw a5, 20(s0)
525 ; ILP32E-FPELIM-NEXT: sw a1, 4(s0)
526 ; ILP32E-FPELIM-NEXT: sw a2, 8(s0)
527 ; ILP32E-FPELIM-NEXT: sw a3, 12(s0)
528 ; ILP32E-FPELIM-NEXT: sw a4, 16(s0)
529 ; ILP32E-FPELIM-NEXT: addi a0, s0, 8
530 ; ILP32E-FPELIM-NEXT: sw a0, -16(s0)
531 ; ILP32E-FPELIM-NEXT: addi a0, a1, 3
532 ; ILP32E-FPELIM-NEXT: andi a0, a0, -4
533 ; ILP32E-FPELIM-NEXT: sub a0, sp, a0
534 ; ILP32E-FPELIM-NEXT: mv sp, a0
535 ; ILP32E-FPELIM-NEXT: call notdead
536 ; ILP32E-FPELIM-NEXT: mv a0, s1
537 ; ILP32E-FPELIM-NEXT: addi sp, s0, -16
538 ; ILP32E-FPELIM-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
539 ; ILP32E-FPELIM-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
540 ; ILP32E-FPELIM-NEXT: lw s1, 4(sp) # 4-byte Folded Reload
541 ; ILP32E-FPELIM-NEXT: addi sp, sp, 40
542 ; ILP32E-FPELIM-NEXT: ret
544 ; ILP32E-WITHFP-LABEL: va1_va_arg_alloca:
545 ; ILP32E-WITHFP: # %bb.0:
546 ; ILP32E-WITHFP-NEXT: addi sp, sp, -40
547 ; ILP32E-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
548 ; ILP32E-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
549 ; ILP32E-WITHFP-NEXT: sw s1, 4(sp) # 4-byte Folded Spill
550 ; ILP32E-WITHFP-NEXT: addi s0, sp, 16
551 ; ILP32E-WITHFP-NEXT: mv s1, a1
552 ; ILP32E-WITHFP-NEXT: sw a5, 20(s0)
553 ; ILP32E-WITHFP-NEXT: sw a1, 4(s0)
554 ; ILP32E-WITHFP-NEXT: sw a2, 8(s0)
555 ; ILP32E-WITHFP-NEXT: sw a3, 12(s0)
556 ; ILP32E-WITHFP-NEXT: sw a4, 16(s0)
557 ; ILP32E-WITHFP-NEXT: addi a0, s0, 8
558 ; ILP32E-WITHFP-NEXT: sw a0, -16(s0)
559 ; ILP32E-WITHFP-NEXT: addi a0, a1, 3
560 ; ILP32E-WITHFP-NEXT: andi a0, a0, -4
561 ; ILP32E-WITHFP-NEXT: sub a0, sp, a0
562 ; ILP32E-WITHFP-NEXT: mv sp, a0
563 ; ILP32E-WITHFP-NEXT: call notdead
564 ; ILP32E-WITHFP-NEXT: mv a0, s1
565 ; ILP32E-WITHFP-NEXT: addi sp, s0, -16
566 ; ILP32E-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
567 ; ILP32E-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
568 ; ILP32E-WITHFP-NEXT: lw s1, 4(sp) # 4-byte Folded Reload
569 ; ILP32E-WITHFP-NEXT: addi sp, sp, 40
570 ; ILP32E-WITHFP-NEXT: ret
572 ; LP64-LP64F-LP64D-FPELIM-LABEL: va1_va_arg_alloca:
573 ; LP64-LP64F-LP64D-FPELIM: # %bb.0:
574 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, -96
575 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
576 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
577 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd s1, 8(sp) # 8-byte Folded Spill
578 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi s0, sp, 32
579 ; LP64-LP64F-LP64D-FPELIM-NEXT: mv s1, a1
580 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a5, 40(s0)
581 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a6, 48(s0)
582 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a7, 56(s0)
583 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a1, 8(s0)
584 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a2, 16(s0)
585 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a3, 24(s0)
586 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a4, 32(s0)
587 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a0, s0, 16
588 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a0, -32(s0)
589 ; LP64-LP64F-LP64D-FPELIM-NEXT: slli a0, a1, 32
590 ; LP64-LP64F-LP64D-FPELIM-NEXT: srli a0, a0, 32
591 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a0, a0, 15
592 ; LP64-LP64F-LP64D-FPELIM-NEXT: andi a0, a0, -16
593 ; LP64-LP64F-LP64D-FPELIM-NEXT: sub a0, sp, a0
594 ; LP64-LP64F-LP64D-FPELIM-NEXT: mv sp, a0
595 ; LP64-LP64F-LP64D-FPELIM-NEXT: call notdead
596 ; LP64-LP64F-LP64D-FPELIM-NEXT: mv a0, s1
597 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, s0, -32
598 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
599 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
600 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld s1, 8(sp) # 8-byte Folded Reload
601 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, 96
602 ; LP64-LP64F-LP64D-FPELIM-NEXT: ret
604 ; LP64-LP64F-LP64D-WITHFP-LABEL: va1_va_arg_alloca:
605 ; LP64-LP64F-LP64D-WITHFP: # %bb.0:
606 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, -96
607 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
608 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
609 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s1, 8(sp) # 8-byte Folded Spill
610 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi s0, sp, 32
611 ; LP64-LP64F-LP64D-WITHFP-NEXT: mv s1, a1
612 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a5, 40(s0)
613 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a6, 48(s0)
614 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a7, 56(s0)
615 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a1, 8(s0)
616 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a2, 16(s0)
617 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a3, 24(s0)
618 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a4, 32(s0)
619 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a0, s0, 16
620 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a0, -32(s0)
621 ; LP64-LP64F-LP64D-WITHFP-NEXT: slli a0, a1, 32
622 ; LP64-LP64F-LP64D-WITHFP-NEXT: srli a0, a0, 32
623 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a0, a0, 15
624 ; LP64-LP64F-LP64D-WITHFP-NEXT: andi a0, a0, -16
625 ; LP64-LP64F-LP64D-WITHFP-NEXT: sub a0, sp, a0
626 ; LP64-LP64F-LP64D-WITHFP-NEXT: mv sp, a0
627 ; LP64-LP64F-LP64D-WITHFP-NEXT: call notdead
628 ; LP64-LP64F-LP64D-WITHFP-NEXT: mv a0, s1
629 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, s0, -32
630 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
631 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
632 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s1, 8(sp) # 8-byte Folded Reload
633 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, 96
634 ; LP64-LP64F-LP64D-WITHFP-NEXT: ret
636 ; LP64E-FPELIM-LABEL: va1_va_arg_alloca:
637 ; LP64E-FPELIM: # %bb.0:
638 ; LP64E-FPELIM-NEXT: addi sp, sp, -80
639 ; LP64E-FPELIM-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
640 ; LP64E-FPELIM-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
641 ; LP64E-FPELIM-NEXT: sd s1, 8(sp) # 8-byte Folded Spill
642 ; LP64E-FPELIM-NEXT: addi s0, sp, 32
643 ; LP64E-FPELIM-NEXT: mv s1, a1
644 ; LP64E-FPELIM-NEXT: sd a5, 40(s0)
645 ; LP64E-FPELIM-NEXT: sd a1, 8(s0)
646 ; LP64E-FPELIM-NEXT: sd a2, 16(s0)
647 ; LP64E-FPELIM-NEXT: sd a3, 24(s0)
648 ; LP64E-FPELIM-NEXT: sd a4, 32(s0)
649 ; LP64E-FPELIM-NEXT: addi a0, s0, 16
650 ; LP64E-FPELIM-NEXT: sd a0, -32(s0)
651 ; LP64E-FPELIM-NEXT: slli a0, a1, 32
652 ; LP64E-FPELIM-NEXT: srli a0, a0, 32
653 ; LP64E-FPELIM-NEXT: addi a0, a0, 7
654 ; LP64E-FPELIM-NEXT: andi a0, a0, -8
655 ; LP64E-FPELIM-NEXT: sub a0, sp, a0
656 ; LP64E-FPELIM-NEXT: mv sp, a0
657 ; LP64E-FPELIM-NEXT: call notdead
658 ; LP64E-FPELIM-NEXT: mv a0, s1
659 ; LP64E-FPELIM-NEXT: addi sp, s0, -32
660 ; LP64E-FPELIM-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
661 ; LP64E-FPELIM-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
662 ; LP64E-FPELIM-NEXT: ld s1, 8(sp) # 8-byte Folded Reload
663 ; LP64E-FPELIM-NEXT: addi sp, sp, 80
664 ; LP64E-FPELIM-NEXT: ret
666 ; LP64E-WITHFP-LABEL: va1_va_arg_alloca:
667 ; LP64E-WITHFP: # %bb.0:
668 ; LP64E-WITHFP-NEXT: addi sp, sp, -80
669 ; LP64E-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
670 ; LP64E-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
671 ; LP64E-WITHFP-NEXT: sd s1, 8(sp) # 8-byte Folded Spill
672 ; LP64E-WITHFP-NEXT: addi s0, sp, 32
673 ; LP64E-WITHFP-NEXT: mv s1, a1
674 ; LP64E-WITHFP-NEXT: sd a5, 40(s0)
675 ; LP64E-WITHFP-NEXT: sd a1, 8(s0)
676 ; LP64E-WITHFP-NEXT: sd a2, 16(s0)
677 ; LP64E-WITHFP-NEXT: sd a3, 24(s0)
678 ; LP64E-WITHFP-NEXT: sd a4, 32(s0)
679 ; LP64E-WITHFP-NEXT: addi a0, s0, 16
680 ; LP64E-WITHFP-NEXT: sd a0, -32(s0)
681 ; LP64E-WITHFP-NEXT: slli a0, a1, 32
682 ; LP64E-WITHFP-NEXT: srli a0, a0, 32
683 ; LP64E-WITHFP-NEXT: addi a0, a0, 7
684 ; LP64E-WITHFP-NEXT: andi a0, a0, -8
685 ; LP64E-WITHFP-NEXT: sub a0, sp, a0
686 ; LP64E-WITHFP-NEXT: mv sp, a0
687 ; LP64E-WITHFP-NEXT: call notdead
688 ; LP64E-WITHFP-NEXT: mv a0, s1
689 ; LP64E-WITHFP-NEXT: addi sp, s0, -32
690 ; LP64E-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
691 ; LP64E-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
692 ; LP64E-WITHFP-NEXT: ld s1, 8(sp) # 8-byte Folded Reload
693 ; LP64E-WITHFP-NEXT: addi sp, sp, 80
694 ; LP64E-WITHFP-NEXT: ret
696 call void @llvm.va_start(ptr %va)
697 %1 = va_arg ptr %va, i32
698 %2 = alloca i8, i32 %1
699 call void @notdead(ptr %2)
700 call void @llvm.va_end(ptr %va)
704 define void @va1_caller() nounwind {
705 ; Pass a double, as a float would be promoted by a C/C++ frontend
706 ; ILP32-ILP32F-FPELIM-LABEL: va1_caller:
707 ; ILP32-ILP32F-FPELIM: # %bb.0:
708 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, -16
709 ; ILP32-ILP32F-FPELIM-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
710 ; ILP32-ILP32F-FPELIM-NEXT: lui a3, 261888
711 ; ILP32-ILP32F-FPELIM-NEXT: li a4, 2
712 ; ILP32-ILP32F-FPELIM-NEXT: li a2, 0
713 ; ILP32-ILP32F-FPELIM-NEXT: call va1
714 ; ILP32-ILP32F-FPELIM-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
715 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, 16
716 ; ILP32-ILP32F-FPELIM-NEXT: ret
718 ; ILP32-ILP32F-WITHFP-LABEL: va1_caller:
719 ; ILP32-ILP32F-WITHFP: # %bb.0:
720 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, -16
721 ; ILP32-ILP32F-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
722 ; ILP32-ILP32F-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
723 ; ILP32-ILP32F-WITHFP-NEXT: addi s0, sp, 16
724 ; ILP32-ILP32F-WITHFP-NEXT: lui a3, 261888
725 ; ILP32-ILP32F-WITHFP-NEXT: li a4, 2
726 ; ILP32-ILP32F-WITHFP-NEXT: li a2, 0
727 ; ILP32-ILP32F-WITHFP-NEXT: call va1
728 ; ILP32-ILP32F-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
729 ; ILP32-ILP32F-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
730 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, 16
731 ; ILP32-ILP32F-WITHFP-NEXT: ret
733 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-LABEL: va1_caller:
734 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM: # %bb.0:
735 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, -16
736 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
737 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a3, 261888
738 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a4, 2
739 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a2, 0
740 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: call va1
741 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
742 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, 16
743 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: ret
745 ; ILP32E-FPELIM-LABEL: va1_caller:
746 ; ILP32E-FPELIM: # %bb.0:
747 ; ILP32E-FPELIM-NEXT: addi sp, sp, -4
748 ; ILP32E-FPELIM-NEXT: sw ra, 0(sp) # 4-byte Folded Spill
749 ; ILP32E-FPELIM-NEXT: lui a2, 261888
750 ; ILP32E-FPELIM-NEXT: li a3, 2
751 ; ILP32E-FPELIM-NEXT: li a1, 0
752 ; ILP32E-FPELIM-NEXT: call va1
753 ; ILP32E-FPELIM-NEXT: lw ra, 0(sp) # 4-byte Folded Reload
754 ; ILP32E-FPELIM-NEXT: addi sp, sp, 4
755 ; ILP32E-FPELIM-NEXT: ret
757 ; ILP32E-WITHFP-LABEL: va1_caller:
758 ; ILP32E-WITHFP: # %bb.0:
759 ; ILP32E-WITHFP-NEXT: addi sp, sp, -8
760 ; ILP32E-WITHFP-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
761 ; ILP32E-WITHFP-NEXT: sw s0, 0(sp) # 4-byte Folded Spill
762 ; ILP32E-WITHFP-NEXT: addi s0, sp, 8
763 ; ILP32E-WITHFP-NEXT: lui a2, 261888
764 ; ILP32E-WITHFP-NEXT: li a3, 2
765 ; ILP32E-WITHFP-NEXT: li a1, 0
766 ; ILP32E-WITHFP-NEXT: call va1
767 ; ILP32E-WITHFP-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
768 ; ILP32E-WITHFP-NEXT: lw s0, 0(sp) # 4-byte Folded Reload
769 ; ILP32E-WITHFP-NEXT: addi sp, sp, 8
770 ; ILP32E-WITHFP-NEXT: ret
772 ; LP64-LP64F-LP64D-FPELIM-LABEL: va1_caller:
773 ; LP64-LP64F-LP64D-FPELIM: # %bb.0:
774 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, -16
775 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
776 ; LP64-LP64F-LP64D-FPELIM-NEXT: li a1, 1023
777 ; LP64-LP64F-LP64D-FPELIM-NEXT: slli a1, a1, 52
778 ; LP64-LP64F-LP64D-FPELIM-NEXT: li a2, 2
779 ; LP64-LP64F-LP64D-FPELIM-NEXT: call va1
780 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
781 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, 16
782 ; LP64-LP64F-LP64D-FPELIM-NEXT: ret
784 ; LP64-LP64F-LP64D-WITHFP-LABEL: va1_caller:
785 ; LP64-LP64F-LP64D-WITHFP: # %bb.0:
786 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, -16
787 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
788 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s0, 0(sp) # 8-byte Folded Spill
789 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi s0, sp, 16
790 ; LP64-LP64F-LP64D-WITHFP-NEXT: li a1, 1023
791 ; LP64-LP64F-LP64D-WITHFP-NEXT: slli a1, a1, 52
792 ; LP64-LP64F-LP64D-WITHFP-NEXT: li a2, 2
793 ; LP64-LP64F-LP64D-WITHFP-NEXT: call va1
794 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
795 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s0, 0(sp) # 8-byte Folded Reload
796 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, 16
797 ; LP64-LP64F-LP64D-WITHFP-NEXT: ret
799 ; LP64E-FPELIM-LABEL: va1_caller:
800 ; LP64E-FPELIM: # %bb.0:
801 ; LP64E-FPELIM-NEXT: addi sp, sp, -8
802 ; LP64E-FPELIM-NEXT: sd ra, 0(sp) # 8-byte Folded Spill
803 ; LP64E-FPELIM-NEXT: li a1, 1023
804 ; LP64E-FPELIM-NEXT: slli a1, a1, 52
805 ; LP64E-FPELIM-NEXT: li a2, 2
806 ; LP64E-FPELIM-NEXT: call va1
807 ; LP64E-FPELIM-NEXT: ld ra, 0(sp) # 8-byte Folded Reload
808 ; LP64E-FPELIM-NEXT: addi sp, sp, 8
809 ; LP64E-FPELIM-NEXT: ret
811 ; LP64E-WITHFP-LABEL: va1_caller:
812 ; LP64E-WITHFP: # %bb.0:
813 ; LP64E-WITHFP-NEXT: addi sp, sp, -16
814 ; LP64E-WITHFP-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
815 ; LP64E-WITHFP-NEXT: sd s0, 0(sp) # 8-byte Folded Spill
816 ; LP64E-WITHFP-NEXT: addi s0, sp, 16
817 ; LP64E-WITHFP-NEXT: li a1, 1023
818 ; LP64E-WITHFP-NEXT: slli a1, a1, 52
819 ; LP64E-WITHFP-NEXT: li a2, 2
820 ; LP64E-WITHFP-NEXT: call va1
821 ; LP64E-WITHFP-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
822 ; LP64E-WITHFP-NEXT: ld s0, 0(sp) # 8-byte Folded Reload
823 ; LP64E-WITHFP-NEXT: addi sp, sp, 16
824 ; LP64E-WITHFP-NEXT: ret
825 %1 = call i32 (ptr, ...) @va1(ptr undef, double 1.0, i32 2)
829 ; Ensure that 2x xlen size+alignment varargs are accessed via an "aligned"
830 ; register pair (where the first register is even-numbered).
832 define i64 @va2(ptr %fmt, ...) nounwind {
833 ; ILP32-ILP32F-FPELIM-LABEL: va2:
834 ; ILP32-ILP32F-FPELIM: # %bb.0:
835 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, -48
836 ; ILP32-ILP32F-FPELIM-NEXT: sw a5, 36(sp)
837 ; ILP32-ILP32F-FPELIM-NEXT: sw a6, 40(sp)
838 ; ILP32-ILP32F-FPELIM-NEXT: sw a7, 44(sp)
839 ; ILP32-ILP32F-FPELIM-NEXT: sw a1, 20(sp)
840 ; ILP32-ILP32F-FPELIM-NEXT: sw a2, 24(sp)
841 ; ILP32-ILP32F-FPELIM-NEXT: sw a3, 28(sp)
842 ; ILP32-ILP32F-FPELIM-NEXT: sw a4, 32(sp)
843 ; ILP32-ILP32F-FPELIM-NEXT: addi a0, sp, 20
844 ; ILP32-ILP32F-FPELIM-NEXT: addi a1, sp, 27
845 ; ILP32-ILP32F-FPELIM-NEXT: addi a2, sp, 35
846 ; ILP32-ILP32F-FPELIM-NEXT: sw a0, 12(sp)
847 ; ILP32-ILP32F-FPELIM-NEXT: andi a1, a1, -8
848 ; ILP32-ILP32F-FPELIM-NEXT: sw a2, 12(sp)
849 ; ILP32-ILP32F-FPELIM-NEXT: lw a0, 0(a1)
850 ; ILP32-ILP32F-FPELIM-NEXT: lw a1, 4(a1)
851 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, 48
852 ; ILP32-ILP32F-FPELIM-NEXT: ret
854 ; ILP32-ILP32F-WITHFP-LABEL: va2:
855 ; ILP32-ILP32F-WITHFP: # %bb.0:
856 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, -48
857 ; ILP32-ILP32F-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
858 ; ILP32-ILP32F-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
859 ; ILP32-ILP32F-WITHFP-NEXT: addi s0, sp, 16
860 ; ILP32-ILP32F-WITHFP-NEXT: sw a5, 20(s0)
861 ; ILP32-ILP32F-WITHFP-NEXT: sw a6, 24(s0)
862 ; ILP32-ILP32F-WITHFP-NEXT: sw a7, 28(s0)
863 ; ILP32-ILP32F-WITHFP-NEXT: sw a1, 4(s0)
864 ; ILP32-ILP32F-WITHFP-NEXT: sw a2, 8(s0)
865 ; ILP32-ILP32F-WITHFP-NEXT: sw a3, 12(s0)
866 ; ILP32-ILP32F-WITHFP-NEXT: sw a4, 16(s0)
867 ; ILP32-ILP32F-WITHFP-NEXT: addi a0, s0, 4
868 ; ILP32-ILP32F-WITHFP-NEXT: addi a1, s0, 11
869 ; ILP32-ILP32F-WITHFP-NEXT: addi a2, s0, 19
870 ; ILP32-ILP32F-WITHFP-NEXT: sw a0, -12(s0)
871 ; ILP32-ILP32F-WITHFP-NEXT: andi a1, a1, -8
872 ; ILP32-ILP32F-WITHFP-NEXT: sw a2, -12(s0)
873 ; ILP32-ILP32F-WITHFP-NEXT: lw a0, 0(a1)
874 ; ILP32-ILP32F-WITHFP-NEXT: lw a1, 4(a1)
875 ; ILP32-ILP32F-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
876 ; ILP32-ILP32F-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
877 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, 48
878 ; ILP32-ILP32F-WITHFP-NEXT: ret
880 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-LABEL: va2:
881 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM: # %bb.0:
882 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, -48
883 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a5, 36(sp)
884 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a6, 40(sp)
885 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a7, 44(sp)
886 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 20(sp)
887 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a2, 24(sp)
888 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a3, 28(sp)
889 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a4, 32(sp)
890 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a0, sp, 20
891 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a1, sp, 27
892 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a2, sp, 35
893 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a0, 12(sp)
894 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: andi a1, a1, -8
895 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a2, 12(sp)
896 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw a0, 0(a1)
897 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw a1, 4(a1)
898 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, 48
899 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: ret
901 ; ILP32E-FPELIM-LABEL: va2:
902 ; ILP32E-FPELIM: # %bb.0:
903 ; ILP32E-FPELIM-NEXT: addi sp, sp, -28
904 ; ILP32E-FPELIM-NEXT: sw a5, 24(sp)
905 ; ILP32E-FPELIM-NEXT: sw a1, 8(sp)
906 ; ILP32E-FPELIM-NEXT: sw a2, 12(sp)
907 ; ILP32E-FPELIM-NEXT: sw a3, 16(sp)
908 ; ILP32E-FPELIM-NEXT: sw a4, 20(sp)
909 ; ILP32E-FPELIM-NEXT: addi a0, sp, 8
910 ; ILP32E-FPELIM-NEXT: addi a1, sp, 15
911 ; ILP32E-FPELIM-NEXT: addi a2, sp, 23
912 ; ILP32E-FPELIM-NEXT: sw a0, 0(sp)
913 ; ILP32E-FPELIM-NEXT: andi a1, a1, -8
914 ; ILP32E-FPELIM-NEXT: sw a2, 0(sp)
915 ; ILP32E-FPELIM-NEXT: lw a0, 0(a1)
916 ; ILP32E-FPELIM-NEXT: lw a1, 4(a1)
917 ; ILP32E-FPELIM-NEXT: addi sp, sp, 28
918 ; ILP32E-FPELIM-NEXT: ret
920 ; ILP32E-WITHFP-LABEL: va2:
921 ; ILP32E-WITHFP: # %bb.0:
922 ; ILP32E-WITHFP-NEXT: addi sp, sp, -36
923 ; ILP32E-WITHFP-NEXT: sw ra, 8(sp) # 4-byte Folded Spill
924 ; ILP32E-WITHFP-NEXT: sw s0, 4(sp) # 4-byte Folded Spill
925 ; ILP32E-WITHFP-NEXT: addi s0, sp, 12
926 ; ILP32E-WITHFP-NEXT: sw a5, 20(s0)
927 ; ILP32E-WITHFP-NEXT: sw a1, 4(s0)
928 ; ILP32E-WITHFP-NEXT: sw a2, 8(s0)
929 ; ILP32E-WITHFP-NEXT: sw a3, 12(s0)
930 ; ILP32E-WITHFP-NEXT: sw a4, 16(s0)
931 ; ILP32E-WITHFP-NEXT: addi a0, s0, 4
932 ; ILP32E-WITHFP-NEXT: addi a1, s0, 11
933 ; ILP32E-WITHFP-NEXT: addi a2, s0, 19
934 ; ILP32E-WITHFP-NEXT: sw a0, -12(s0)
935 ; ILP32E-WITHFP-NEXT: andi a1, a1, -8
936 ; ILP32E-WITHFP-NEXT: sw a2, -12(s0)
937 ; ILP32E-WITHFP-NEXT: lw a0, 0(a1)
938 ; ILP32E-WITHFP-NEXT: lw a1, 4(a1)
939 ; ILP32E-WITHFP-NEXT: lw ra, 8(sp) # 4-byte Folded Reload
940 ; ILP32E-WITHFP-NEXT: lw s0, 4(sp) # 4-byte Folded Reload
941 ; ILP32E-WITHFP-NEXT: addi sp, sp, 36
942 ; ILP32E-WITHFP-NEXT: ret
944 ; LP64-LP64F-LP64D-FPELIM-LABEL: va2:
945 ; LP64-LP64F-LP64D-FPELIM: # %bb.0:
946 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, -80
947 ; LP64-LP64F-LP64D-FPELIM-NEXT: mv a0, a1
948 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a5, 56(sp)
949 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a6, 64(sp)
950 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a7, 72(sp)
951 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a1, 24(sp)
952 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a2, 32(sp)
953 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a3, 40(sp)
954 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a4, 48(sp)
955 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a1, sp, 39
956 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a1, 8(sp)
957 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, 80
958 ; LP64-LP64F-LP64D-FPELIM-NEXT: ret
960 ; LP64-LP64F-LP64D-WITHFP-LABEL: va2:
961 ; LP64-LP64F-LP64D-WITHFP: # %bb.0:
962 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, -96
963 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
964 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
965 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi s0, sp, 32
966 ; LP64-LP64F-LP64D-WITHFP-NEXT: mv a0, a1
967 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a5, 40(s0)
968 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a6, 48(s0)
969 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a7, 56(s0)
970 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a1, 8(s0)
971 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a2, 16(s0)
972 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a3, 24(s0)
973 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a4, 32(s0)
974 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a1, s0, 23
975 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a1, -24(s0)
976 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
977 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
978 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, 96
979 ; LP64-LP64F-LP64D-WITHFP-NEXT: ret
981 ; LP64E-FPELIM-LABEL: va2:
982 ; LP64E-FPELIM: # %bb.0:
983 ; LP64E-FPELIM-NEXT: addi sp, sp, -56
984 ; LP64E-FPELIM-NEXT: mv a0, a1
985 ; LP64E-FPELIM-NEXT: sd a5, 48(sp)
986 ; LP64E-FPELIM-NEXT: sd a1, 16(sp)
987 ; LP64E-FPELIM-NEXT: sd a2, 24(sp)
988 ; LP64E-FPELIM-NEXT: sd a3, 32(sp)
989 ; LP64E-FPELIM-NEXT: sd a4, 40(sp)
990 ; LP64E-FPELIM-NEXT: addi a1, sp, 31
991 ; LP64E-FPELIM-NEXT: sd a1, 0(sp)
992 ; LP64E-FPELIM-NEXT: addi sp, sp, 56
993 ; LP64E-FPELIM-NEXT: ret
995 ; LP64E-WITHFP-LABEL: va2:
996 ; LP64E-WITHFP: # %bb.0:
997 ; LP64E-WITHFP-NEXT: addi sp, sp, -72
998 ; LP64E-WITHFP-NEXT: sd ra, 16(sp) # 8-byte Folded Spill
999 ; LP64E-WITHFP-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
1000 ; LP64E-WITHFP-NEXT: addi s0, sp, 24
1001 ; LP64E-WITHFP-NEXT: mv a0, a1
1002 ; LP64E-WITHFP-NEXT: sd a5, 40(s0)
1003 ; LP64E-WITHFP-NEXT: sd a1, 8(s0)
1004 ; LP64E-WITHFP-NEXT: sd a2, 16(s0)
1005 ; LP64E-WITHFP-NEXT: sd a3, 24(s0)
1006 ; LP64E-WITHFP-NEXT: sd a4, 32(s0)
1007 ; LP64E-WITHFP-NEXT: addi a1, s0, 23
1008 ; LP64E-WITHFP-NEXT: sd a1, -24(s0)
1009 ; LP64E-WITHFP-NEXT: ld ra, 16(sp) # 8-byte Folded Reload
1010 ; LP64E-WITHFP-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
1011 ; LP64E-WITHFP-NEXT: addi sp, sp, 72
1012 ; LP64E-WITHFP-NEXT: ret
1014 call void @llvm.va_start(ptr %va)
1015 %argp.cur = load ptr, ptr %va
1016 %ptrint = ptrtoint ptr %argp.cur to iXLen
1017 %1 = add iXLen %ptrint, 7
1018 %2 = and iXLen %1, -8
1019 %argp.cur.aligned = inttoptr iXLen %1 to ptr
1020 %argp.next = getelementptr inbounds i8, ptr %argp.cur.aligned, i32 8
1021 store ptr %argp.next, ptr %va
1022 %3 = inttoptr iXLen %2 to ptr
1023 %4 = load double, ptr %3, align 8
1024 %5 = bitcast double %4 to i64
1025 call void @llvm.va_end(ptr %va)
1029 define i64 @va2_va_arg(ptr %fmt, ...) nounwind {
1030 ; ILP32-ILP32F-FPELIM-LABEL: va2_va_arg:
1031 ; ILP32-ILP32F-FPELIM: # %bb.0:
1032 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, -48
1033 ; ILP32-ILP32F-FPELIM-NEXT: sw a5, 36(sp)
1034 ; ILP32-ILP32F-FPELIM-NEXT: sw a6, 40(sp)
1035 ; ILP32-ILP32F-FPELIM-NEXT: sw a7, 44(sp)
1036 ; ILP32-ILP32F-FPELIM-NEXT: sw a1, 20(sp)
1037 ; ILP32-ILP32F-FPELIM-NEXT: sw a2, 24(sp)
1038 ; ILP32-ILP32F-FPELIM-NEXT: sw a3, 28(sp)
1039 ; ILP32-ILP32F-FPELIM-NEXT: sw a4, 32(sp)
1040 ; ILP32-ILP32F-FPELIM-NEXT: addi a0, sp, 27
1041 ; ILP32-ILP32F-FPELIM-NEXT: andi a1, a0, -8
1042 ; ILP32-ILP32F-FPELIM-NEXT: addi a0, a1, 4
1043 ; ILP32-ILP32F-FPELIM-NEXT: addi a2, a1, 8
1044 ; ILP32-ILP32F-FPELIM-NEXT: sw a0, 12(sp)
1045 ; ILP32-ILP32F-FPELIM-NEXT: lw a0, 0(a1)
1046 ; ILP32-ILP32F-FPELIM-NEXT: sw a2, 12(sp)
1047 ; ILP32-ILP32F-FPELIM-NEXT: lw a1, 4(a1)
1048 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, 48
1049 ; ILP32-ILP32F-FPELIM-NEXT: ret
1051 ; ILP32-ILP32F-WITHFP-LABEL: va2_va_arg:
1052 ; ILP32-ILP32F-WITHFP: # %bb.0:
1053 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, -48
1054 ; ILP32-ILP32F-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1055 ; ILP32-ILP32F-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
1056 ; ILP32-ILP32F-WITHFP-NEXT: addi s0, sp, 16
1057 ; ILP32-ILP32F-WITHFP-NEXT: sw a5, 20(s0)
1058 ; ILP32-ILP32F-WITHFP-NEXT: sw a6, 24(s0)
1059 ; ILP32-ILP32F-WITHFP-NEXT: sw a7, 28(s0)
1060 ; ILP32-ILP32F-WITHFP-NEXT: sw a1, 4(s0)
1061 ; ILP32-ILP32F-WITHFP-NEXT: sw a2, 8(s0)
1062 ; ILP32-ILP32F-WITHFP-NEXT: sw a3, 12(s0)
1063 ; ILP32-ILP32F-WITHFP-NEXT: sw a4, 16(s0)
1064 ; ILP32-ILP32F-WITHFP-NEXT: addi a0, s0, 11
1065 ; ILP32-ILP32F-WITHFP-NEXT: andi a1, a0, -8
1066 ; ILP32-ILP32F-WITHFP-NEXT: addi a0, a1, 4
1067 ; ILP32-ILP32F-WITHFP-NEXT: addi a2, a1, 8
1068 ; ILP32-ILP32F-WITHFP-NEXT: sw a0, -12(s0)
1069 ; ILP32-ILP32F-WITHFP-NEXT: lw a0, 0(a1)
1070 ; ILP32-ILP32F-WITHFP-NEXT: sw a2, -12(s0)
1071 ; ILP32-ILP32F-WITHFP-NEXT: lw a1, 4(a1)
1072 ; ILP32-ILP32F-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1073 ; ILP32-ILP32F-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
1074 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, 48
1075 ; ILP32-ILP32F-WITHFP-NEXT: ret
1077 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-LABEL: va2_va_arg:
1078 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM: # %bb.0:
1079 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, -48
1080 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a5, 36(sp)
1081 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a6, 40(sp)
1082 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a7, 44(sp)
1083 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 20(sp)
1084 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a2, 24(sp)
1085 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a3, 28(sp)
1086 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a4, 32(sp)
1087 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a0, sp, 27
1088 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: andi a0, a0, -8
1089 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a1, a0, 8
1090 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 12(sp)
1091 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: fld fa5, 0(a0)
1092 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: fsd fa5, 0(sp)
1093 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw a0, 0(sp)
1094 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw a1, 4(sp)
1095 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, 48
1096 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: ret
1098 ; ILP32E-FPELIM-LABEL: va2_va_arg:
1099 ; ILP32E-FPELIM: # %bb.0:
1100 ; ILP32E-FPELIM-NEXT: addi sp, sp, -28
1101 ; ILP32E-FPELIM-NEXT: sw a5, 24(sp)
1102 ; ILP32E-FPELIM-NEXT: sw a1, 8(sp)
1103 ; ILP32E-FPELIM-NEXT: sw a2, 12(sp)
1104 ; ILP32E-FPELIM-NEXT: sw a3, 16(sp)
1105 ; ILP32E-FPELIM-NEXT: sw a4, 20(sp)
1106 ; ILP32E-FPELIM-NEXT: addi a0, sp, 15
1107 ; ILP32E-FPELIM-NEXT: andi a1, a0, -8
1108 ; ILP32E-FPELIM-NEXT: addi a0, a1, 4
1109 ; ILP32E-FPELIM-NEXT: addi a2, a1, 8
1110 ; ILP32E-FPELIM-NEXT: sw a0, 0(sp)
1111 ; ILP32E-FPELIM-NEXT: lw a0, 0(a1)
1112 ; ILP32E-FPELIM-NEXT: sw a2, 0(sp)
1113 ; ILP32E-FPELIM-NEXT: lw a1, 4(a1)
1114 ; ILP32E-FPELIM-NEXT: addi sp, sp, 28
1115 ; ILP32E-FPELIM-NEXT: ret
1117 ; ILP32E-WITHFP-LABEL: va2_va_arg:
1118 ; ILP32E-WITHFP: # %bb.0:
1119 ; ILP32E-WITHFP-NEXT: addi sp, sp, -36
1120 ; ILP32E-WITHFP-NEXT: sw ra, 8(sp) # 4-byte Folded Spill
1121 ; ILP32E-WITHFP-NEXT: sw s0, 4(sp) # 4-byte Folded Spill
1122 ; ILP32E-WITHFP-NEXT: addi s0, sp, 12
1123 ; ILP32E-WITHFP-NEXT: sw a5, 20(s0)
1124 ; ILP32E-WITHFP-NEXT: sw a1, 4(s0)
1125 ; ILP32E-WITHFP-NEXT: sw a2, 8(s0)
1126 ; ILP32E-WITHFP-NEXT: sw a3, 12(s0)
1127 ; ILP32E-WITHFP-NEXT: sw a4, 16(s0)
1128 ; ILP32E-WITHFP-NEXT: addi a0, s0, 11
1129 ; ILP32E-WITHFP-NEXT: andi a1, a0, -8
1130 ; ILP32E-WITHFP-NEXT: addi a0, a1, 4
1131 ; ILP32E-WITHFP-NEXT: addi a2, a1, 8
1132 ; ILP32E-WITHFP-NEXT: sw a0, -12(s0)
1133 ; ILP32E-WITHFP-NEXT: lw a0, 0(a1)
1134 ; ILP32E-WITHFP-NEXT: sw a2, -12(s0)
1135 ; ILP32E-WITHFP-NEXT: lw a1, 4(a1)
1136 ; ILP32E-WITHFP-NEXT: lw ra, 8(sp) # 4-byte Folded Reload
1137 ; ILP32E-WITHFP-NEXT: lw s0, 4(sp) # 4-byte Folded Reload
1138 ; ILP32E-WITHFP-NEXT: addi sp, sp, 36
1139 ; ILP32E-WITHFP-NEXT: ret
1141 ; LP64-LP64F-LP64D-FPELIM-LABEL: va2_va_arg:
1142 ; LP64-LP64F-LP64D-FPELIM: # %bb.0:
1143 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, -80
1144 ; LP64-LP64F-LP64D-FPELIM-NEXT: mv a0, a1
1145 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a5, 56(sp)
1146 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a6, 64(sp)
1147 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a7, 72(sp)
1148 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a1, 24(sp)
1149 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a2, 32(sp)
1150 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a3, 40(sp)
1151 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a4, 48(sp)
1152 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a1, sp, 32
1153 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a1, 8(sp)
1154 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, 80
1155 ; LP64-LP64F-LP64D-FPELIM-NEXT: ret
1157 ; LP64-LP64F-LP64D-WITHFP-LABEL: va2_va_arg:
1158 ; LP64-LP64F-LP64D-WITHFP: # %bb.0:
1159 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, -96
1160 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
1161 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
1162 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi s0, sp, 32
1163 ; LP64-LP64F-LP64D-WITHFP-NEXT: mv a0, a1
1164 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a5, 40(s0)
1165 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a6, 48(s0)
1166 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a7, 56(s0)
1167 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a1, 8(s0)
1168 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a2, 16(s0)
1169 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a3, 24(s0)
1170 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a4, 32(s0)
1171 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a1, s0, 16
1172 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a1, -24(s0)
1173 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
1174 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
1175 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, 96
1176 ; LP64-LP64F-LP64D-WITHFP-NEXT: ret
1178 ; LP64E-FPELIM-LABEL: va2_va_arg:
1179 ; LP64E-FPELIM: # %bb.0:
1180 ; LP64E-FPELIM-NEXT: addi sp, sp, -56
1181 ; LP64E-FPELIM-NEXT: mv a0, a1
1182 ; LP64E-FPELIM-NEXT: sd a5, 48(sp)
1183 ; LP64E-FPELIM-NEXT: sd a1, 16(sp)
1184 ; LP64E-FPELIM-NEXT: sd a2, 24(sp)
1185 ; LP64E-FPELIM-NEXT: sd a3, 32(sp)
1186 ; LP64E-FPELIM-NEXT: sd a4, 40(sp)
1187 ; LP64E-FPELIM-NEXT: addi a1, sp, 24
1188 ; LP64E-FPELIM-NEXT: sd a1, 0(sp)
1189 ; LP64E-FPELIM-NEXT: addi sp, sp, 56
1190 ; LP64E-FPELIM-NEXT: ret
1192 ; LP64E-WITHFP-LABEL: va2_va_arg:
1193 ; LP64E-WITHFP: # %bb.0:
1194 ; LP64E-WITHFP-NEXT: addi sp, sp, -72
1195 ; LP64E-WITHFP-NEXT: sd ra, 16(sp) # 8-byte Folded Spill
1196 ; LP64E-WITHFP-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
1197 ; LP64E-WITHFP-NEXT: addi s0, sp, 24
1198 ; LP64E-WITHFP-NEXT: mv a0, a1
1199 ; LP64E-WITHFP-NEXT: sd a5, 40(s0)
1200 ; LP64E-WITHFP-NEXT: sd a1, 8(s0)
1201 ; LP64E-WITHFP-NEXT: sd a2, 16(s0)
1202 ; LP64E-WITHFP-NEXT: sd a3, 24(s0)
1203 ; LP64E-WITHFP-NEXT: sd a4, 32(s0)
1204 ; LP64E-WITHFP-NEXT: addi a1, s0, 16
1205 ; LP64E-WITHFP-NEXT: sd a1, -24(s0)
1206 ; LP64E-WITHFP-NEXT: ld ra, 16(sp) # 8-byte Folded Reload
1207 ; LP64E-WITHFP-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
1208 ; LP64E-WITHFP-NEXT: addi sp, sp, 72
1209 ; LP64E-WITHFP-NEXT: ret
1211 call void @llvm.va_start(ptr %va)
1212 %1 = va_arg ptr %va, double
1213 call void @llvm.va_end(ptr %va)
1214 %2 = bitcast double %1 to i64
1218 define void @va2_caller() nounwind {
1219 ; ILP32-ILP32F-FPELIM-LABEL: va2_caller:
1220 ; ILP32-ILP32F-FPELIM: # %bb.0:
1221 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, -16
1222 ; ILP32-ILP32F-FPELIM-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1223 ; ILP32-ILP32F-FPELIM-NEXT: lui a3, 261888
1224 ; ILP32-ILP32F-FPELIM-NEXT: li a2, 0
1225 ; ILP32-ILP32F-FPELIM-NEXT: call va2
1226 ; ILP32-ILP32F-FPELIM-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1227 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, 16
1228 ; ILP32-ILP32F-FPELIM-NEXT: ret
1230 ; ILP32-ILP32F-WITHFP-LABEL: va2_caller:
1231 ; ILP32-ILP32F-WITHFP: # %bb.0:
1232 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, -16
1233 ; ILP32-ILP32F-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1234 ; ILP32-ILP32F-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
1235 ; ILP32-ILP32F-WITHFP-NEXT: addi s0, sp, 16
1236 ; ILP32-ILP32F-WITHFP-NEXT: lui a3, 261888
1237 ; ILP32-ILP32F-WITHFP-NEXT: li a2, 0
1238 ; ILP32-ILP32F-WITHFP-NEXT: call va2
1239 ; ILP32-ILP32F-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1240 ; ILP32-ILP32F-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
1241 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, 16
1242 ; ILP32-ILP32F-WITHFP-NEXT: ret
1244 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-LABEL: va2_caller:
1245 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM: # %bb.0:
1246 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, -16
1247 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1248 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a3, 261888
1249 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a2, 0
1250 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: call va2
1251 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1252 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, 16
1253 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: ret
1255 ; ILP32E-FPELIM-LABEL: va2_caller:
1256 ; ILP32E-FPELIM: # %bb.0:
1257 ; ILP32E-FPELIM-NEXT: addi sp, sp, -4
1258 ; ILP32E-FPELIM-NEXT: sw ra, 0(sp) # 4-byte Folded Spill
1259 ; ILP32E-FPELIM-NEXT: lui a2, 261888
1260 ; ILP32E-FPELIM-NEXT: li a1, 0
1261 ; ILP32E-FPELIM-NEXT: call va2
1262 ; ILP32E-FPELIM-NEXT: lw ra, 0(sp) # 4-byte Folded Reload
1263 ; ILP32E-FPELIM-NEXT: addi sp, sp, 4
1264 ; ILP32E-FPELIM-NEXT: ret
1266 ; ILP32E-WITHFP-LABEL: va2_caller:
1267 ; ILP32E-WITHFP: # %bb.0:
1268 ; ILP32E-WITHFP-NEXT: addi sp, sp, -8
1269 ; ILP32E-WITHFP-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
1270 ; ILP32E-WITHFP-NEXT: sw s0, 0(sp) # 4-byte Folded Spill
1271 ; ILP32E-WITHFP-NEXT: addi s0, sp, 8
1272 ; ILP32E-WITHFP-NEXT: lui a2, 261888
1273 ; ILP32E-WITHFP-NEXT: li a1, 0
1274 ; ILP32E-WITHFP-NEXT: call va2
1275 ; ILP32E-WITHFP-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
1276 ; ILP32E-WITHFP-NEXT: lw s0, 0(sp) # 4-byte Folded Reload
1277 ; ILP32E-WITHFP-NEXT: addi sp, sp, 8
1278 ; ILP32E-WITHFP-NEXT: ret
1280 ; LP64-LP64F-LP64D-FPELIM-LABEL: va2_caller:
1281 ; LP64-LP64F-LP64D-FPELIM: # %bb.0:
1282 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, -16
1283 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1284 ; LP64-LP64F-LP64D-FPELIM-NEXT: li a1, 1023
1285 ; LP64-LP64F-LP64D-FPELIM-NEXT: slli a1, a1, 52
1286 ; LP64-LP64F-LP64D-FPELIM-NEXT: call va2
1287 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1288 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, 16
1289 ; LP64-LP64F-LP64D-FPELIM-NEXT: ret
1291 ; LP64-LP64F-LP64D-WITHFP-LABEL: va2_caller:
1292 ; LP64-LP64F-LP64D-WITHFP: # %bb.0:
1293 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, -16
1294 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1295 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s0, 0(sp) # 8-byte Folded Spill
1296 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi s0, sp, 16
1297 ; LP64-LP64F-LP64D-WITHFP-NEXT: li a1, 1023
1298 ; LP64-LP64F-LP64D-WITHFP-NEXT: slli a1, a1, 52
1299 ; LP64-LP64F-LP64D-WITHFP-NEXT: call va2
1300 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1301 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s0, 0(sp) # 8-byte Folded Reload
1302 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, 16
1303 ; LP64-LP64F-LP64D-WITHFP-NEXT: ret
1305 ; LP64E-FPELIM-LABEL: va2_caller:
1306 ; LP64E-FPELIM: # %bb.0:
1307 ; LP64E-FPELIM-NEXT: addi sp, sp, -8
1308 ; LP64E-FPELIM-NEXT: sd ra, 0(sp) # 8-byte Folded Spill
1309 ; LP64E-FPELIM-NEXT: li a1, 1023
1310 ; LP64E-FPELIM-NEXT: slli a1, a1, 52
1311 ; LP64E-FPELIM-NEXT: call va2
1312 ; LP64E-FPELIM-NEXT: ld ra, 0(sp) # 8-byte Folded Reload
1313 ; LP64E-FPELIM-NEXT: addi sp, sp, 8
1314 ; LP64E-FPELIM-NEXT: ret
1316 ; LP64E-WITHFP-LABEL: va2_caller:
1317 ; LP64E-WITHFP: # %bb.0:
1318 ; LP64E-WITHFP-NEXT: addi sp, sp, -16
1319 ; LP64E-WITHFP-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1320 ; LP64E-WITHFP-NEXT: sd s0, 0(sp) # 8-byte Folded Spill
1321 ; LP64E-WITHFP-NEXT: addi s0, sp, 16
1322 ; LP64E-WITHFP-NEXT: li a1, 1023
1323 ; LP64E-WITHFP-NEXT: slli a1, a1, 52
1324 ; LP64E-WITHFP-NEXT: call va2
1325 ; LP64E-WITHFP-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1326 ; LP64E-WITHFP-NEXT: ld s0, 0(sp) # 8-byte Folded Reload
1327 ; LP64E-WITHFP-NEXT: addi sp, sp, 16
1328 ; LP64E-WITHFP-NEXT: ret
1329 %1 = call i64 (ptr, ...) @va2(ptr undef, double 1.000000e+00)
1333 ; On RV32, Ensure a named 2*xlen argument is passed in a1 and a2, while the
1334 ; vararg double is passed in a4 and a5 (rather than a3 and a4)
1336 define i64 @va3(i32 %a, i64 %b, ...) nounwind {
1337 ; ILP32-ILP32F-FPELIM-LABEL: va3:
1338 ; ILP32-ILP32F-FPELIM: # %bb.0:
1339 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, -32
1340 ; ILP32-ILP32F-FPELIM-NEXT: sw a7, 28(sp)
1341 ; ILP32-ILP32F-FPELIM-NEXT: sw a3, 12(sp)
1342 ; ILP32-ILP32F-FPELIM-NEXT: sw a4, 16(sp)
1343 ; ILP32-ILP32F-FPELIM-NEXT: sw a5, 20(sp)
1344 ; ILP32-ILP32F-FPELIM-NEXT: sw a6, 24(sp)
1345 ; ILP32-ILP32F-FPELIM-NEXT: addi a0, sp, 12
1346 ; ILP32-ILP32F-FPELIM-NEXT: addi a3, sp, 19
1347 ; ILP32-ILP32F-FPELIM-NEXT: addi a4, sp, 27
1348 ; ILP32-ILP32F-FPELIM-NEXT: sw a0, 4(sp)
1349 ; ILP32-ILP32F-FPELIM-NEXT: andi a3, a3, -8
1350 ; ILP32-ILP32F-FPELIM-NEXT: sw a4, 4(sp)
1351 ; ILP32-ILP32F-FPELIM-NEXT: lw a0, 4(a3)
1352 ; ILP32-ILP32F-FPELIM-NEXT: lw a3, 0(a3)
1353 ; ILP32-ILP32F-FPELIM-NEXT: add a2, a2, a0
1354 ; ILP32-ILP32F-FPELIM-NEXT: add a0, a1, a3
1355 ; ILP32-ILP32F-FPELIM-NEXT: sltu a1, a0, a1
1356 ; ILP32-ILP32F-FPELIM-NEXT: add a1, a2, a1
1357 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, 32
1358 ; ILP32-ILP32F-FPELIM-NEXT: ret
1360 ; ILP32-ILP32F-WITHFP-LABEL: va3:
1361 ; ILP32-ILP32F-WITHFP: # %bb.0:
1362 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, -48
1363 ; ILP32-ILP32F-WITHFP-NEXT: sw ra, 20(sp) # 4-byte Folded Spill
1364 ; ILP32-ILP32F-WITHFP-NEXT: sw s0, 16(sp) # 4-byte Folded Spill
1365 ; ILP32-ILP32F-WITHFP-NEXT: addi s0, sp, 24
1366 ; ILP32-ILP32F-WITHFP-NEXT: sw a7, 20(s0)
1367 ; ILP32-ILP32F-WITHFP-NEXT: sw a3, 4(s0)
1368 ; ILP32-ILP32F-WITHFP-NEXT: sw a4, 8(s0)
1369 ; ILP32-ILP32F-WITHFP-NEXT: sw a5, 12(s0)
1370 ; ILP32-ILP32F-WITHFP-NEXT: sw a6, 16(s0)
1371 ; ILP32-ILP32F-WITHFP-NEXT: addi a0, s0, 4
1372 ; ILP32-ILP32F-WITHFP-NEXT: addi a3, s0, 11
1373 ; ILP32-ILP32F-WITHFP-NEXT: addi a4, s0, 19
1374 ; ILP32-ILP32F-WITHFP-NEXT: sw a0, -12(s0)
1375 ; ILP32-ILP32F-WITHFP-NEXT: andi a3, a3, -8
1376 ; ILP32-ILP32F-WITHFP-NEXT: sw a4, -12(s0)
1377 ; ILP32-ILP32F-WITHFP-NEXT: lw a0, 4(a3)
1378 ; ILP32-ILP32F-WITHFP-NEXT: lw a3, 0(a3)
1379 ; ILP32-ILP32F-WITHFP-NEXT: add a2, a2, a0
1380 ; ILP32-ILP32F-WITHFP-NEXT: add a0, a1, a3
1381 ; ILP32-ILP32F-WITHFP-NEXT: sltu a1, a0, a1
1382 ; ILP32-ILP32F-WITHFP-NEXT: add a1, a2, a1
1383 ; ILP32-ILP32F-WITHFP-NEXT: lw ra, 20(sp) # 4-byte Folded Reload
1384 ; ILP32-ILP32F-WITHFP-NEXT: lw s0, 16(sp) # 4-byte Folded Reload
1385 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, 48
1386 ; ILP32-ILP32F-WITHFP-NEXT: ret
1388 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-LABEL: va3:
1389 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM: # %bb.0:
1390 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, -32
1391 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a7, 28(sp)
1392 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a3, 12(sp)
1393 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a4, 16(sp)
1394 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a5, 20(sp)
1395 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a6, 24(sp)
1396 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a0, sp, 12
1397 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a3, sp, 19
1398 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a4, sp, 27
1399 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a0, 4(sp)
1400 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: andi a3, a3, -8
1401 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a4, 4(sp)
1402 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw a0, 4(a3)
1403 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw a3, 0(a3)
1404 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a2, a2, a0
1405 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a0, a1, a3
1406 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sltu a1, a0, a1
1407 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a1, a2, a1
1408 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, 32
1409 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: ret
1411 ; ILP32E-FPELIM-LABEL: va3:
1412 ; ILP32E-FPELIM: # %bb.0:
1413 ; ILP32E-FPELIM-NEXT: addi sp, sp, -20
1414 ; ILP32E-FPELIM-NEXT: sw a3, 8(sp)
1415 ; ILP32E-FPELIM-NEXT: sw a4, 12(sp)
1416 ; ILP32E-FPELIM-NEXT: sw a5, 16(sp)
1417 ; ILP32E-FPELIM-NEXT: addi a0, sp, 8
1418 ; ILP32E-FPELIM-NEXT: addi a3, sp, 15
1419 ; ILP32E-FPELIM-NEXT: addi a4, sp, 23
1420 ; ILP32E-FPELIM-NEXT: sw a0, 0(sp)
1421 ; ILP32E-FPELIM-NEXT: andi a3, a3, -8
1422 ; ILP32E-FPELIM-NEXT: sw a4, 0(sp)
1423 ; ILP32E-FPELIM-NEXT: lw a0, 4(a3)
1424 ; ILP32E-FPELIM-NEXT: lw a3, 0(a3)
1425 ; ILP32E-FPELIM-NEXT: add a2, a2, a0
1426 ; ILP32E-FPELIM-NEXT: add a0, a1, a3
1427 ; ILP32E-FPELIM-NEXT: sltu a1, a0, a1
1428 ; ILP32E-FPELIM-NEXT: add a1, a2, a1
1429 ; ILP32E-FPELIM-NEXT: addi sp, sp, 20
1430 ; ILP32E-FPELIM-NEXT: ret
1432 ; ILP32E-WITHFP-LABEL: va3:
1433 ; ILP32E-WITHFP: # %bb.0:
1434 ; ILP32E-WITHFP-NEXT: addi sp, sp, -28
1435 ; ILP32E-WITHFP-NEXT: sw ra, 8(sp) # 4-byte Folded Spill
1436 ; ILP32E-WITHFP-NEXT: sw s0, 4(sp) # 4-byte Folded Spill
1437 ; ILP32E-WITHFP-NEXT: addi s0, sp, 12
1438 ; ILP32E-WITHFP-NEXT: sw a3, 4(s0)
1439 ; ILP32E-WITHFP-NEXT: sw a4, 8(s0)
1440 ; ILP32E-WITHFP-NEXT: sw a5, 12(s0)
1441 ; ILP32E-WITHFP-NEXT: addi a0, s0, 4
1442 ; ILP32E-WITHFP-NEXT: addi a3, s0, 11
1443 ; ILP32E-WITHFP-NEXT: addi a4, s0, 19
1444 ; ILP32E-WITHFP-NEXT: sw a0, -12(s0)
1445 ; ILP32E-WITHFP-NEXT: andi a3, a3, -8
1446 ; ILP32E-WITHFP-NEXT: sw a4, -12(s0)
1447 ; ILP32E-WITHFP-NEXT: lw a0, 4(a3)
1448 ; ILP32E-WITHFP-NEXT: lw a3, 0(a3)
1449 ; ILP32E-WITHFP-NEXT: add a2, a2, a0
1450 ; ILP32E-WITHFP-NEXT: add a0, a1, a3
1451 ; ILP32E-WITHFP-NEXT: sltu a1, a0, a1
1452 ; ILP32E-WITHFP-NEXT: add a1, a2, a1
1453 ; ILP32E-WITHFP-NEXT: lw ra, 8(sp) # 4-byte Folded Reload
1454 ; ILP32E-WITHFP-NEXT: lw s0, 4(sp) # 4-byte Folded Reload
1455 ; ILP32E-WITHFP-NEXT: addi sp, sp, 28
1456 ; ILP32E-WITHFP-NEXT: ret
1458 ; LP64-LP64F-LP64D-FPELIM-LABEL: va3:
1459 ; LP64-LP64F-LP64D-FPELIM: # %bb.0:
1460 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, -64
1461 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a6, 48(sp)
1462 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a7, 56(sp)
1463 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a2, 16(sp)
1464 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a3, 24(sp)
1465 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a4, 32(sp)
1466 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a5, 40(sp)
1467 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a3, sp, 31
1468 ; LP64-LP64F-LP64D-FPELIM-NEXT: add a0, a1, a2
1469 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a3, 8(sp)
1470 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, 64
1471 ; LP64-LP64F-LP64D-FPELIM-NEXT: ret
1473 ; LP64-LP64F-LP64D-WITHFP-LABEL: va3:
1474 ; LP64-LP64F-LP64D-WITHFP: # %bb.0:
1475 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, -80
1476 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
1477 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
1478 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi s0, sp, 32
1479 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a6, 32(s0)
1480 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a7, 40(s0)
1481 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a2, 0(s0)
1482 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a3, 8(s0)
1483 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a4, 16(s0)
1484 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a5, 24(s0)
1485 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a3, s0, 15
1486 ; LP64-LP64F-LP64D-WITHFP-NEXT: add a0, a1, a2
1487 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a3, -24(s0)
1488 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
1489 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
1490 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, 80
1491 ; LP64-LP64F-LP64D-WITHFP-NEXT: ret
1493 ; LP64E-FPELIM-LABEL: va3:
1494 ; LP64E-FPELIM: # %bb.0:
1495 ; LP64E-FPELIM-NEXT: addi sp, sp, -40
1496 ; LP64E-FPELIM-NEXT: sd a2, 8(sp)
1497 ; LP64E-FPELIM-NEXT: sd a3, 16(sp)
1498 ; LP64E-FPELIM-NEXT: sd a4, 24(sp)
1499 ; LP64E-FPELIM-NEXT: sd a5, 32(sp)
1500 ; LP64E-FPELIM-NEXT: addi a3, sp, 23
1501 ; LP64E-FPELIM-NEXT: add a0, a1, a2
1502 ; LP64E-FPELIM-NEXT: sd a3, 0(sp)
1503 ; LP64E-FPELIM-NEXT: addi sp, sp, 40
1504 ; LP64E-FPELIM-NEXT: ret
1506 ; LP64E-WITHFP-LABEL: va3:
1507 ; LP64E-WITHFP: # %bb.0:
1508 ; LP64E-WITHFP-NEXT: addi sp, sp, -56
1509 ; LP64E-WITHFP-NEXT: sd ra, 16(sp) # 8-byte Folded Spill
1510 ; LP64E-WITHFP-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
1511 ; LP64E-WITHFP-NEXT: addi s0, sp, 24
1512 ; LP64E-WITHFP-NEXT: sd a2, 0(s0)
1513 ; LP64E-WITHFP-NEXT: sd a3, 8(s0)
1514 ; LP64E-WITHFP-NEXT: sd a4, 16(s0)
1515 ; LP64E-WITHFP-NEXT: sd a5, 24(s0)
1516 ; LP64E-WITHFP-NEXT: addi a3, s0, 15
1517 ; LP64E-WITHFP-NEXT: add a0, a1, a2
1518 ; LP64E-WITHFP-NEXT: sd a3, -24(s0)
1519 ; LP64E-WITHFP-NEXT: ld ra, 16(sp) # 8-byte Folded Reload
1520 ; LP64E-WITHFP-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
1521 ; LP64E-WITHFP-NEXT: addi sp, sp, 56
1522 ; LP64E-WITHFP-NEXT: ret
1524 call void @llvm.va_start(ptr %va)
1525 %argp.cur = load ptr, ptr %va
1526 %ptrint = ptrtoint ptr %argp.cur to iXLen
1527 %1 = add iXLen %ptrint, 7
1528 %2 = and iXLen %1, -8
1529 %argp.cur.aligned = inttoptr iXLen %1 to ptr
1530 %argp.next = getelementptr inbounds i8, ptr %argp.cur.aligned, i32 8
1531 store ptr %argp.next, ptr %va
1532 %3 = inttoptr iXLen %2 to ptr
1533 %4 = load double, ptr %3, align 8
1534 call void @llvm.va_end(ptr %va)
1535 %5 = bitcast double %4 to i64
1540 define i64 @va3_va_arg(i32 %a, i64 %b, ...) nounwind {
1541 ; ILP32-ILP32F-FPELIM-LABEL: va3_va_arg:
1542 ; ILP32-ILP32F-FPELIM: # %bb.0:
1543 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, -32
1544 ; ILP32-ILP32F-FPELIM-NEXT: sw a7, 28(sp)
1545 ; ILP32-ILP32F-FPELIM-NEXT: sw a3, 12(sp)
1546 ; ILP32-ILP32F-FPELIM-NEXT: sw a4, 16(sp)
1547 ; ILP32-ILP32F-FPELIM-NEXT: sw a5, 20(sp)
1548 ; ILP32-ILP32F-FPELIM-NEXT: sw a6, 24(sp)
1549 ; ILP32-ILP32F-FPELIM-NEXT: addi a0, sp, 19
1550 ; ILP32-ILP32F-FPELIM-NEXT: andi a0, a0, -8
1551 ; ILP32-ILP32F-FPELIM-NEXT: addi a3, a0, 4
1552 ; ILP32-ILP32F-FPELIM-NEXT: addi a4, a0, 8
1553 ; ILP32-ILP32F-FPELIM-NEXT: sw a3, 4(sp)
1554 ; ILP32-ILP32F-FPELIM-NEXT: lw a3, 0(a0)
1555 ; ILP32-ILP32F-FPELIM-NEXT: sw a4, 4(sp)
1556 ; ILP32-ILP32F-FPELIM-NEXT: lw a4, 4(a0)
1557 ; ILP32-ILP32F-FPELIM-NEXT: add a0, a1, a3
1558 ; ILP32-ILP32F-FPELIM-NEXT: sltu a1, a0, a1
1559 ; ILP32-ILP32F-FPELIM-NEXT: add a2, a2, a4
1560 ; ILP32-ILP32F-FPELIM-NEXT: add a1, a2, a1
1561 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, 32
1562 ; ILP32-ILP32F-FPELIM-NEXT: ret
1564 ; ILP32-ILP32F-WITHFP-LABEL: va3_va_arg:
1565 ; ILP32-ILP32F-WITHFP: # %bb.0:
1566 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, -48
1567 ; ILP32-ILP32F-WITHFP-NEXT: sw ra, 20(sp) # 4-byte Folded Spill
1568 ; ILP32-ILP32F-WITHFP-NEXT: sw s0, 16(sp) # 4-byte Folded Spill
1569 ; ILP32-ILP32F-WITHFP-NEXT: addi s0, sp, 24
1570 ; ILP32-ILP32F-WITHFP-NEXT: sw a7, 20(s0)
1571 ; ILP32-ILP32F-WITHFP-NEXT: sw a3, 4(s0)
1572 ; ILP32-ILP32F-WITHFP-NEXT: sw a4, 8(s0)
1573 ; ILP32-ILP32F-WITHFP-NEXT: sw a5, 12(s0)
1574 ; ILP32-ILP32F-WITHFP-NEXT: sw a6, 16(s0)
1575 ; ILP32-ILP32F-WITHFP-NEXT: addi a0, s0, 11
1576 ; ILP32-ILP32F-WITHFP-NEXT: andi a0, a0, -8
1577 ; ILP32-ILP32F-WITHFP-NEXT: addi a3, a0, 4
1578 ; ILP32-ILP32F-WITHFP-NEXT: addi a4, a0, 8
1579 ; ILP32-ILP32F-WITHFP-NEXT: sw a3, -12(s0)
1580 ; ILP32-ILP32F-WITHFP-NEXT: lw a3, 0(a0)
1581 ; ILP32-ILP32F-WITHFP-NEXT: sw a4, -12(s0)
1582 ; ILP32-ILP32F-WITHFP-NEXT: lw a4, 4(a0)
1583 ; ILP32-ILP32F-WITHFP-NEXT: add a0, a1, a3
1584 ; ILP32-ILP32F-WITHFP-NEXT: sltu a1, a0, a1
1585 ; ILP32-ILP32F-WITHFP-NEXT: add a2, a2, a4
1586 ; ILP32-ILP32F-WITHFP-NEXT: add a1, a2, a1
1587 ; ILP32-ILP32F-WITHFP-NEXT: lw ra, 20(sp) # 4-byte Folded Reload
1588 ; ILP32-ILP32F-WITHFP-NEXT: lw s0, 16(sp) # 4-byte Folded Reload
1589 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, 48
1590 ; ILP32-ILP32F-WITHFP-NEXT: ret
1592 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-LABEL: va3_va_arg:
1593 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM: # %bb.0:
1594 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, -48
1595 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a7, 44(sp)
1596 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a3, 28(sp)
1597 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a4, 32(sp)
1598 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a5, 36(sp)
1599 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a6, 40(sp)
1600 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a0, sp, 35
1601 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: andi a0, a0, -8
1602 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a3, a0, 8
1603 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a3, 20(sp)
1604 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: fld fa5, 0(a0)
1605 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: fsd fa5, 8(sp)
1606 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw a0, 12(sp)
1607 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw a3, 8(sp)
1608 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a2, a2, a0
1609 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a0, a1, a3
1610 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sltu a1, a0, a1
1611 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a1, a2, a1
1612 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, 48
1613 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: ret
1615 ; ILP32E-FPELIM-LABEL: va3_va_arg:
1616 ; ILP32E-FPELIM: # %bb.0:
1617 ; ILP32E-FPELIM-NEXT: addi sp, sp, -20
1618 ; ILP32E-FPELIM-NEXT: sw a3, 8(sp)
1619 ; ILP32E-FPELIM-NEXT: sw a4, 12(sp)
1620 ; ILP32E-FPELIM-NEXT: sw a5, 16(sp)
1621 ; ILP32E-FPELIM-NEXT: addi a0, sp, 15
1622 ; ILP32E-FPELIM-NEXT: andi a0, a0, -8
1623 ; ILP32E-FPELIM-NEXT: addi a3, a0, 4
1624 ; ILP32E-FPELIM-NEXT: addi a4, a0, 8
1625 ; ILP32E-FPELIM-NEXT: sw a3, 0(sp)
1626 ; ILP32E-FPELIM-NEXT: lw a3, 0(a0)
1627 ; ILP32E-FPELIM-NEXT: sw a4, 0(sp)
1628 ; ILP32E-FPELIM-NEXT: lw a4, 4(a0)
1629 ; ILP32E-FPELIM-NEXT: add a0, a1, a3
1630 ; ILP32E-FPELIM-NEXT: sltu a1, a0, a1
1631 ; ILP32E-FPELIM-NEXT: add a2, a2, a4
1632 ; ILP32E-FPELIM-NEXT: add a1, a2, a1
1633 ; ILP32E-FPELIM-NEXT: addi sp, sp, 20
1634 ; ILP32E-FPELIM-NEXT: ret
1636 ; ILP32E-WITHFP-LABEL: va3_va_arg:
1637 ; ILP32E-WITHFP: # %bb.0:
1638 ; ILP32E-WITHFP-NEXT: addi sp, sp, -28
1639 ; ILP32E-WITHFP-NEXT: sw ra, 8(sp) # 4-byte Folded Spill
1640 ; ILP32E-WITHFP-NEXT: sw s0, 4(sp) # 4-byte Folded Spill
1641 ; ILP32E-WITHFP-NEXT: addi s0, sp, 12
1642 ; ILP32E-WITHFP-NEXT: sw a3, 4(s0)
1643 ; ILP32E-WITHFP-NEXT: sw a4, 8(s0)
1644 ; ILP32E-WITHFP-NEXT: sw a5, 12(s0)
1645 ; ILP32E-WITHFP-NEXT: addi a0, s0, 11
1646 ; ILP32E-WITHFP-NEXT: andi a0, a0, -8
1647 ; ILP32E-WITHFP-NEXT: addi a3, a0, 4
1648 ; ILP32E-WITHFP-NEXT: addi a4, a0, 8
1649 ; ILP32E-WITHFP-NEXT: sw a3, -12(s0)
1650 ; ILP32E-WITHFP-NEXT: lw a3, 0(a0)
1651 ; ILP32E-WITHFP-NEXT: sw a4, -12(s0)
1652 ; ILP32E-WITHFP-NEXT: lw a4, 4(a0)
1653 ; ILP32E-WITHFP-NEXT: add a0, a1, a3
1654 ; ILP32E-WITHFP-NEXT: sltu a1, a0, a1
1655 ; ILP32E-WITHFP-NEXT: add a2, a2, a4
1656 ; ILP32E-WITHFP-NEXT: add a1, a2, a1
1657 ; ILP32E-WITHFP-NEXT: lw ra, 8(sp) # 4-byte Folded Reload
1658 ; ILP32E-WITHFP-NEXT: lw s0, 4(sp) # 4-byte Folded Reload
1659 ; ILP32E-WITHFP-NEXT: addi sp, sp, 28
1660 ; ILP32E-WITHFP-NEXT: ret
1662 ; LP64-LP64F-LP64D-FPELIM-LABEL: va3_va_arg:
1663 ; LP64-LP64F-LP64D-FPELIM: # %bb.0:
1664 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, -64
1665 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a6, 48(sp)
1666 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a7, 56(sp)
1667 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a2, 16(sp)
1668 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a3, 24(sp)
1669 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a4, 32(sp)
1670 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a5, 40(sp)
1671 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a3, sp, 24
1672 ; LP64-LP64F-LP64D-FPELIM-NEXT: add a0, a1, a2
1673 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a3, 8(sp)
1674 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, 64
1675 ; LP64-LP64F-LP64D-FPELIM-NEXT: ret
1677 ; LP64-LP64F-LP64D-WITHFP-LABEL: va3_va_arg:
1678 ; LP64-LP64F-LP64D-WITHFP: # %bb.0:
1679 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, -80
1680 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
1681 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
1682 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi s0, sp, 32
1683 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a6, 32(s0)
1684 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a7, 40(s0)
1685 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a2, 0(s0)
1686 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a3, 8(s0)
1687 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a4, 16(s0)
1688 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a5, 24(s0)
1689 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a3, s0, 8
1690 ; LP64-LP64F-LP64D-WITHFP-NEXT: add a0, a1, a2
1691 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a3, -24(s0)
1692 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
1693 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
1694 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, 80
1695 ; LP64-LP64F-LP64D-WITHFP-NEXT: ret
1697 ; LP64E-FPELIM-LABEL: va3_va_arg:
1698 ; LP64E-FPELIM: # %bb.0:
1699 ; LP64E-FPELIM-NEXT: addi sp, sp, -40
1700 ; LP64E-FPELIM-NEXT: sd a2, 8(sp)
1701 ; LP64E-FPELIM-NEXT: sd a3, 16(sp)
1702 ; LP64E-FPELIM-NEXT: sd a4, 24(sp)
1703 ; LP64E-FPELIM-NEXT: sd a5, 32(sp)
1704 ; LP64E-FPELIM-NEXT: addi a3, sp, 16
1705 ; LP64E-FPELIM-NEXT: add a0, a1, a2
1706 ; LP64E-FPELIM-NEXT: sd a3, 0(sp)
1707 ; LP64E-FPELIM-NEXT: addi sp, sp, 40
1708 ; LP64E-FPELIM-NEXT: ret
1710 ; LP64E-WITHFP-LABEL: va3_va_arg:
1711 ; LP64E-WITHFP: # %bb.0:
1712 ; LP64E-WITHFP-NEXT: addi sp, sp, -56
1713 ; LP64E-WITHFP-NEXT: sd ra, 16(sp) # 8-byte Folded Spill
1714 ; LP64E-WITHFP-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
1715 ; LP64E-WITHFP-NEXT: addi s0, sp, 24
1716 ; LP64E-WITHFP-NEXT: sd a2, 0(s0)
1717 ; LP64E-WITHFP-NEXT: sd a3, 8(s0)
1718 ; LP64E-WITHFP-NEXT: sd a4, 16(s0)
1719 ; LP64E-WITHFP-NEXT: sd a5, 24(s0)
1720 ; LP64E-WITHFP-NEXT: addi a3, s0, 8
1721 ; LP64E-WITHFP-NEXT: add a0, a1, a2
1722 ; LP64E-WITHFP-NEXT: sd a3, -24(s0)
1723 ; LP64E-WITHFP-NEXT: ld ra, 16(sp) # 8-byte Folded Reload
1724 ; LP64E-WITHFP-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
1725 ; LP64E-WITHFP-NEXT: addi sp, sp, 56
1726 ; LP64E-WITHFP-NEXT: ret
1728 call void @llvm.va_start(ptr %va)
1729 %1 = va_arg ptr %va, double
1730 call void @llvm.va_end(ptr %va)
1731 %2 = bitcast double %1 to i64
1736 define void @va3_caller() nounwind {
1737 ; ILP32-ILP32F-FPELIM-LABEL: va3_caller:
1738 ; ILP32-ILP32F-FPELIM: # %bb.0:
1739 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, -16
1740 ; ILP32-ILP32F-FPELIM-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1741 ; ILP32-ILP32F-FPELIM-NEXT: li a0, 2
1742 ; ILP32-ILP32F-FPELIM-NEXT: li a1, 1111
1743 ; ILP32-ILP32F-FPELIM-NEXT: lui a5, 262144
1744 ; ILP32-ILP32F-FPELIM-NEXT: li a2, 0
1745 ; ILP32-ILP32F-FPELIM-NEXT: li a4, 0
1746 ; ILP32-ILP32F-FPELIM-NEXT: call va3
1747 ; ILP32-ILP32F-FPELIM-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1748 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, 16
1749 ; ILP32-ILP32F-FPELIM-NEXT: ret
1751 ; ILP32-ILP32F-WITHFP-LABEL: va3_caller:
1752 ; ILP32-ILP32F-WITHFP: # %bb.0:
1753 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, -16
1754 ; ILP32-ILP32F-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1755 ; ILP32-ILP32F-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
1756 ; ILP32-ILP32F-WITHFP-NEXT: addi s0, sp, 16
1757 ; ILP32-ILP32F-WITHFP-NEXT: li a0, 2
1758 ; ILP32-ILP32F-WITHFP-NEXT: li a1, 1111
1759 ; ILP32-ILP32F-WITHFP-NEXT: lui a5, 262144
1760 ; ILP32-ILP32F-WITHFP-NEXT: li a2, 0
1761 ; ILP32-ILP32F-WITHFP-NEXT: li a4, 0
1762 ; ILP32-ILP32F-WITHFP-NEXT: call va3
1763 ; ILP32-ILP32F-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1764 ; ILP32-ILP32F-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
1765 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, 16
1766 ; ILP32-ILP32F-WITHFP-NEXT: ret
1768 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-LABEL: va3_caller:
1769 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM: # %bb.0:
1770 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, -16
1771 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1772 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a0, 2
1773 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a1, 1111
1774 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a5, 262144
1775 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a2, 0
1776 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a4, 0
1777 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: call va3
1778 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1779 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, 16
1780 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: ret
1782 ; ILP32E-FPELIM-LABEL: va3_caller:
1783 ; ILP32E-FPELIM: # %bb.0:
1784 ; ILP32E-FPELIM-NEXT: addi sp, sp, -4
1785 ; ILP32E-FPELIM-NEXT: sw ra, 0(sp) # 4-byte Folded Spill
1786 ; ILP32E-FPELIM-NEXT: li a0, 2
1787 ; ILP32E-FPELIM-NEXT: li a1, 1111
1788 ; ILP32E-FPELIM-NEXT: lui a4, 262144
1789 ; ILP32E-FPELIM-NEXT: li a2, 0
1790 ; ILP32E-FPELIM-NEXT: li a3, 0
1791 ; ILP32E-FPELIM-NEXT: call va3
1792 ; ILP32E-FPELIM-NEXT: lw ra, 0(sp) # 4-byte Folded Reload
1793 ; ILP32E-FPELIM-NEXT: addi sp, sp, 4
1794 ; ILP32E-FPELIM-NEXT: ret
1796 ; ILP32E-WITHFP-LABEL: va3_caller:
1797 ; ILP32E-WITHFP: # %bb.0:
1798 ; ILP32E-WITHFP-NEXT: addi sp, sp, -8
1799 ; ILP32E-WITHFP-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
1800 ; ILP32E-WITHFP-NEXT: sw s0, 0(sp) # 4-byte Folded Spill
1801 ; ILP32E-WITHFP-NEXT: addi s0, sp, 8
1802 ; ILP32E-WITHFP-NEXT: li a0, 2
1803 ; ILP32E-WITHFP-NEXT: li a1, 1111
1804 ; ILP32E-WITHFP-NEXT: lui a4, 262144
1805 ; ILP32E-WITHFP-NEXT: li a2, 0
1806 ; ILP32E-WITHFP-NEXT: li a3, 0
1807 ; ILP32E-WITHFP-NEXT: call va3
1808 ; ILP32E-WITHFP-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
1809 ; ILP32E-WITHFP-NEXT: lw s0, 0(sp) # 4-byte Folded Reload
1810 ; ILP32E-WITHFP-NEXT: addi sp, sp, 8
1811 ; ILP32E-WITHFP-NEXT: ret
1813 ; LP64-LP64F-LP64D-FPELIM-LABEL: va3_caller:
1814 ; LP64-LP64F-LP64D-FPELIM: # %bb.0:
1815 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, -16
1816 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1817 ; LP64-LP64F-LP64D-FPELIM-NEXT: li a2, 1
1818 ; LP64-LP64F-LP64D-FPELIM-NEXT: li a0, 2
1819 ; LP64-LP64F-LP64D-FPELIM-NEXT: slli a2, a2, 62
1820 ; LP64-LP64F-LP64D-FPELIM-NEXT: li a1, 1111
1821 ; LP64-LP64F-LP64D-FPELIM-NEXT: call va3
1822 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1823 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, 16
1824 ; LP64-LP64F-LP64D-FPELIM-NEXT: ret
1826 ; LP64-LP64F-LP64D-WITHFP-LABEL: va3_caller:
1827 ; LP64-LP64F-LP64D-WITHFP: # %bb.0:
1828 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, -16
1829 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1830 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s0, 0(sp) # 8-byte Folded Spill
1831 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi s0, sp, 16
1832 ; LP64-LP64F-LP64D-WITHFP-NEXT: li a2, 1
1833 ; LP64-LP64F-LP64D-WITHFP-NEXT: li a0, 2
1834 ; LP64-LP64F-LP64D-WITHFP-NEXT: slli a2, a2, 62
1835 ; LP64-LP64F-LP64D-WITHFP-NEXT: li a1, 1111
1836 ; LP64-LP64F-LP64D-WITHFP-NEXT: call va3
1837 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1838 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s0, 0(sp) # 8-byte Folded Reload
1839 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, 16
1840 ; LP64-LP64F-LP64D-WITHFP-NEXT: ret
1842 ; LP64E-FPELIM-LABEL: va3_caller:
1843 ; LP64E-FPELIM: # %bb.0:
1844 ; LP64E-FPELIM-NEXT: addi sp, sp, -8
1845 ; LP64E-FPELIM-NEXT: sd ra, 0(sp) # 8-byte Folded Spill
1846 ; LP64E-FPELIM-NEXT: li a2, 1
1847 ; LP64E-FPELIM-NEXT: li a0, 2
1848 ; LP64E-FPELIM-NEXT: slli a2, a2, 62
1849 ; LP64E-FPELIM-NEXT: li a1, 1111
1850 ; LP64E-FPELIM-NEXT: call va3
1851 ; LP64E-FPELIM-NEXT: ld ra, 0(sp) # 8-byte Folded Reload
1852 ; LP64E-FPELIM-NEXT: addi sp, sp, 8
1853 ; LP64E-FPELIM-NEXT: ret
1855 ; LP64E-WITHFP-LABEL: va3_caller:
1856 ; LP64E-WITHFP: # %bb.0:
1857 ; LP64E-WITHFP-NEXT: addi sp, sp, -16
1858 ; LP64E-WITHFP-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1859 ; LP64E-WITHFP-NEXT: sd s0, 0(sp) # 8-byte Folded Spill
1860 ; LP64E-WITHFP-NEXT: addi s0, sp, 16
1861 ; LP64E-WITHFP-NEXT: li a2, 1
1862 ; LP64E-WITHFP-NEXT: li a0, 2
1863 ; LP64E-WITHFP-NEXT: slli a2, a2, 62
1864 ; LP64E-WITHFP-NEXT: li a1, 1111
1865 ; LP64E-WITHFP-NEXT: call va3
1866 ; LP64E-WITHFP-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1867 ; LP64E-WITHFP-NEXT: ld s0, 0(sp) # 8-byte Folded Reload
1868 ; LP64E-WITHFP-NEXT: addi sp, sp, 16
1869 ; LP64E-WITHFP-NEXT: ret
1870 %1 = call i64 (i32, i64, ...) @va3(i32 2, i64 1111, double 2.000000e+00)
1874 declare void @llvm.va_copy(ptr, ptr)
1876 define i32 @va4_va_copy(i32 %argno, ...) nounwind {
1877 ; ILP32-ILP32F-FPELIM-LABEL: va4_va_copy:
1878 ; ILP32-ILP32F-FPELIM: # %bb.0:
1879 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, -48
1880 ; ILP32-ILP32F-FPELIM-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1881 ; ILP32-ILP32F-FPELIM-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
1882 ; ILP32-ILP32F-FPELIM-NEXT: mv s0, a1
1883 ; ILP32-ILP32F-FPELIM-NEXT: sw a5, 36(sp)
1884 ; ILP32-ILP32F-FPELIM-NEXT: sw a6, 40(sp)
1885 ; ILP32-ILP32F-FPELIM-NEXT: sw a7, 44(sp)
1886 ; ILP32-ILP32F-FPELIM-NEXT: sw a1, 20(sp)
1887 ; ILP32-ILP32F-FPELIM-NEXT: sw a2, 24(sp)
1888 ; ILP32-ILP32F-FPELIM-NEXT: sw a3, 28(sp)
1889 ; ILP32-ILP32F-FPELIM-NEXT: sw a4, 32(sp)
1890 ; ILP32-ILP32F-FPELIM-NEXT: addi a0, sp, 24
1891 ; ILP32-ILP32F-FPELIM-NEXT: sw a0, 4(sp)
1892 ; ILP32-ILP32F-FPELIM-NEXT: sw a0, 0(sp)
1893 ; ILP32-ILP32F-FPELIM-NEXT: call notdead
1894 ; ILP32-ILP32F-FPELIM-NEXT: lw a0, 4(sp)
1895 ; ILP32-ILP32F-FPELIM-NEXT: addi a0, a0, 3
1896 ; ILP32-ILP32F-FPELIM-NEXT: andi a0, a0, -4
1897 ; ILP32-ILP32F-FPELIM-NEXT: addi a1, a0, 4
1898 ; ILP32-ILP32F-FPELIM-NEXT: addi a2, a0, 7
1899 ; ILP32-ILP32F-FPELIM-NEXT: sw a1, 4(sp)
1900 ; ILP32-ILP32F-FPELIM-NEXT: andi a2, a2, -4
1901 ; ILP32-ILP32F-FPELIM-NEXT: lw a0, 0(a0)
1902 ; ILP32-ILP32F-FPELIM-NEXT: addi a1, a2, 4
1903 ; ILP32-ILP32F-FPELIM-NEXT: addi a3, a2, 7
1904 ; ILP32-ILP32F-FPELIM-NEXT: sw a1, 4(sp)
1905 ; ILP32-ILP32F-FPELIM-NEXT: andi a3, a3, -4
1906 ; ILP32-ILP32F-FPELIM-NEXT: lw a1, 0(a2)
1907 ; ILP32-ILP32F-FPELIM-NEXT: addi a2, a3, 4
1908 ; ILP32-ILP32F-FPELIM-NEXT: sw a2, 4(sp)
1909 ; ILP32-ILP32F-FPELIM-NEXT: lw a2, 0(a3)
1910 ; ILP32-ILP32F-FPELIM-NEXT: add a0, a0, s0
1911 ; ILP32-ILP32F-FPELIM-NEXT: add a0, a0, a1
1912 ; ILP32-ILP32F-FPELIM-NEXT: add a0, a0, a2
1913 ; ILP32-ILP32F-FPELIM-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1914 ; ILP32-ILP32F-FPELIM-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
1915 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, 48
1916 ; ILP32-ILP32F-FPELIM-NEXT: ret
1918 ; ILP32-ILP32F-WITHFP-LABEL: va4_va_copy:
1919 ; ILP32-ILP32F-WITHFP: # %bb.0:
1920 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, -64
1921 ; ILP32-ILP32F-WITHFP-NEXT: sw ra, 28(sp) # 4-byte Folded Spill
1922 ; ILP32-ILP32F-WITHFP-NEXT: sw s0, 24(sp) # 4-byte Folded Spill
1923 ; ILP32-ILP32F-WITHFP-NEXT: sw s1, 20(sp) # 4-byte Folded Spill
1924 ; ILP32-ILP32F-WITHFP-NEXT: addi s0, sp, 32
1925 ; ILP32-ILP32F-WITHFP-NEXT: mv s1, a1
1926 ; ILP32-ILP32F-WITHFP-NEXT: sw a5, 20(s0)
1927 ; ILP32-ILP32F-WITHFP-NEXT: sw a6, 24(s0)
1928 ; ILP32-ILP32F-WITHFP-NEXT: sw a7, 28(s0)
1929 ; ILP32-ILP32F-WITHFP-NEXT: sw a1, 4(s0)
1930 ; ILP32-ILP32F-WITHFP-NEXT: sw a2, 8(s0)
1931 ; ILP32-ILP32F-WITHFP-NEXT: sw a3, 12(s0)
1932 ; ILP32-ILP32F-WITHFP-NEXT: sw a4, 16(s0)
1933 ; ILP32-ILP32F-WITHFP-NEXT: addi a0, s0, 8
1934 ; ILP32-ILP32F-WITHFP-NEXT: sw a0, -16(s0)
1935 ; ILP32-ILP32F-WITHFP-NEXT: sw a0, -20(s0)
1936 ; ILP32-ILP32F-WITHFP-NEXT: call notdead
1937 ; ILP32-ILP32F-WITHFP-NEXT: lw a0, -16(s0)
1938 ; ILP32-ILP32F-WITHFP-NEXT: addi a0, a0, 3
1939 ; ILP32-ILP32F-WITHFP-NEXT: andi a0, a0, -4
1940 ; ILP32-ILP32F-WITHFP-NEXT: addi a1, a0, 4
1941 ; ILP32-ILP32F-WITHFP-NEXT: addi a2, a0, 7
1942 ; ILP32-ILP32F-WITHFP-NEXT: sw a1, -16(s0)
1943 ; ILP32-ILP32F-WITHFP-NEXT: andi a2, a2, -4
1944 ; ILP32-ILP32F-WITHFP-NEXT: lw a0, 0(a0)
1945 ; ILP32-ILP32F-WITHFP-NEXT: addi a1, a2, 4
1946 ; ILP32-ILP32F-WITHFP-NEXT: addi a3, a2, 7
1947 ; ILP32-ILP32F-WITHFP-NEXT: sw a1, -16(s0)
1948 ; ILP32-ILP32F-WITHFP-NEXT: andi a3, a3, -4
1949 ; ILP32-ILP32F-WITHFP-NEXT: lw a1, 0(a2)
1950 ; ILP32-ILP32F-WITHFP-NEXT: addi a2, a3, 4
1951 ; ILP32-ILP32F-WITHFP-NEXT: sw a2, -16(s0)
1952 ; ILP32-ILP32F-WITHFP-NEXT: lw a2, 0(a3)
1953 ; ILP32-ILP32F-WITHFP-NEXT: add a0, a0, s1
1954 ; ILP32-ILP32F-WITHFP-NEXT: add a0, a0, a1
1955 ; ILP32-ILP32F-WITHFP-NEXT: add a0, a0, a2
1956 ; ILP32-ILP32F-WITHFP-NEXT: lw ra, 28(sp) # 4-byte Folded Reload
1957 ; ILP32-ILP32F-WITHFP-NEXT: lw s0, 24(sp) # 4-byte Folded Reload
1958 ; ILP32-ILP32F-WITHFP-NEXT: lw s1, 20(sp) # 4-byte Folded Reload
1959 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, 64
1960 ; ILP32-ILP32F-WITHFP-NEXT: ret
1962 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-LABEL: va4_va_copy:
1963 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM: # %bb.0:
1964 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, -48
1965 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1966 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
1967 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: mv s0, a1
1968 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a5, 36(sp)
1969 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a6, 40(sp)
1970 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a7, 44(sp)
1971 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 20(sp)
1972 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a2, 24(sp)
1973 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a3, 28(sp)
1974 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a4, 32(sp)
1975 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a0, sp, 24
1976 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a0, 4(sp)
1977 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a0, 0(sp)
1978 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: call notdead
1979 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw a0, 4(sp)
1980 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a0, a0, 3
1981 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: andi a0, a0, -4
1982 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a1, a0, 4
1983 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a2, a0, 7
1984 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 4(sp)
1985 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: andi a2, a2, -4
1986 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw a0, 0(a0)
1987 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a1, a2, 4
1988 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a3, a2, 7
1989 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 4(sp)
1990 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: andi a3, a3, -4
1991 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw a1, 0(a2)
1992 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a2, a3, 4
1993 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a2, 4(sp)
1994 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw a2, 0(a3)
1995 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a0, a0, s0
1996 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a0, a0, a1
1997 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a0, a0, a2
1998 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1999 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
2000 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, 48
2001 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: ret
2003 ; ILP32E-FPELIM-LABEL: va4_va_copy:
2004 ; ILP32E-FPELIM: # %bb.0:
2005 ; ILP32E-FPELIM-NEXT: addi sp, sp, -40
2006 ; ILP32E-FPELIM-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
2007 ; ILP32E-FPELIM-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
2008 ; ILP32E-FPELIM-NEXT: mv s0, a1
2009 ; ILP32E-FPELIM-NEXT: sw a5, 36(sp)
2010 ; ILP32E-FPELIM-NEXT: sw a1, 20(sp)
2011 ; ILP32E-FPELIM-NEXT: sw a2, 24(sp)
2012 ; ILP32E-FPELIM-NEXT: sw a3, 28(sp)
2013 ; ILP32E-FPELIM-NEXT: sw a4, 32(sp)
2014 ; ILP32E-FPELIM-NEXT: addi a0, sp, 24
2015 ; ILP32E-FPELIM-NEXT: sw a0, 4(sp)
2016 ; ILP32E-FPELIM-NEXT: sw a0, 0(sp)
2017 ; ILP32E-FPELIM-NEXT: call notdead
2018 ; ILP32E-FPELIM-NEXT: lw a0, 4(sp)
2019 ; ILP32E-FPELIM-NEXT: addi a0, a0, 3
2020 ; ILP32E-FPELIM-NEXT: andi a0, a0, -4
2021 ; ILP32E-FPELIM-NEXT: addi a1, a0, 4
2022 ; ILP32E-FPELIM-NEXT: addi a2, a0, 7
2023 ; ILP32E-FPELIM-NEXT: sw a1, 4(sp)
2024 ; ILP32E-FPELIM-NEXT: andi a2, a2, -4
2025 ; ILP32E-FPELIM-NEXT: lw a0, 0(a0)
2026 ; ILP32E-FPELIM-NEXT: addi a1, a2, 4
2027 ; ILP32E-FPELIM-NEXT: addi a3, a2, 7
2028 ; ILP32E-FPELIM-NEXT: sw a1, 4(sp)
2029 ; ILP32E-FPELIM-NEXT: andi a3, a3, -4
2030 ; ILP32E-FPELIM-NEXT: lw a1, 0(a2)
2031 ; ILP32E-FPELIM-NEXT: addi a2, a3, 4
2032 ; ILP32E-FPELIM-NEXT: sw a2, 4(sp)
2033 ; ILP32E-FPELIM-NEXT: lw a2, 0(a3)
2034 ; ILP32E-FPELIM-NEXT: add a0, a0, s0
2035 ; ILP32E-FPELIM-NEXT: add a0, a0, a1
2036 ; ILP32E-FPELIM-NEXT: add a0, a0, a2
2037 ; ILP32E-FPELIM-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
2038 ; ILP32E-FPELIM-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
2039 ; ILP32E-FPELIM-NEXT: addi sp, sp, 40
2040 ; ILP32E-FPELIM-NEXT: ret
2042 ; ILP32E-WITHFP-LABEL: va4_va_copy:
2043 ; ILP32E-WITHFP: # %bb.0:
2044 ; ILP32E-WITHFP-NEXT: addi sp, sp, -44
2045 ; ILP32E-WITHFP-NEXT: sw ra, 16(sp) # 4-byte Folded Spill
2046 ; ILP32E-WITHFP-NEXT: sw s0, 12(sp) # 4-byte Folded Spill
2047 ; ILP32E-WITHFP-NEXT: sw s1, 8(sp) # 4-byte Folded Spill
2048 ; ILP32E-WITHFP-NEXT: addi s0, sp, 20
2049 ; ILP32E-WITHFP-NEXT: mv s1, a1
2050 ; ILP32E-WITHFP-NEXT: sw a5, 20(s0)
2051 ; ILP32E-WITHFP-NEXT: sw a1, 4(s0)
2052 ; ILP32E-WITHFP-NEXT: sw a2, 8(s0)
2053 ; ILP32E-WITHFP-NEXT: sw a3, 12(s0)
2054 ; ILP32E-WITHFP-NEXT: sw a4, 16(s0)
2055 ; ILP32E-WITHFP-NEXT: addi a0, s0, 8
2056 ; ILP32E-WITHFP-NEXT: sw a0, -16(s0)
2057 ; ILP32E-WITHFP-NEXT: sw a0, -20(s0)
2058 ; ILP32E-WITHFP-NEXT: call notdead
2059 ; ILP32E-WITHFP-NEXT: lw a0, -16(s0)
2060 ; ILP32E-WITHFP-NEXT: addi a0, a0, 3
2061 ; ILP32E-WITHFP-NEXT: andi a0, a0, -4
2062 ; ILP32E-WITHFP-NEXT: addi a1, a0, 4
2063 ; ILP32E-WITHFP-NEXT: addi a2, a0, 7
2064 ; ILP32E-WITHFP-NEXT: sw a1, -16(s0)
2065 ; ILP32E-WITHFP-NEXT: andi a2, a2, -4
2066 ; ILP32E-WITHFP-NEXT: lw a0, 0(a0)
2067 ; ILP32E-WITHFP-NEXT: addi a1, a2, 4
2068 ; ILP32E-WITHFP-NEXT: addi a3, a2, 7
2069 ; ILP32E-WITHFP-NEXT: sw a1, -16(s0)
2070 ; ILP32E-WITHFP-NEXT: andi a3, a3, -4
2071 ; ILP32E-WITHFP-NEXT: lw a1, 0(a2)
2072 ; ILP32E-WITHFP-NEXT: addi a2, a3, 4
2073 ; ILP32E-WITHFP-NEXT: sw a2, -16(s0)
2074 ; ILP32E-WITHFP-NEXT: lw a2, 0(a3)
2075 ; ILP32E-WITHFP-NEXT: add a0, a0, s1
2076 ; ILP32E-WITHFP-NEXT: add a0, a0, a1
2077 ; ILP32E-WITHFP-NEXT: add a0, a0, a2
2078 ; ILP32E-WITHFP-NEXT: lw ra, 16(sp) # 4-byte Folded Reload
2079 ; ILP32E-WITHFP-NEXT: lw s0, 12(sp) # 4-byte Folded Reload
2080 ; ILP32E-WITHFP-NEXT: lw s1, 8(sp) # 4-byte Folded Reload
2081 ; ILP32E-WITHFP-NEXT: addi sp, sp, 44
2082 ; ILP32E-WITHFP-NEXT: ret
2084 ; LP64-LP64F-LP64D-FPELIM-LABEL: va4_va_copy:
2085 ; LP64-LP64F-LP64D-FPELIM: # %bb.0:
2086 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, -96
2087 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
2088 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
2089 ; LP64-LP64F-LP64D-FPELIM-NEXT: mv s0, a1
2090 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a5, 72(sp)
2091 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a6, 80(sp)
2092 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a7, 88(sp)
2093 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a1, 40(sp)
2094 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a2, 48(sp)
2095 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a3, 56(sp)
2096 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a4, 64(sp)
2097 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a0, sp, 48
2098 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a0, 8(sp)
2099 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a0, 0(sp)
2100 ; LP64-LP64F-LP64D-FPELIM-NEXT: call notdead
2101 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld a0, 8(sp)
2102 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a0, a0, 3
2103 ; LP64-LP64F-LP64D-FPELIM-NEXT: andi a0, a0, -4
2104 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a1, a0, 8
2105 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a2, a0, 11
2106 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a1, 8(sp)
2107 ; LP64-LP64F-LP64D-FPELIM-NEXT: andi a2, a2, -4
2108 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld a0, 0(a0)
2109 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a1, a2, 8
2110 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a3, a2, 11
2111 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a1, 8(sp)
2112 ; LP64-LP64F-LP64D-FPELIM-NEXT: andi a3, a3, -4
2113 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld a1, 0(a2)
2114 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a2, a3, 8
2115 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a2, 8(sp)
2116 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld a2, 0(a3)
2117 ; LP64-LP64F-LP64D-FPELIM-NEXT: add a0, a0, s0
2118 ; LP64-LP64F-LP64D-FPELIM-NEXT: add a0, a0, a1
2119 ; LP64-LP64F-LP64D-FPELIM-NEXT: addw a0, a0, a2
2120 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
2121 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
2122 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, 96
2123 ; LP64-LP64F-LP64D-FPELIM-NEXT: ret
2125 ; LP64-LP64F-LP64D-WITHFP-LABEL: va4_va_copy:
2126 ; LP64-LP64F-LP64D-WITHFP: # %bb.0:
2127 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, -112
2128 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd ra, 40(sp) # 8-byte Folded Spill
2129 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s0, 32(sp) # 8-byte Folded Spill
2130 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s1, 24(sp) # 8-byte Folded Spill
2131 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi s0, sp, 48
2132 ; LP64-LP64F-LP64D-WITHFP-NEXT: mv s1, a1
2133 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a5, 40(s0)
2134 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a6, 48(s0)
2135 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a7, 56(s0)
2136 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a1, 8(s0)
2137 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a2, 16(s0)
2138 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a3, 24(s0)
2139 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a4, 32(s0)
2140 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a0, s0, 16
2141 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a0, -32(s0)
2142 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a0, -40(s0)
2143 ; LP64-LP64F-LP64D-WITHFP-NEXT: call notdead
2144 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld a0, -32(s0)
2145 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a0, a0, 3
2146 ; LP64-LP64F-LP64D-WITHFP-NEXT: andi a0, a0, -4
2147 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a1, a0, 8
2148 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a2, a0, 11
2149 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a1, -32(s0)
2150 ; LP64-LP64F-LP64D-WITHFP-NEXT: andi a2, a2, -4
2151 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld a0, 0(a0)
2152 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a1, a2, 8
2153 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a3, a2, 11
2154 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a1, -32(s0)
2155 ; LP64-LP64F-LP64D-WITHFP-NEXT: andi a3, a3, -4
2156 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld a1, 0(a2)
2157 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a2, a3, 8
2158 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a2, -32(s0)
2159 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld a2, 0(a3)
2160 ; LP64-LP64F-LP64D-WITHFP-NEXT: add a0, a0, s1
2161 ; LP64-LP64F-LP64D-WITHFP-NEXT: add a0, a0, a1
2162 ; LP64-LP64F-LP64D-WITHFP-NEXT: addw a0, a0, a2
2163 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld ra, 40(sp) # 8-byte Folded Reload
2164 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s0, 32(sp) # 8-byte Folded Reload
2165 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s1, 24(sp) # 8-byte Folded Reload
2166 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, 112
2167 ; LP64-LP64F-LP64D-WITHFP-NEXT: ret
2169 ; LP64E-FPELIM-LABEL: va4_va_copy:
2170 ; LP64E-FPELIM: # %bb.0:
2171 ; LP64E-FPELIM-NEXT: addi sp, sp, -80
2172 ; LP64E-FPELIM-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
2173 ; LP64E-FPELIM-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
2174 ; LP64E-FPELIM-NEXT: mv s0, a1
2175 ; LP64E-FPELIM-NEXT: sd a5, 72(sp)
2176 ; LP64E-FPELIM-NEXT: sd a1, 40(sp)
2177 ; LP64E-FPELIM-NEXT: sd a2, 48(sp)
2178 ; LP64E-FPELIM-NEXT: sd a3, 56(sp)
2179 ; LP64E-FPELIM-NEXT: sd a4, 64(sp)
2180 ; LP64E-FPELIM-NEXT: addi a0, sp, 48
2181 ; LP64E-FPELIM-NEXT: sd a0, 8(sp)
2182 ; LP64E-FPELIM-NEXT: sd a0, 0(sp)
2183 ; LP64E-FPELIM-NEXT: call notdead
2184 ; LP64E-FPELIM-NEXT: ld a0, 8(sp)
2185 ; LP64E-FPELIM-NEXT: addi a0, a0, 3
2186 ; LP64E-FPELIM-NEXT: andi a0, a0, -4
2187 ; LP64E-FPELIM-NEXT: addi a1, a0, 8
2188 ; LP64E-FPELIM-NEXT: addi a2, a0, 11
2189 ; LP64E-FPELIM-NEXT: sd a1, 8(sp)
2190 ; LP64E-FPELIM-NEXT: andi a2, a2, -4
2191 ; LP64E-FPELIM-NEXT: ld a0, 0(a0)
2192 ; LP64E-FPELIM-NEXT: addi a1, a2, 8
2193 ; LP64E-FPELIM-NEXT: addi a3, a2, 11
2194 ; LP64E-FPELIM-NEXT: sd a1, 8(sp)
2195 ; LP64E-FPELIM-NEXT: andi a3, a3, -4
2196 ; LP64E-FPELIM-NEXT: ld a1, 0(a2)
2197 ; LP64E-FPELIM-NEXT: addi a2, a3, 8
2198 ; LP64E-FPELIM-NEXT: sd a2, 8(sp)
2199 ; LP64E-FPELIM-NEXT: ld a2, 0(a3)
2200 ; LP64E-FPELIM-NEXT: add a0, a0, s0
2201 ; LP64E-FPELIM-NEXT: add a0, a0, a1
2202 ; LP64E-FPELIM-NEXT: addw a0, a0, a2
2203 ; LP64E-FPELIM-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
2204 ; LP64E-FPELIM-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
2205 ; LP64E-FPELIM-NEXT: addi sp, sp, 80
2206 ; LP64E-FPELIM-NEXT: ret
2208 ; LP64E-WITHFP-LABEL: va4_va_copy:
2209 ; LP64E-WITHFP: # %bb.0:
2210 ; LP64E-WITHFP-NEXT: addi sp, sp, -88
2211 ; LP64E-WITHFP-NEXT: sd ra, 32(sp) # 8-byte Folded Spill
2212 ; LP64E-WITHFP-NEXT: sd s0, 24(sp) # 8-byte Folded Spill
2213 ; LP64E-WITHFP-NEXT: sd s1, 16(sp) # 8-byte Folded Spill
2214 ; LP64E-WITHFP-NEXT: addi s0, sp, 40
2215 ; LP64E-WITHFP-NEXT: mv s1, a1
2216 ; LP64E-WITHFP-NEXT: sd a5, 40(s0)
2217 ; LP64E-WITHFP-NEXT: sd a1, 8(s0)
2218 ; LP64E-WITHFP-NEXT: sd a2, 16(s0)
2219 ; LP64E-WITHFP-NEXT: sd a3, 24(s0)
2220 ; LP64E-WITHFP-NEXT: sd a4, 32(s0)
2221 ; LP64E-WITHFP-NEXT: addi a0, s0, 16
2222 ; LP64E-WITHFP-NEXT: sd a0, -32(s0)
2223 ; LP64E-WITHFP-NEXT: sd a0, -40(s0)
2224 ; LP64E-WITHFP-NEXT: call notdead
2225 ; LP64E-WITHFP-NEXT: ld a0, -32(s0)
2226 ; LP64E-WITHFP-NEXT: addi a0, a0, 3
2227 ; LP64E-WITHFP-NEXT: andi a0, a0, -4
2228 ; LP64E-WITHFP-NEXT: addi a1, a0, 8
2229 ; LP64E-WITHFP-NEXT: addi a2, a0, 11
2230 ; LP64E-WITHFP-NEXT: sd a1, -32(s0)
2231 ; LP64E-WITHFP-NEXT: andi a2, a2, -4
2232 ; LP64E-WITHFP-NEXT: ld a0, 0(a0)
2233 ; LP64E-WITHFP-NEXT: addi a1, a2, 8
2234 ; LP64E-WITHFP-NEXT: addi a3, a2, 11
2235 ; LP64E-WITHFP-NEXT: sd a1, -32(s0)
2236 ; LP64E-WITHFP-NEXT: andi a3, a3, -4
2237 ; LP64E-WITHFP-NEXT: ld a1, 0(a2)
2238 ; LP64E-WITHFP-NEXT: addi a2, a3, 8
2239 ; LP64E-WITHFP-NEXT: sd a2, -32(s0)
2240 ; LP64E-WITHFP-NEXT: ld a2, 0(a3)
2241 ; LP64E-WITHFP-NEXT: add a0, a0, s1
2242 ; LP64E-WITHFP-NEXT: add a0, a0, a1
2243 ; LP64E-WITHFP-NEXT: addw a0, a0, a2
2244 ; LP64E-WITHFP-NEXT: ld ra, 32(sp) # 8-byte Folded Reload
2245 ; LP64E-WITHFP-NEXT: ld s0, 24(sp) # 8-byte Folded Reload
2246 ; LP64E-WITHFP-NEXT: ld s1, 16(sp) # 8-byte Folded Reload
2247 ; LP64E-WITHFP-NEXT: addi sp, sp, 88
2248 ; LP64E-WITHFP-NEXT: ret
2251 call void @llvm.va_start(ptr %vargs)
2252 %1 = va_arg ptr %vargs, i32
2253 call void @llvm.va_copy(ptr %wargs, ptr %vargs)
2254 %2 = load ptr, ptr %wargs, align 4
2255 call void @notdead(ptr %2)
2256 %3 = va_arg ptr %vargs, i32
2257 %4 = va_arg ptr %vargs, i32
2258 %5 = va_arg ptr %vargs, i32
2259 call void @llvm.va_end(ptr %vargs)
2260 call void @llvm.va_end(ptr %wargs)
2261 %add1 = add i32 %3, %1
2262 %add2 = add i32 %add1, %4
2263 %add3 = add i32 %add2, %5
2267 ; Check 2x*xlen values are aligned appropriately when passed on the stack in a vararg call
2269 declare i32 @va5_aligned_stack_callee(i32, ...)
2271 define void @va5_aligned_stack_caller() nounwind {
2272 ; The double should be 8-byte aligned on the stack, but the two-element array
2273 ; should only be 4-byte aligned
2274 ; ILP32-ILP32F-FPELIM-LABEL: va5_aligned_stack_caller:
2275 ; ILP32-ILP32F-FPELIM: # %bb.0:
2276 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, -64
2277 ; ILP32-ILP32F-FPELIM-NEXT: sw ra, 60(sp) # 4-byte Folded Spill
2278 ; ILP32-ILP32F-FPELIM-NEXT: li a4, 17
2279 ; ILP32-ILP32F-FPELIM-NEXT: li a5, 16
2280 ; ILP32-ILP32F-FPELIM-NEXT: li a6, 15
2281 ; ILP32-ILP32F-FPELIM-NEXT: lui a7, 262236
2282 ; ILP32-ILP32F-FPELIM-NEXT: lui t0, 377487
2283 ; ILP32-ILP32F-FPELIM-NEXT: li t1, 14
2284 ; ILP32-ILP32F-FPELIM-NEXT: lui t2, 262153
2285 ; ILP32-ILP32F-FPELIM-NEXT: lui t3, 545260
2286 ; ILP32-ILP32F-FPELIM-NEXT: lui t4, 964690
2287 ; ILP32-ILP32F-FPELIM-NEXT: lui t5, 335544
2288 ; ILP32-ILP32F-FPELIM-NEXT: lui t6, 688509
2289 ; ILP32-ILP32F-FPELIM-NEXT: li a0, 1
2290 ; ILP32-ILP32F-FPELIM-NEXT: li a1, 11
2291 ; ILP32-ILP32F-FPELIM-NEXT: addi a2, sp, 32
2292 ; ILP32-ILP32F-FPELIM-NEXT: li a3, 12
2293 ; ILP32-ILP32F-FPELIM-NEXT: sw a5, 20(sp)
2294 ; ILP32-ILP32F-FPELIM-NEXT: sw a4, 24(sp)
2295 ; ILP32-ILP32F-FPELIM-NEXT: li a4, 13
2296 ; ILP32-ILP32F-FPELIM-NEXT: addi a5, a7, 655
2297 ; ILP32-ILP32F-FPELIM-NEXT: addi a7, t0, 1475
2298 ; ILP32-ILP32F-FPELIM-NEXT: sw t1, 0(sp)
2299 ; ILP32-ILP32F-FPELIM-NEXT: sw a7, 8(sp)
2300 ; ILP32-ILP32F-FPELIM-NEXT: sw a5, 12(sp)
2301 ; ILP32-ILP32F-FPELIM-NEXT: sw a6, 16(sp)
2302 ; ILP32-ILP32F-FPELIM-NEXT: li a7, 4
2303 ; ILP32-ILP32F-FPELIM-NEXT: addi a5, t2, 491
2304 ; ILP32-ILP32F-FPELIM-NEXT: addi t0, t3, -1967
2305 ; ILP32-ILP32F-FPELIM-NEXT: addi t1, t4, -328
2306 ; ILP32-ILP32F-FPELIM-NEXT: addi t2, t5, 1311
2307 ; ILP32-ILP32F-FPELIM-NEXT: addi a6, t6, -2048
2308 ; ILP32-ILP32F-FPELIM-NEXT: sw t2, 32(sp)
2309 ; ILP32-ILP32F-FPELIM-NEXT: sw t1, 36(sp)
2310 ; ILP32-ILP32F-FPELIM-NEXT: sw t0, 40(sp)
2311 ; ILP32-ILP32F-FPELIM-NEXT: sw a5, 44(sp)
2312 ; ILP32-ILP32F-FPELIM-NEXT: call va5_aligned_stack_callee
2313 ; ILP32-ILP32F-FPELIM-NEXT: lw ra, 60(sp) # 4-byte Folded Reload
2314 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, 64
2315 ; ILP32-ILP32F-FPELIM-NEXT: ret
2317 ; ILP32-ILP32F-WITHFP-LABEL: va5_aligned_stack_caller:
2318 ; ILP32-ILP32F-WITHFP: # %bb.0:
2319 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, -64
2320 ; ILP32-ILP32F-WITHFP-NEXT: sw ra, 60(sp) # 4-byte Folded Spill
2321 ; ILP32-ILP32F-WITHFP-NEXT: sw s0, 56(sp) # 4-byte Folded Spill
2322 ; ILP32-ILP32F-WITHFP-NEXT: addi s0, sp, 64
2323 ; ILP32-ILP32F-WITHFP-NEXT: li a4, 17
2324 ; ILP32-ILP32F-WITHFP-NEXT: li a5, 16
2325 ; ILP32-ILP32F-WITHFP-NEXT: li a6, 15
2326 ; ILP32-ILP32F-WITHFP-NEXT: lui a7, 262236
2327 ; ILP32-ILP32F-WITHFP-NEXT: lui t0, 377487
2328 ; ILP32-ILP32F-WITHFP-NEXT: li t1, 14
2329 ; ILP32-ILP32F-WITHFP-NEXT: lui t2, 262153
2330 ; ILP32-ILP32F-WITHFP-NEXT: lui t3, 545260
2331 ; ILP32-ILP32F-WITHFP-NEXT: lui t4, 964690
2332 ; ILP32-ILP32F-WITHFP-NEXT: lui t5, 335544
2333 ; ILP32-ILP32F-WITHFP-NEXT: lui t6, 688509
2334 ; ILP32-ILP32F-WITHFP-NEXT: li a0, 1
2335 ; ILP32-ILP32F-WITHFP-NEXT: li a1, 11
2336 ; ILP32-ILP32F-WITHFP-NEXT: addi a2, s0, -32
2337 ; ILP32-ILP32F-WITHFP-NEXT: li a3, 12
2338 ; ILP32-ILP32F-WITHFP-NEXT: sw a5, 20(sp)
2339 ; ILP32-ILP32F-WITHFP-NEXT: sw a4, 24(sp)
2340 ; ILP32-ILP32F-WITHFP-NEXT: li a4, 13
2341 ; ILP32-ILP32F-WITHFP-NEXT: addi a5, a7, 655
2342 ; ILP32-ILP32F-WITHFP-NEXT: addi a7, t0, 1475
2343 ; ILP32-ILP32F-WITHFP-NEXT: sw t1, 0(sp)
2344 ; ILP32-ILP32F-WITHFP-NEXT: sw a7, 8(sp)
2345 ; ILP32-ILP32F-WITHFP-NEXT: sw a5, 12(sp)
2346 ; ILP32-ILP32F-WITHFP-NEXT: sw a6, 16(sp)
2347 ; ILP32-ILP32F-WITHFP-NEXT: li a7, 4
2348 ; ILP32-ILP32F-WITHFP-NEXT: addi a5, t2, 491
2349 ; ILP32-ILP32F-WITHFP-NEXT: addi t0, t3, -1967
2350 ; ILP32-ILP32F-WITHFP-NEXT: addi t1, t4, -328
2351 ; ILP32-ILP32F-WITHFP-NEXT: addi t2, t5, 1311
2352 ; ILP32-ILP32F-WITHFP-NEXT: addi a6, t6, -2048
2353 ; ILP32-ILP32F-WITHFP-NEXT: sw t2, -32(s0)
2354 ; ILP32-ILP32F-WITHFP-NEXT: sw t1, -28(s0)
2355 ; ILP32-ILP32F-WITHFP-NEXT: sw t0, -24(s0)
2356 ; ILP32-ILP32F-WITHFP-NEXT: sw a5, -20(s0)
2357 ; ILP32-ILP32F-WITHFP-NEXT: call va5_aligned_stack_callee
2358 ; ILP32-ILP32F-WITHFP-NEXT: lw ra, 60(sp) # 4-byte Folded Reload
2359 ; ILP32-ILP32F-WITHFP-NEXT: lw s0, 56(sp) # 4-byte Folded Reload
2360 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, 64
2361 ; ILP32-ILP32F-WITHFP-NEXT: ret
2363 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-LABEL: va5_aligned_stack_caller:
2364 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM: # %bb.0:
2365 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, -64
2366 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw ra, 60(sp) # 4-byte Folded Spill
2367 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a5, 262236
2368 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a6, 377487
2369 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a4, 17
2370 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a7, 16
2371 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li t0, 15
2372 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li t1, 14
2373 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui t2, 262153
2374 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui t3, 545260
2375 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui t4, 964690
2376 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui t5, 335544
2377 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui t6, 688509
2378 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a0, 1
2379 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a1, 11
2380 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a2, sp, 32
2381 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a3, 12
2382 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a7, 20(sp)
2383 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a4, 24(sp)
2384 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a4, 13
2385 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a5, a5, 655
2386 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a6, a6, 1475
2387 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw t1, 0(sp)
2388 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a6, 8(sp)
2389 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a5, 12(sp)
2390 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw t0, 16(sp)
2391 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a7, 4
2392 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a5, t2, 491
2393 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi t0, t3, -1967
2394 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi t1, t4, -328
2395 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi t2, t5, 1311
2396 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a6, t6, -2048
2397 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw t2, 32(sp)
2398 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw t1, 36(sp)
2399 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw t0, 40(sp)
2400 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a5, 44(sp)
2401 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: call va5_aligned_stack_callee
2402 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw ra, 60(sp) # 4-byte Folded Reload
2403 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, 64
2404 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: ret
2406 ; ILP32E-FPELIM-LABEL: va5_aligned_stack_caller:
2407 ; ILP32E-FPELIM: # %bb.0:
2408 ; ILP32E-FPELIM-NEXT: addi sp, sp, -64
2409 ; ILP32E-FPELIM-NEXT: sw ra, 60(sp) # 4-byte Folded Spill
2410 ; ILP32E-FPELIM-NEXT: sw s0, 56(sp) # 4-byte Folded Spill
2411 ; ILP32E-FPELIM-NEXT: addi s0, sp, 64
2412 ; ILP32E-FPELIM-NEXT: andi sp, sp, -16
2413 ; ILP32E-FPELIM-NEXT: li a3, 17
2414 ; ILP32E-FPELIM-NEXT: li a4, 16
2415 ; ILP32E-FPELIM-NEXT: li a5, 15
2416 ; ILP32E-FPELIM-NEXT: lui a6, 262236
2417 ; ILP32E-FPELIM-NEXT: lui a7, 377487
2418 ; ILP32E-FPELIM-NEXT: li t0, 14
2419 ; ILP32E-FPELIM-NEXT: li t1, 4
2420 ; ILP32E-FPELIM-NEXT: lui t2, 262153
2421 ; ILP32E-FPELIM-NEXT: lui t3, 545260
2422 ; ILP32E-FPELIM-NEXT: lui t4, 964690
2423 ; ILP32E-FPELIM-NEXT: lui t5, 335544
2424 ; ILP32E-FPELIM-NEXT: lui t6, 688509
2425 ; ILP32E-FPELIM-NEXT: li a0, 1
2426 ; ILP32E-FPELIM-NEXT: li a1, 11
2427 ; ILP32E-FPELIM-NEXT: addi a2, sp, 32
2428 ; ILP32E-FPELIM-NEXT: sw a5, 16(sp)
2429 ; ILP32E-FPELIM-NEXT: sw a4, 20(sp)
2430 ; ILP32E-FPELIM-NEXT: sw a3, 24(sp)
2431 ; ILP32E-FPELIM-NEXT: li a3, 12
2432 ; ILP32E-FPELIM-NEXT: addi a4, a6, 655
2433 ; ILP32E-FPELIM-NEXT: addi a5, a7, 1475
2434 ; ILP32E-FPELIM-NEXT: sw t1, 0(sp)
2435 ; ILP32E-FPELIM-NEXT: sw t0, 4(sp)
2436 ; ILP32E-FPELIM-NEXT: sw a5, 8(sp)
2437 ; ILP32E-FPELIM-NEXT: sw a4, 12(sp)
2438 ; ILP32E-FPELIM-NEXT: li a4, 13
2439 ; ILP32E-FPELIM-NEXT: addi a6, t2, 491
2440 ; ILP32E-FPELIM-NEXT: addi a7, t3, -1967
2441 ; ILP32E-FPELIM-NEXT: addi t0, t4, -328
2442 ; ILP32E-FPELIM-NEXT: addi t1, t5, 1311
2443 ; ILP32E-FPELIM-NEXT: addi a5, t6, -2048
2444 ; ILP32E-FPELIM-NEXT: sw t1, 32(sp)
2445 ; ILP32E-FPELIM-NEXT: sw t0, 36(sp)
2446 ; ILP32E-FPELIM-NEXT: sw a7, 40(sp)
2447 ; ILP32E-FPELIM-NEXT: sw a6, 44(sp)
2448 ; ILP32E-FPELIM-NEXT: call va5_aligned_stack_callee
2449 ; ILP32E-FPELIM-NEXT: addi sp, s0, -64
2450 ; ILP32E-FPELIM-NEXT: lw ra, 60(sp) # 4-byte Folded Reload
2451 ; ILP32E-FPELIM-NEXT: lw s0, 56(sp) # 4-byte Folded Reload
2452 ; ILP32E-FPELIM-NEXT: addi sp, sp, 64
2453 ; ILP32E-FPELIM-NEXT: ret
2455 ; ILP32E-WITHFP-LABEL: va5_aligned_stack_caller:
2456 ; ILP32E-WITHFP: # %bb.0:
2457 ; ILP32E-WITHFP-NEXT: addi sp, sp, -64
2458 ; ILP32E-WITHFP-NEXT: sw ra, 60(sp) # 4-byte Folded Spill
2459 ; ILP32E-WITHFP-NEXT: sw s0, 56(sp) # 4-byte Folded Spill
2460 ; ILP32E-WITHFP-NEXT: addi s0, sp, 64
2461 ; ILP32E-WITHFP-NEXT: andi sp, sp, -16
2462 ; ILP32E-WITHFP-NEXT: li a3, 17
2463 ; ILP32E-WITHFP-NEXT: li a4, 16
2464 ; ILP32E-WITHFP-NEXT: li a5, 15
2465 ; ILP32E-WITHFP-NEXT: lui a6, 262236
2466 ; ILP32E-WITHFP-NEXT: lui a7, 377487
2467 ; ILP32E-WITHFP-NEXT: li t0, 14
2468 ; ILP32E-WITHFP-NEXT: li t1, 4
2469 ; ILP32E-WITHFP-NEXT: lui t2, 262153
2470 ; ILP32E-WITHFP-NEXT: lui t3, 545260
2471 ; ILP32E-WITHFP-NEXT: lui t4, 964690
2472 ; ILP32E-WITHFP-NEXT: lui t5, 335544
2473 ; ILP32E-WITHFP-NEXT: lui t6, 688509
2474 ; ILP32E-WITHFP-NEXT: li a0, 1
2475 ; ILP32E-WITHFP-NEXT: li a1, 11
2476 ; ILP32E-WITHFP-NEXT: addi a2, sp, 32
2477 ; ILP32E-WITHFP-NEXT: sw a5, 16(sp)
2478 ; ILP32E-WITHFP-NEXT: sw a4, 20(sp)
2479 ; ILP32E-WITHFP-NEXT: sw a3, 24(sp)
2480 ; ILP32E-WITHFP-NEXT: li a3, 12
2481 ; ILP32E-WITHFP-NEXT: addi a4, a6, 655
2482 ; ILP32E-WITHFP-NEXT: addi a5, a7, 1475
2483 ; ILP32E-WITHFP-NEXT: sw t1, 0(sp)
2484 ; ILP32E-WITHFP-NEXT: sw t0, 4(sp)
2485 ; ILP32E-WITHFP-NEXT: sw a5, 8(sp)
2486 ; ILP32E-WITHFP-NEXT: sw a4, 12(sp)
2487 ; ILP32E-WITHFP-NEXT: li a4, 13
2488 ; ILP32E-WITHFP-NEXT: addi a6, t2, 491
2489 ; ILP32E-WITHFP-NEXT: addi a7, t3, -1967
2490 ; ILP32E-WITHFP-NEXT: addi t0, t4, -328
2491 ; ILP32E-WITHFP-NEXT: addi t1, t5, 1311
2492 ; ILP32E-WITHFP-NEXT: addi a5, t6, -2048
2493 ; ILP32E-WITHFP-NEXT: sw t1, 32(sp)
2494 ; ILP32E-WITHFP-NEXT: sw t0, 36(sp)
2495 ; ILP32E-WITHFP-NEXT: sw a7, 40(sp)
2496 ; ILP32E-WITHFP-NEXT: sw a6, 44(sp)
2497 ; ILP32E-WITHFP-NEXT: call va5_aligned_stack_callee
2498 ; ILP32E-WITHFP-NEXT: addi sp, s0, -64
2499 ; ILP32E-WITHFP-NEXT: lw ra, 60(sp) # 4-byte Folded Reload
2500 ; ILP32E-WITHFP-NEXT: lw s0, 56(sp) # 4-byte Folded Reload
2501 ; ILP32E-WITHFP-NEXT: addi sp, sp, 64
2502 ; ILP32E-WITHFP-NEXT: ret
2504 ; LP64-LP64F-LP64D-FPELIM-LABEL: va5_aligned_stack_caller:
2505 ; LP64-LP64F-LP64D-FPELIM: # %bb.0:
2506 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, -48
2507 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd ra, 40(sp) # 8-byte Folded Spill
2508 ; LP64-LP64F-LP64D-FPELIM-NEXT: li t0, 17
2509 ; LP64-LP64F-LP64D-FPELIM-NEXT: li t1, 16
2510 ; LP64-LP64F-LP64D-FPELIM-NEXT: li t2, 15
2511 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui a2, %hi(.LCPI11_0)
2512 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui a3, %hi(.LCPI11_1)
2513 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui a6, %hi(.LCPI11_2)
2514 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui t3, 2384
2515 ; LP64-LP64F-LP64D-FPELIM-NEXT: li a0, 1
2516 ; LP64-LP64F-LP64D-FPELIM-NEXT: li a1, 11
2517 ; LP64-LP64F-LP64D-FPELIM-NEXT: li a4, 12
2518 ; LP64-LP64F-LP64D-FPELIM-NEXT: li a5, 13
2519 ; LP64-LP64F-LP64D-FPELIM-NEXT: li a7, 14
2520 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld t4, %lo(.LCPI11_0)(a2)
2521 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld a2, %lo(.LCPI11_1)(a3)
2522 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld a3, %lo(.LCPI11_2)(a6)
2523 ; LP64-LP64F-LP64D-FPELIM-NEXT: addiw a6, t3, 761
2524 ; LP64-LP64F-LP64D-FPELIM-NEXT: slli a6, a6, 11
2525 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd t4, 0(sp)
2526 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd t2, 8(sp)
2527 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd t1, 16(sp)
2528 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd t0, 24(sp)
2529 ; LP64-LP64F-LP64D-FPELIM-NEXT: call va5_aligned_stack_callee
2530 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld ra, 40(sp) # 8-byte Folded Reload
2531 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, 48
2532 ; LP64-LP64F-LP64D-FPELIM-NEXT: ret
2534 ; LP64-LP64F-LP64D-WITHFP-LABEL: va5_aligned_stack_caller:
2535 ; LP64-LP64F-LP64D-WITHFP: # %bb.0:
2536 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, -48
2537 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd ra, 40(sp) # 8-byte Folded Spill
2538 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s0, 32(sp) # 8-byte Folded Spill
2539 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi s0, sp, 48
2540 ; LP64-LP64F-LP64D-WITHFP-NEXT: li t0, 17
2541 ; LP64-LP64F-LP64D-WITHFP-NEXT: li t1, 16
2542 ; LP64-LP64F-LP64D-WITHFP-NEXT: li t2, 15
2543 ; LP64-LP64F-LP64D-WITHFP-NEXT: lui a2, %hi(.LCPI11_0)
2544 ; LP64-LP64F-LP64D-WITHFP-NEXT: lui a3, %hi(.LCPI11_1)
2545 ; LP64-LP64F-LP64D-WITHFP-NEXT: lui a6, %hi(.LCPI11_2)
2546 ; LP64-LP64F-LP64D-WITHFP-NEXT: lui t3, 2384
2547 ; LP64-LP64F-LP64D-WITHFP-NEXT: li a0, 1
2548 ; LP64-LP64F-LP64D-WITHFP-NEXT: li a1, 11
2549 ; LP64-LP64F-LP64D-WITHFP-NEXT: li a4, 12
2550 ; LP64-LP64F-LP64D-WITHFP-NEXT: li a5, 13
2551 ; LP64-LP64F-LP64D-WITHFP-NEXT: li a7, 14
2552 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld t4, %lo(.LCPI11_0)(a2)
2553 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld a2, %lo(.LCPI11_1)(a3)
2554 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld a3, %lo(.LCPI11_2)(a6)
2555 ; LP64-LP64F-LP64D-WITHFP-NEXT: addiw a6, t3, 761
2556 ; LP64-LP64F-LP64D-WITHFP-NEXT: slli a6, a6, 11
2557 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd t4, 0(sp)
2558 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd t2, 8(sp)
2559 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd t1, 16(sp)
2560 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd t0, 24(sp)
2561 ; LP64-LP64F-LP64D-WITHFP-NEXT: call va5_aligned_stack_callee
2562 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld ra, 40(sp) # 8-byte Folded Reload
2563 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s0, 32(sp) # 8-byte Folded Reload
2564 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, 48
2565 ; LP64-LP64F-LP64D-WITHFP-NEXT: ret
2567 ; LP64E-FPELIM-LABEL: va5_aligned_stack_caller:
2568 ; LP64E-FPELIM: # %bb.0:
2569 ; LP64E-FPELIM-NEXT: addi sp, sp, -56
2570 ; LP64E-FPELIM-NEXT: sd ra, 48(sp) # 8-byte Folded Spill
2571 ; LP64E-FPELIM-NEXT: li a2, 17
2572 ; LP64E-FPELIM-NEXT: li a3, 16
2573 ; LP64E-FPELIM-NEXT: li a6, 15
2574 ; LP64E-FPELIM-NEXT: lui a7, %hi(.LCPI11_0)
2575 ; LP64E-FPELIM-NEXT: li t0, 14
2576 ; LP64E-FPELIM-NEXT: lui t1, 2384
2577 ; LP64E-FPELIM-NEXT: lui t2, %hi(.LCPI11_1)
2578 ; LP64E-FPELIM-NEXT: lui t3, %hi(.LCPI11_2)
2579 ; LP64E-FPELIM-NEXT: li a0, 1
2580 ; LP64E-FPELIM-NEXT: li a1, 11
2581 ; LP64E-FPELIM-NEXT: li a4, 12
2582 ; LP64E-FPELIM-NEXT: sd a3, 32(sp)
2583 ; LP64E-FPELIM-NEXT: sd a2, 40(sp)
2584 ; LP64E-FPELIM-NEXT: li a5, 13
2585 ; LP64E-FPELIM-NEXT: ld a7, %lo(.LCPI11_0)(a7)
2586 ; LP64E-FPELIM-NEXT: addiw t1, t1, 761
2587 ; LP64E-FPELIM-NEXT: ld a2, %lo(.LCPI11_1)(t2)
2588 ; LP64E-FPELIM-NEXT: ld a3, %lo(.LCPI11_2)(t3)
2589 ; LP64E-FPELIM-NEXT: slli t1, t1, 11
2590 ; LP64E-FPELIM-NEXT: sd t1, 0(sp)
2591 ; LP64E-FPELIM-NEXT: sd t0, 8(sp)
2592 ; LP64E-FPELIM-NEXT: sd a7, 16(sp)
2593 ; LP64E-FPELIM-NEXT: sd a6, 24(sp)
2594 ; LP64E-FPELIM-NEXT: call va5_aligned_stack_callee
2595 ; LP64E-FPELIM-NEXT: ld ra, 48(sp) # 8-byte Folded Reload
2596 ; LP64E-FPELIM-NEXT: addi sp, sp, 56
2597 ; LP64E-FPELIM-NEXT: ret
2599 ; LP64E-WITHFP-LABEL: va5_aligned_stack_caller:
2600 ; LP64E-WITHFP: # %bb.0:
2601 ; LP64E-WITHFP-NEXT: addi sp, sp, -64
2602 ; LP64E-WITHFP-NEXT: sd ra, 56(sp) # 8-byte Folded Spill
2603 ; LP64E-WITHFP-NEXT: sd s0, 48(sp) # 8-byte Folded Spill
2604 ; LP64E-WITHFP-NEXT: addi s0, sp, 64
2605 ; LP64E-WITHFP-NEXT: li a2, 17
2606 ; LP64E-WITHFP-NEXT: li a3, 16
2607 ; LP64E-WITHFP-NEXT: li a6, 15
2608 ; LP64E-WITHFP-NEXT: lui a7, %hi(.LCPI11_0)
2609 ; LP64E-WITHFP-NEXT: li t0, 14
2610 ; LP64E-WITHFP-NEXT: lui t1, 2384
2611 ; LP64E-WITHFP-NEXT: lui t2, %hi(.LCPI11_1)
2612 ; LP64E-WITHFP-NEXT: lui t3, %hi(.LCPI11_2)
2613 ; LP64E-WITHFP-NEXT: li a0, 1
2614 ; LP64E-WITHFP-NEXT: li a1, 11
2615 ; LP64E-WITHFP-NEXT: li a4, 12
2616 ; LP64E-WITHFP-NEXT: sd a3, 32(sp)
2617 ; LP64E-WITHFP-NEXT: sd a2, 40(sp)
2618 ; LP64E-WITHFP-NEXT: li a5, 13
2619 ; LP64E-WITHFP-NEXT: ld a7, %lo(.LCPI11_0)(a7)
2620 ; LP64E-WITHFP-NEXT: addiw t1, t1, 761
2621 ; LP64E-WITHFP-NEXT: ld a2, %lo(.LCPI11_1)(t2)
2622 ; LP64E-WITHFP-NEXT: ld a3, %lo(.LCPI11_2)(t3)
2623 ; LP64E-WITHFP-NEXT: slli t1, t1, 11
2624 ; LP64E-WITHFP-NEXT: sd t1, 0(sp)
2625 ; LP64E-WITHFP-NEXT: sd t0, 8(sp)
2626 ; LP64E-WITHFP-NEXT: sd a7, 16(sp)
2627 ; LP64E-WITHFP-NEXT: sd a6, 24(sp)
2628 ; LP64E-WITHFP-NEXT: call va5_aligned_stack_callee
2629 ; LP64E-WITHFP-NEXT: ld ra, 56(sp) # 8-byte Folded Reload
2630 ; LP64E-WITHFP-NEXT: ld s0, 48(sp) # 8-byte Folded Reload
2631 ; LP64E-WITHFP-NEXT: addi sp, sp, 64
2632 ; LP64E-WITHFP-NEXT: ret
2633 %1 = call i32 (i32, ...) @va5_aligned_stack_callee(i32 1, i32 11,
2634 fp128 0xLEB851EB851EB851F400091EB851EB851, i32 12, i32 13, i64 20000000000,
2635 i32 14, double 2.720000e+00, i32 15, [2 x i32] [i32 16, i32 17])
2639 ; A function with no fixed arguments is not valid C, but can be
2640 ; specified in LLVM IR. We must ensure the vararg save area is
2641 ; still set up correctly.
2643 define i32 @va6_no_fixed_args(...) nounwind {
2644 ; ILP32-ILP32F-FPELIM-LABEL: va6_no_fixed_args:
2645 ; ILP32-ILP32F-FPELIM: # %bb.0:
2646 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, -48
2647 ; ILP32-ILP32F-FPELIM-NEXT: sw a4, 32(sp)
2648 ; ILP32-ILP32F-FPELIM-NEXT: sw a5, 36(sp)
2649 ; ILP32-ILP32F-FPELIM-NEXT: sw a6, 40(sp)
2650 ; ILP32-ILP32F-FPELIM-NEXT: sw a7, 44(sp)
2651 ; ILP32-ILP32F-FPELIM-NEXT: sw a0, 16(sp)
2652 ; ILP32-ILP32F-FPELIM-NEXT: sw a1, 20(sp)
2653 ; ILP32-ILP32F-FPELIM-NEXT: sw a2, 24(sp)
2654 ; ILP32-ILP32F-FPELIM-NEXT: sw a3, 28(sp)
2655 ; ILP32-ILP32F-FPELIM-NEXT: addi a1, sp, 20
2656 ; ILP32-ILP32F-FPELIM-NEXT: sw a1, 12(sp)
2657 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, 48
2658 ; ILP32-ILP32F-FPELIM-NEXT: ret
2660 ; ILP32-ILP32F-WITHFP-LABEL: va6_no_fixed_args:
2661 ; ILP32-ILP32F-WITHFP: # %bb.0:
2662 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, -48
2663 ; ILP32-ILP32F-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
2664 ; ILP32-ILP32F-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
2665 ; ILP32-ILP32F-WITHFP-NEXT: addi s0, sp, 16
2666 ; ILP32-ILP32F-WITHFP-NEXT: sw a4, 16(s0)
2667 ; ILP32-ILP32F-WITHFP-NEXT: sw a5, 20(s0)
2668 ; ILP32-ILP32F-WITHFP-NEXT: sw a6, 24(s0)
2669 ; ILP32-ILP32F-WITHFP-NEXT: sw a7, 28(s0)
2670 ; ILP32-ILP32F-WITHFP-NEXT: sw a0, 0(s0)
2671 ; ILP32-ILP32F-WITHFP-NEXT: sw a1, 4(s0)
2672 ; ILP32-ILP32F-WITHFP-NEXT: sw a2, 8(s0)
2673 ; ILP32-ILP32F-WITHFP-NEXT: sw a3, 12(s0)
2674 ; ILP32-ILP32F-WITHFP-NEXT: addi a1, s0, 4
2675 ; ILP32-ILP32F-WITHFP-NEXT: sw a1, -12(s0)
2676 ; ILP32-ILP32F-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
2677 ; ILP32-ILP32F-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
2678 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, 48
2679 ; ILP32-ILP32F-WITHFP-NEXT: ret
2681 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-LABEL: va6_no_fixed_args:
2682 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM: # %bb.0:
2683 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, -48
2684 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a4, 32(sp)
2685 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a5, 36(sp)
2686 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a6, 40(sp)
2687 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a7, 44(sp)
2688 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a0, 16(sp)
2689 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 20(sp)
2690 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a2, 24(sp)
2691 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a3, 28(sp)
2692 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a1, sp, 20
2693 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 12(sp)
2694 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, 48
2695 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: ret
2697 ; ILP32E-FPELIM-LABEL: va6_no_fixed_args:
2698 ; ILP32E-FPELIM: # %bb.0:
2699 ; ILP32E-FPELIM-NEXT: addi sp, sp, -28
2700 ; ILP32E-FPELIM-NEXT: sw a4, 20(sp)
2701 ; ILP32E-FPELIM-NEXT: sw a5, 24(sp)
2702 ; ILP32E-FPELIM-NEXT: sw a0, 4(sp)
2703 ; ILP32E-FPELIM-NEXT: sw a1, 8(sp)
2704 ; ILP32E-FPELIM-NEXT: sw a2, 12(sp)
2705 ; ILP32E-FPELIM-NEXT: sw a3, 16(sp)
2706 ; ILP32E-FPELIM-NEXT: addi a1, sp, 8
2707 ; ILP32E-FPELIM-NEXT: sw a1, 0(sp)
2708 ; ILP32E-FPELIM-NEXT: addi sp, sp, 28
2709 ; ILP32E-FPELIM-NEXT: ret
2711 ; ILP32E-WITHFP-LABEL: va6_no_fixed_args:
2712 ; ILP32E-WITHFP: # %bb.0:
2713 ; ILP32E-WITHFP-NEXT: addi sp, sp, -36
2714 ; ILP32E-WITHFP-NEXT: sw ra, 8(sp) # 4-byte Folded Spill
2715 ; ILP32E-WITHFP-NEXT: sw s0, 4(sp) # 4-byte Folded Spill
2716 ; ILP32E-WITHFP-NEXT: addi s0, sp, 12
2717 ; ILP32E-WITHFP-NEXT: sw a4, 16(s0)
2718 ; ILP32E-WITHFP-NEXT: sw a5, 20(s0)
2719 ; ILP32E-WITHFP-NEXT: sw a0, 0(s0)
2720 ; ILP32E-WITHFP-NEXT: sw a1, 4(s0)
2721 ; ILP32E-WITHFP-NEXT: sw a2, 8(s0)
2722 ; ILP32E-WITHFP-NEXT: sw a3, 12(s0)
2723 ; ILP32E-WITHFP-NEXT: addi a1, s0, 4
2724 ; ILP32E-WITHFP-NEXT: sw a1, -12(s0)
2725 ; ILP32E-WITHFP-NEXT: lw ra, 8(sp) # 4-byte Folded Reload
2726 ; ILP32E-WITHFP-NEXT: lw s0, 4(sp) # 4-byte Folded Reload
2727 ; ILP32E-WITHFP-NEXT: addi sp, sp, 36
2728 ; ILP32E-WITHFP-NEXT: ret
2730 ; LP64-LP64F-LP64D-FPELIM-LABEL: va6_no_fixed_args:
2731 ; LP64-LP64F-LP64D-FPELIM: # %bb.0:
2732 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, -80
2733 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a4, 48(sp)
2734 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a5, 56(sp)
2735 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a6, 64(sp)
2736 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a7, 72(sp)
2737 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a0, 16(sp)
2738 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a1, 24(sp)
2739 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a2, 32(sp)
2740 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a3, 40(sp)
2741 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a1, sp, 24
2742 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a1, 8(sp)
2743 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, 80
2744 ; LP64-LP64F-LP64D-FPELIM-NEXT: ret
2746 ; LP64-LP64F-LP64D-WITHFP-LABEL: va6_no_fixed_args:
2747 ; LP64-LP64F-LP64D-WITHFP: # %bb.0:
2748 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, -96
2749 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
2750 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
2751 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi s0, sp, 32
2752 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a4, 32(s0)
2753 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a5, 40(s0)
2754 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a6, 48(s0)
2755 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a7, 56(s0)
2756 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a0, 0(s0)
2757 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a1, 8(s0)
2758 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a2, 16(s0)
2759 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a3, 24(s0)
2760 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a1, s0, 8
2761 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a1, -24(s0)
2762 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
2763 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
2764 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, 96
2765 ; LP64-LP64F-LP64D-WITHFP-NEXT: ret
2767 ; LP64E-FPELIM-LABEL: va6_no_fixed_args:
2768 ; LP64E-FPELIM: # %bb.0:
2769 ; LP64E-FPELIM-NEXT: addi sp, sp, -56
2770 ; LP64E-FPELIM-NEXT: sd a4, 40(sp)
2771 ; LP64E-FPELIM-NEXT: sd a5, 48(sp)
2772 ; LP64E-FPELIM-NEXT: sd a0, 8(sp)
2773 ; LP64E-FPELIM-NEXT: sd a1, 16(sp)
2774 ; LP64E-FPELIM-NEXT: sd a2, 24(sp)
2775 ; LP64E-FPELIM-NEXT: sd a3, 32(sp)
2776 ; LP64E-FPELIM-NEXT: addi a1, sp, 16
2777 ; LP64E-FPELIM-NEXT: sd a1, 0(sp)
2778 ; LP64E-FPELIM-NEXT: addi sp, sp, 56
2779 ; LP64E-FPELIM-NEXT: ret
2781 ; LP64E-WITHFP-LABEL: va6_no_fixed_args:
2782 ; LP64E-WITHFP: # %bb.0:
2783 ; LP64E-WITHFP-NEXT: addi sp, sp, -72
2784 ; LP64E-WITHFP-NEXT: sd ra, 16(sp) # 8-byte Folded Spill
2785 ; LP64E-WITHFP-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
2786 ; LP64E-WITHFP-NEXT: addi s0, sp, 24
2787 ; LP64E-WITHFP-NEXT: sd a4, 32(s0)
2788 ; LP64E-WITHFP-NEXT: sd a5, 40(s0)
2789 ; LP64E-WITHFP-NEXT: sd a0, 0(s0)
2790 ; LP64E-WITHFP-NEXT: sd a1, 8(s0)
2791 ; LP64E-WITHFP-NEXT: sd a2, 16(s0)
2792 ; LP64E-WITHFP-NEXT: sd a3, 24(s0)
2793 ; LP64E-WITHFP-NEXT: addi a1, s0, 8
2794 ; LP64E-WITHFP-NEXT: sd a1, -24(s0)
2795 ; LP64E-WITHFP-NEXT: ld ra, 16(sp) # 8-byte Folded Reload
2796 ; LP64E-WITHFP-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
2797 ; LP64E-WITHFP-NEXT: addi sp, sp, 72
2798 ; LP64E-WITHFP-NEXT: ret
2800 call void @llvm.va_start(ptr %va)
2801 %1 = va_arg ptr %va, i32
2802 call void @llvm.va_end(ptr %va)
2806 ; TODO: improve constant materialization of stack addresses
2808 define i32 @va_large_stack(ptr %fmt, ...) {
2809 ; ILP32-ILP32F-FPELIM-LABEL: va_large_stack:
2810 ; ILP32-ILP32F-FPELIM: # %bb.0:
2811 ; ILP32-ILP32F-FPELIM-NEXT: lui a0, 24414
2812 ; ILP32-ILP32F-FPELIM-NEXT: addi a0, a0, 304
2813 ; ILP32-ILP32F-FPELIM-NEXT: sub sp, sp, a0
2814 ; ILP32-ILP32F-FPELIM-NEXT: .cfi_def_cfa_offset 100000048
2815 ; ILP32-ILP32F-FPELIM-NEXT: mv a0, a1
2816 ; ILP32-ILP32F-FPELIM-NEXT: lui t0, 24414
2817 ; ILP32-ILP32F-FPELIM-NEXT: add t0, sp, t0
2818 ; ILP32-ILP32F-FPELIM-NEXT: sw a5, 292(t0)
2819 ; ILP32-ILP32F-FPELIM-NEXT: lui a5, 24414
2820 ; ILP32-ILP32F-FPELIM-NEXT: add a5, sp, a5
2821 ; ILP32-ILP32F-FPELIM-NEXT: sw a6, 296(a5)
2822 ; ILP32-ILP32F-FPELIM-NEXT: lui a5, 24414
2823 ; ILP32-ILP32F-FPELIM-NEXT: add a5, sp, a5
2824 ; ILP32-ILP32F-FPELIM-NEXT: sw a7, 300(a5)
2825 ; ILP32-ILP32F-FPELIM-NEXT: lui a5, 24414
2826 ; ILP32-ILP32F-FPELIM-NEXT: add a5, sp, a5
2827 ; ILP32-ILP32F-FPELIM-NEXT: sw a1, 276(a5)
2828 ; ILP32-ILP32F-FPELIM-NEXT: lui a1, 24414
2829 ; ILP32-ILP32F-FPELIM-NEXT: add a1, sp, a1
2830 ; ILP32-ILP32F-FPELIM-NEXT: sw a2, 280(a1)
2831 ; ILP32-ILP32F-FPELIM-NEXT: lui a1, 24414
2832 ; ILP32-ILP32F-FPELIM-NEXT: add a1, sp, a1
2833 ; ILP32-ILP32F-FPELIM-NEXT: sw a3, 284(a1)
2834 ; ILP32-ILP32F-FPELIM-NEXT: lui a1, 24414
2835 ; ILP32-ILP32F-FPELIM-NEXT: add a1, sp, a1
2836 ; ILP32-ILP32F-FPELIM-NEXT: sw a4, 288(a1)
2837 ; ILP32-ILP32F-FPELIM-NEXT: lui a1, 24414
2838 ; ILP32-ILP32F-FPELIM-NEXT: addi a1, a1, 280
2839 ; ILP32-ILP32F-FPELIM-NEXT: add a1, sp, a1
2840 ; ILP32-ILP32F-FPELIM-NEXT: sw a1, 12(sp)
2841 ; ILP32-ILP32F-FPELIM-NEXT: lui a1, 24414
2842 ; ILP32-ILP32F-FPELIM-NEXT: addi a1, a1, 304
2843 ; ILP32-ILP32F-FPELIM-NEXT: add sp, sp, a1
2844 ; ILP32-ILP32F-FPELIM-NEXT: .cfi_def_cfa_offset 0
2845 ; ILP32-ILP32F-FPELIM-NEXT: ret
2847 ; ILP32-ILP32F-WITHFP-LABEL: va_large_stack:
2848 ; ILP32-ILP32F-WITHFP: # %bb.0:
2849 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, -2032
2850 ; ILP32-ILP32F-WITHFP-NEXT: .cfi_def_cfa_offset 2032
2851 ; ILP32-ILP32F-WITHFP-NEXT: sw ra, 1996(sp) # 4-byte Folded Spill
2852 ; ILP32-ILP32F-WITHFP-NEXT: sw s0, 1992(sp) # 4-byte Folded Spill
2853 ; ILP32-ILP32F-WITHFP-NEXT: .cfi_offset ra, -36
2854 ; ILP32-ILP32F-WITHFP-NEXT: .cfi_offset s0, -40
2855 ; ILP32-ILP32F-WITHFP-NEXT: addi s0, sp, 2000
2856 ; ILP32-ILP32F-WITHFP-NEXT: .cfi_def_cfa s0, 32
2857 ; ILP32-ILP32F-WITHFP-NEXT: lui a0, 24414
2858 ; ILP32-ILP32F-WITHFP-NEXT: addi a0, a0, -1728
2859 ; ILP32-ILP32F-WITHFP-NEXT: sub sp, sp, a0
2860 ; ILP32-ILP32F-WITHFP-NEXT: mv a0, a1
2861 ; ILP32-ILP32F-WITHFP-NEXT: sw a5, 20(s0)
2862 ; ILP32-ILP32F-WITHFP-NEXT: sw a6, 24(s0)
2863 ; ILP32-ILP32F-WITHFP-NEXT: sw a7, 28(s0)
2864 ; ILP32-ILP32F-WITHFP-NEXT: sw a1, 4(s0)
2865 ; ILP32-ILP32F-WITHFP-NEXT: sw a2, 8(s0)
2866 ; ILP32-ILP32F-WITHFP-NEXT: sw a3, 12(s0)
2867 ; ILP32-ILP32F-WITHFP-NEXT: sw a4, 16(s0)
2868 ; ILP32-ILP32F-WITHFP-NEXT: addi a1, s0, 8
2869 ; ILP32-ILP32F-WITHFP-NEXT: lui a2, 24414
2870 ; ILP32-ILP32F-WITHFP-NEXT: sub a2, s0, a2
2871 ; ILP32-ILP32F-WITHFP-NEXT: sw a1, -272(a2)
2872 ; ILP32-ILP32F-WITHFP-NEXT: lui a1, 24414
2873 ; ILP32-ILP32F-WITHFP-NEXT: addi a1, a1, -1728
2874 ; ILP32-ILP32F-WITHFP-NEXT: add sp, sp, a1
2875 ; ILP32-ILP32F-WITHFP-NEXT: .cfi_def_cfa sp, 2032
2876 ; ILP32-ILP32F-WITHFP-NEXT: lw ra, 1996(sp) # 4-byte Folded Reload
2877 ; ILP32-ILP32F-WITHFP-NEXT: lw s0, 1992(sp) # 4-byte Folded Reload
2878 ; ILP32-ILP32F-WITHFP-NEXT: .cfi_restore ra
2879 ; ILP32-ILP32F-WITHFP-NEXT: .cfi_restore s0
2880 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, 2032
2881 ; ILP32-ILP32F-WITHFP-NEXT: .cfi_def_cfa_offset 0
2882 ; ILP32-ILP32F-WITHFP-NEXT: ret
2884 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-LABEL: va_large_stack:
2885 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM: # %bb.0:
2886 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a0, 24414
2887 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a0, a0, 304
2888 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sub sp, sp, a0
2889 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: .cfi_def_cfa_offset 100000048
2890 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: mv a0, a1
2891 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui t0, 24414
2892 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add t0, sp, t0
2893 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a5, 292(t0)
2894 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a5, 24414
2895 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a5, sp, a5
2896 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a6, 296(a5)
2897 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a5, 24414
2898 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a5, sp, a5
2899 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a7, 300(a5)
2900 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a5, 24414
2901 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a5, sp, a5
2902 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 276(a5)
2903 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a1, 24414
2904 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a1, sp, a1
2905 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a2, 280(a1)
2906 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a1, 24414
2907 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a1, sp, a1
2908 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a3, 284(a1)
2909 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a1, 24414
2910 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a1, sp, a1
2911 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a4, 288(a1)
2912 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a1, 24414
2913 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a1, a1, 280
2914 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a1, sp, a1
2915 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 12(sp)
2916 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a1, 24414
2917 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a1, a1, 304
2918 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add sp, sp, a1
2919 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: .cfi_def_cfa_offset 0
2920 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: ret
2922 ; ILP32E-FPELIM-LABEL: va_large_stack:
2923 ; ILP32E-FPELIM: # %bb.0:
2924 ; ILP32E-FPELIM-NEXT: lui a0, 24414
2925 ; ILP32E-FPELIM-NEXT: addi a0, a0, 288
2926 ; ILP32E-FPELIM-NEXT: sub sp, sp, a0
2927 ; ILP32E-FPELIM-NEXT: .cfi_def_cfa_offset 100000032
2928 ; ILP32E-FPELIM-NEXT: mv a0, a1
2929 ; ILP32E-FPELIM-NEXT: lui a6, 24414
2930 ; ILP32E-FPELIM-NEXT: add a6, sp, a6
2931 ; ILP32E-FPELIM-NEXT: sw a5, 284(a6)
2932 ; ILP32E-FPELIM-NEXT: lui a5, 24414
2933 ; ILP32E-FPELIM-NEXT: add a5, sp, a5
2934 ; ILP32E-FPELIM-NEXT: sw a1, 268(a5)
2935 ; ILP32E-FPELIM-NEXT: lui a1, 24414
2936 ; ILP32E-FPELIM-NEXT: add a1, sp, a1
2937 ; ILP32E-FPELIM-NEXT: sw a2, 272(a1)
2938 ; ILP32E-FPELIM-NEXT: lui a1, 24414
2939 ; ILP32E-FPELIM-NEXT: add a1, sp, a1
2940 ; ILP32E-FPELIM-NEXT: sw a3, 276(a1)
2941 ; ILP32E-FPELIM-NEXT: lui a1, 24414
2942 ; ILP32E-FPELIM-NEXT: add a1, sp, a1
2943 ; ILP32E-FPELIM-NEXT: sw a4, 280(a1)
2944 ; ILP32E-FPELIM-NEXT: lui a1, 24414
2945 ; ILP32E-FPELIM-NEXT: addi a1, a1, 272
2946 ; ILP32E-FPELIM-NEXT: add a1, sp, a1
2947 ; ILP32E-FPELIM-NEXT: sw a1, 4(sp)
2948 ; ILP32E-FPELIM-NEXT: lui a1, 24414
2949 ; ILP32E-FPELIM-NEXT: addi a1, a1, 288
2950 ; ILP32E-FPELIM-NEXT: add sp, sp, a1
2951 ; ILP32E-FPELIM-NEXT: .cfi_def_cfa_offset 0
2952 ; ILP32E-FPELIM-NEXT: ret
2954 ; ILP32E-WITHFP-LABEL: va_large_stack:
2955 ; ILP32E-WITHFP: # %bb.0:
2956 ; ILP32E-WITHFP-NEXT: addi sp, sp, -2044
2957 ; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 2044
2958 ; ILP32E-WITHFP-NEXT: sw ra, 2016(sp) # 4-byte Folded Spill
2959 ; ILP32E-WITHFP-NEXT: sw s0, 2012(sp) # 4-byte Folded Spill
2960 ; ILP32E-WITHFP-NEXT: .cfi_offset ra, -28
2961 ; ILP32E-WITHFP-NEXT: .cfi_offset s0, -32
2962 ; ILP32E-WITHFP-NEXT: addi s0, sp, 2020
2963 ; ILP32E-WITHFP-NEXT: .cfi_def_cfa s0, 24
2964 ; ILP32E-WITHFP-NEXT: lui a0, 24414
2965 ; ILP32E-WITHFP-NEXT: addi a0, a0, -1748
2966 ; ILP32E-WITHFP-NEXT: sub sp, sp, a0
2967 ; ILP32E-WITHFP-NEXT: mv a0, a1
2968 ; ILP32E-WITHFP-NEXT: sw a5, 20(s0)
2969 ; ILP32E-WITHFP-NEXT: sw a1, 4(s0)
2970 ; ILP32E-WITHFP-NEXT: sw a2, 8(s0)
2971 ; ILP32E-WITHFP-NEXT: sw a3, 12(s0)
2972 ; ILP32E-WITHFP-NEXT: sw a4, 16(s0)
2973 ; ILP32E-WITHFP-NEXT: addi a1, s0, 8
2974 ; ILP32E-WITHFP-NEXT: lui a2, 24414
2975 ; ILP32E-WITHFP-NEXT: sub a2, s0, a2
2976 ; ILP32E-WITHFP-NEXT: sw a1, -272(a2)
2977 ; ILP32E-WITHFP-NEXT: lui a1, 24414
2978 ; ILP32E-WITHFP-NEXT: addi a1, a1, -1748
2979 ; ILP32E-WITHFP-NEXT: add sp, sp, a1
2980 ; ILP32E-WITHFP-NEXT: .cfi_def_cfa sp, 2044
2981 ; ILP32E-WITHFP-NEXT: lw ra, 2016(sp) # 4-byte Folded Reload
2982 ; ILP32E-WITHFP-NEXT: lw s0, 2012(sp) # 4-byte Folded Reload
2983 ; ILP32E-WITHFP-NEXT: .cfi_restore ra
2984 ; ILP32E-WITHFP-NEXT: .cfi_restore s0
2985 ; ILP32E-WITHFP-NEXT: addi sp, sp, 2044
2986 ; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 0
2987 ; ILP32E-WITHFP-NEXT: ret
2989 ; LP64-LP64F-LP64D-FPELIM-LABEL: va_large_stack:
2990 ; LP64-LP64F-LP64D-FPELIM: # %bb.0:
2991 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui a0, 24414
2992 ; LP64-LP64F-LP64D-FPELIM-NEXT: addiw a0, a0, 336
2993 ; LP64-LP64F-LP64D-FPELIM-NEXT: sub sp, sp, a0
2994 ; LP64-LP64F-LP64D-FPELIM-NEXT: .cfi_def_cfa_offset 100000080
2995 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui a0, 24414
2996 ; LP64-LP64F-LP64D-FPELIM-NEXT: add a0, sp, a0
2997 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a1, 280(a0)
2998 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui a0, 24414
2999 ; LP64-LP64F-LP64D-FPELIM-NEXT: addiw a0, a0, 284
3000 ; LP64-LP64F-LP64D-FPELIM-NEXT: add a0, sp, a0
3001 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a0, 8(sp)
3002 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui a0, 24414
3003 ; LP64-LP64F-LP64D-FPELIM-NEXT: add a0, sp, a0
3004 ; LP64-LP64F-LP64D-FPELIM-NEXT: lw a0, 280(a0)
3005 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui a1, 24414
3006 ; LP64-LP64F-LP64D-FPELIM-NEXT: add a1, sp, a1
3007 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a5, 312(a1)
3008 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui a1, 24414
3009 ; LP64-LP64F-LP64D-FPELIM-NEXT: add a1, sp, a1
3010 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a6, 320(a1)
3011 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui a1, 24414
3012 ; LP64-LP64F-LP64D-FPELIM-NEXT: add a1, sp, a1
3013 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a7, 328(a1)
3014 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui a1, 24414
3015 ; LP64-LP64F-LP64D-FPELIM-NEXT: add a1, sp, a1
3016 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a2, 288(a1)
3017 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui a1, 24414
3018 ; LP64-LP64F-LP64D-FPELIM-NEXT: add a1, sp, a1
3019 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a3, 296(a1)
3020 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui a1, 24414
3021 ; LP64-LP64F-LP64D-FPELIM-NEXT: add a1, sp, a1
3022 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a4, 304(a1)
3023 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui a1, 24414
3024 ; LP64-LP64F-LP64D-FPELIM-NEXT: addiw a1, a1, 336
3025 ; LP64-LP64F-LP64D-FPELIM-NEXT: add sp, sp, a1
3026 ; LP64-LP64F-LP64D-FPELIM-NEXT: .cfi_def_cfa_offset 0
3027 ; LP64-LP64F-LP64D-FPELIM-NEXT: ret
3029 ; LP64-LP64F-LP64D-WITHFP-LABEL: va_large_stack:
3030 ; LP64-LP64F-LP64D-WITHFP: # %bb.0:
3031 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, -2032
3032 ; LP64-LP64F-LP64D-WITHFP-NEXT: .cfi_def_cfa_offset 2032
3033 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd ra, 1960(sp) # 8-byte Folded Spill
3034 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s0, 1952(sp) # 8-byte Folded Spill
3035 ; LP64-LP64F-LP64D-WITHFP-NEXT: .cfi_offset ra, -72
3036 ; LP64-LP64F-LP64D-WITHFP-NEXT: .cfi_offset s0, -80
3037 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi s0, sp, 1968
3038 ; LP64-LP64F-LP64D-WITHFP-NEXT: .cfi_def_cfa s0, 64
3039 ; LP64-LP64F-LP64D-WITHFP-NEXT: lui a0, 24414
3040 ; LP64-LP64F-LP64D-WITHFP-NEXT: addiw a0, a0, -1680
3041 ; LP64-LP64F-LP64D-WITHFP-NEXT: sub sp, sp, a0
3042 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a1, 8(s0)
3043 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a0, s0, 12
3044 ; LP64-LP64F-LP64D-WITHFP-NEXT: lui a1, 24414
3045 ; LP64-LP64F-LP64D-WITHFP-NEXT: sub a1, s0, a1
3046 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a0, -288(a1)
3047 ; LP64-LP64F-LP64D-WITHFP-NEXT: lw a0, 8(s0)
3048 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a5, 40(s0)
3049 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a6, 48(s0)
3050 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a7, 56(s0)
3051 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a2, 16(s0)
3052 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a3, 24(s0)
3053 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a4, 32(s0)
3054 ; LP64-LP64F-LP64D-WITHFP-NEXT: lui a1, 24414
3055 ; LP64-LP64F-LP64D-WITHFP-NEXT: addiw a1, a1, -1680
3056 ; LP64-LP64F-LP64D-WITHFP-NEXT: add sp, sp, a1
3057 ; LP64-LP64F-LP64D-WITHFP-NEXT: .cfi_def_cfa sp, 2032
3058 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld ra, 1960(sp) # 8-byte Folded Reload
3059 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s0, 1952(sp) # 8-byte Folded Reload
3060 ; LP64-LP64F-LP64D-WITHFP-NEXT: .cfi_restore ra
3061 ; LP64-LP64F-LP64D-WITHFP-NEXT: .cfi_restore s0
3062 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, 2032
3063 ; LP64-LP64F-LP64D-WITHFP-NEXT: .cfi_def_cfa_offset 0
3064 ; LP64-LP64F-LP64D-WITHFP-NEXT: ret
3066 ; LP64E-FPELIM-LABEL: va_large_stack:
3067 ; LP64E-FPELIM: # %bb.0:
3068 ; LP64E-FPELIM-NEXT: lui a0, 24414
3069 ; LP64E-FPELIM-NEXT: addiw a0, a0, 320
3070 ; LP64E-FPELIM-NEXT: sub sp, sp, a0
3071 ; LP64E-FPELIM-NEXT: .cfi_def_cfa_offset 100000064
3072 ; LP64E-FPELIM-NEXT: lui a0, 24414
3073 ; LP64E-FPELIM-NEXT: addiw a0, a0, 284
3074 ; LP64E-FPELIM-NEXT: add a0, sp, a0
3075 ; LP64E-FPELIM-NEXT: sd a0, 8(sp)
3076 ; LP64E-FPELIM-NEXT: lui a0, 24414
3077 ; LP64E-FPELIM-NEXT: add a0, sp, a0
3078 ; LP64E-FPELIM-NEXT: sd a1, 280(a0)
3079 ; LP64E-FPELIM-NEXT: lui a0, 24414
3080 ; LP64E-FPELIM-NEXT: add a0, sp, a0
3081 ; LP64E-FPELIM-NEXT: lw a0, 280(a0)
3082 ; LP64E-FPELIM-NEXT: lui a1, 24414
3083 ; LP64E-FPELIM-NEXT: add a1, sp, a1
3084 ; LP64E-FPELIM-NEXT: sd a5, 312(a1)
3085 ; LP64E-FPELIM-NEXT: lui a1, 24414
3086 ; LP64E-FPELIM-NEXT: add a1, sp, a1
3087 ; LP64E-FPELIM-NEXT: sd a2, 288(a1)
3088 ; LP64E-FPELIM-NEXT: lui a1, 24414
3089 ; LP64E-FPELIM-NEXT: add a1, sp, a1
3090 ; LP64E-FPELIM-NEXT: sd a3, 296(a1)
3091 ; LP64E-FPELIM-NEXT: lui a1, 24414
3092 ; LP64E-FPELIM-NEXT: add a1, sp, a1
3093 ; LP64E-FPELIM-NEXT: sd a4, 304(a1)
3094 ; LP64E-FPELIM-NEXT: lui a1, 24414
3095 ; LP64E-FPELIM-NEXT: addiw a1, a1, 320
3096 ; LP64E-FPELIM-NEXT: add sp, sp, a1
3097 ; LP64E-FPELIM-NEXT: .cfi_def_cfa_offset 0
3098 ; LP64E-FPELIM-NEXT: ret
3100 ; LP64E-WITHFP-LABEL: va_large_stack:
3101 ; LP64E-WITHFP: # %bb.0:
3102 ; LP64E-WITHFP-NEXT: addi sp, sp, -2040
3103 ; LP64E-WITHFP-NEXT: .cfi_def_cfa_offset 2040
3104 ; LP64E-WITHFP-NEXT: sd ra, 1984(sp) # 8-byte Folded Spill
3105 ; LP64E-WITHFP-NEXT: sd s0, 1976(sp) # 8-byte Folded Spill
3106 ; LP64E-WITHFP-NEXT: .cfi_offset ra, -56
3107 ; LP64E-WITHFP-NEXT: .cfi_offset s0, -64
3108 ; LP64E-WITHFP-NEXT: addi s0, sp, 1992
3109 ; LP64E-WITHFP-NEXT: .cfi_def_cfa s0, 48
3110 ; LP64E-WITHFP-NEXT: lui a0, 24414
3111 ; LP64E-WITHFP-NEXT: addiw a0, a0, -1704
3112 ; LP64E-WITHFP-NEXT: sub sp, sp, a0
3113 ; LP64E-WITHFP-NEXT: addi a0, s0, 12
3114 ; LP64E-WITHFP-NEXT: lui a6, 24414
3115 ; LP64E-WITHFP-NEXT: sub a6, s0, a6
3116 ; LP64E-WITHFP-NEXT: sd a0, -288(a6)
3117 ; LP64E-WITHFP-NEXT: sd a1, 8(s0)
3118 ; LP64E-WITHFP-NEXT: lw a0, 8(s0)
3119 ; LP64E-WITHFP-NEXT: sd a5, 40(s0)
3120 ; LP64E-WITHFP-NEXT: sd a2, 16(s0)
3121 ; LP64E-WITHFP-NEXT: sd a3, 24(s0)
3122 ; LP64E-WITHFP-NEXT: sd a4, 32(s0)
3123 ; LP64E-WITHFP-NEXT: lui a1, 24414
3124 ; LP64E-WITHFP-NEXT: addiw a1, a1, -1704
3125 ; LP64E-WITHFP-NEXT: add sp, sp, a1
3126 ; LP64E-WITHFP-NEXT: .cfi_def_cfa sp, 2040
3127 ; LP64E-WITHFP-NEXT: ld ra, 1984(sp) # 8-byte Folded Reload
3128 ; LP64E-WITHFP-NEXT: ld s0, 1976(sp) # 8-byte Folded Reload
3129 ; LP64E-WITHFP-NEXT: .cfi_restore ra
3130 ; LP64E-WITHFP-NEXT: .cfi_restore s0
3131 ; LP64E-WITHFP-NEXT: addi sp, sp, 2040
3132 ; LP64E-WITHFP-NEXT: .cfi_def_cfa_offset 0
3133 ; LP64E-WITHFP-NEXT: ret
3134 %large = alloca [ 100000000 x i8 ]
3136 call void @llvm.va_start(ptr %va)
3137 %argp.cur = load ptr, ptr %va, align 4
3138 %argp.next = getelementptr inbounds i8, ptr %argp.cur, i32 4
3139 store ptr %argp.next, ptr %va, align 4
3140 %1 = load i32, ptr %argp.cur, align 4
3141 call void @llvm.va_end(ptr %va)