1 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
3 ; Stackmap Header: no constants - 6 callsites
4 ; CHECK: .section .llvm_stackmaps
5 ; CHECK-NEXT: __LLVM_StackMaps:
17 ; Functions and stack size
18 ; CHECK-NEXT: .quad test
19 ; CHECK-NEXT: .quad 160
21 ; CHECK-NEXT: .quad property_access1
22 ; CHECK-NEXT: .quad 160
24 ; CHECK-NEXT: .quad property_access2
25 ; CHECK-NEXT: .quad 168
27 ; CHECK-NEXT: .quad property_access3
28 ; CHECK-NEXT: .quad 168
30 ; CHECK-NEXT: .quad anyreg_test1
31 ; CHECK-NEXT: .quad 160
33 ; CHECK-NEXT: .quad anyreg_test2
34 ; CHECK-NEXT: .quad 160
36 ; CHECK-NEXT: .quad patchpoint_spilldef
37 ; CHECK-NEXT: .quad 168
39 ; CHECK-NEXT: .quad patchpoint_spillargs
40 ; CHECK-NEXT: .quad 192
47 ; CHECK: .long .L{{.*}}-test
48 ; CHECK-NEXT: .short 0
50 ; CHECK-NEXT: .short 3
54 ; CHECK-NEXT: .short 4
55 ; CHECK-NEXT: .short {{[0-9]+}}
56 ; CHECK-NEXT: .short 0
61 ; CHECK-NEXT: .short 4
62 ; CHECK-NEXT: .short {{[0-9]+}}
63 ; CHECK-NEXT: .short 0
68 ; CHECK-NEXT: .short 8
69 ; CHECK-NEXT: .short 0
70 ; CHECK-NEXT: .short 0
72 define i64 @test() nounwind ssp uwtable {
74 call anyregcc void (i64, i32, ptr, i32, ...) @llvm.experimental.patchpoint.void(i64 0, i32 14, ptr null, i32 2, i32 1, i32 2, i64 3)
78 ; property access 1 - %obj is an anyreg call argument and should therefore be in a register
79 ; CHECK: .long .L{{.*}}-property_access1
80 ; CHECK-NEXT: .short 0
82 ; CHECK-NEXT: .short 2
83 ; Loc 0: Register <-- this is the return register
86 ; CHECK-NEXT: .short 8
87 ; CHECK-NEXT: .short {{[0-9]+}}
88 ; CHECK-NEXT: .short 0
93 ; CHECK-NEXT: .short 8
94 ; CHECK-NEXT: .short {{[0-9]+}}
95 ; CHECK-NEXT: .short 0
97 define i64 @property_access1(ptr %obj) nounwind ssp uwtable {
99 %f = inttoptr i64 12297829382473034410 to ptr
100 %ret = call anyregcc i64 (i64, i32, ptr, i32, ...) @llvm.experimental.patchpoint.i64(i64 1, i32 14, ptr %f, i32 1, ptr %obj)
104 ; property access 2 - %obj is an anyreg call argument and should therefore be in a register
105 ; CHECK: .long .L{{.*}}-property_access2
106 ; CHECK-NEXT: .short 0
108 ; CHECK-NEXT: .short 2
109 ; Loc 0: Register <-- this is the return register
110 ; CHECK-NEXT: .byte 1
111 ; CHECK-NEXT: .byte 0
112 ; CHECK-NEXT: .short 8
113 ; CHECK-NEXT: .short {{[0-9]+}}
114 ; CHECK-NEXT: .short 0
115 ; CHECK-NEXT: .long 0
117 ; CHECK-NEXT: .byte 1
118 ; CHECK-NEXT: .byte 0
119 ; CHECK-NEXT: .short 8
120 ; CHECK-NEXT: .short {{[0-9]+}}
121 ; CHECK-NEXT: .short 0
122 ; CHECK-NEXT: .long 0
123 define i64 @property_access2() nounwind ssp uwtable {
125 %obj = alloca i64, align 8
126 %f = inttoptr i64 12297829382473034410 to ptr
127 %ret = call anyregcc i64 (i64, i32, ptr, i32, ...) @llvm.experimental.patchpoint.i64(i64 2, i32 14, ptr %f, i32 1, ptr %obj)
131 ; property access 3 - %obj is a frame index
132 ; CHECK: .long .L{{.*}}-property_access3
133 ; CHECK-NEXT: .short 0
135 ; CHECK-NEXT: .short 2
136 ; Loc 0: Register <-- this is the return register
137 ; CHECK-NEXT: .byte 1
138 ; CHECK-NEXT: .byte 0
139 ; CHECK-NEXT: .short 8
140 ; CHECK-NEXT: .short {{[0-9]+}}
141 ; CHECK-NEXT: .short 0
142 ; CHECK-NEXT: .long 0
143 ; Loc 1: Direct %r15 + 160
144 ; CHECK-NEXT: .byte 2
145 ; CHECK-NEXT: .byte 0
146 ; CHECK-NEXT: .short 8
147 ; CHECK-NEXT: .short 15
148 ; CHECK-NEXT: .short 0
149 ; CHECK-NEXT: .long 160
150 define i64 @property_access3() nounwind ssp uwtable {
152 %obj = alloca i64, align 8
153 %f = inttoptr i64 12297829382473034410 to ptr
154 %ret = call anyregcc i64 (i64, i32, ptr, i32, ...) @llvm.experimental.patchpoint.i64(i64 3, i32 14, ptr %f, i32 0, ptr %obj)
159 ; CHECK: .long .L{{.*}}-anyreg_test1
160 ; CHECK-NEXT: .short 0
162 ; CHECK-NEXT: .short 13
163 ; Loc 0: Register <-- this is the return register
164 ; CHECK-NEXT: .byte 1
165 ; CHECK-NEXT: .byte 0
166 ; CHECK-NEXT: .short 8
167 ; CHECK-NEXT: .short {{[0-9]+}}
168 ; CHECK-NEXT: .short 0
169 ; CHECK-NEXT: .long 0
171 ; CHECK-NEXT: .byte 1
172 ; CHECK-NEXT: .byte 0
173 ; CHECK-NEXT: .short 8
174 ; CHECK-NEXT: .short {{[0-9]+}}
175 ; CHECK-NEXT: .short 0
176 ; CHECK-NEXT: .long 0
178 ; CHECK-NEXT: .byte 1
179 ; CHECK-NEXT: .byte 0
180 ; CHECK-NEXT: .short 8
181 ; CHECK-NEXT: .short {{[0-9]+}}
182 ; CHECK-NEXT: .short 0
183 ; CHECK-NEXT: .long 0
185 ; CHECK-NEXT: .byte 1
186 ; CHECK-NEXT: .byte 0
187 ; CHECK-NEXT: .short 8
188 ; CHECK-NEXT: .short {{[0-9]+}}
189 ; CHECK-NEXT: .short 0
190 ; CHECK-NEXT: .long 0
192 ; CHECK-NEXT: .byte 1
193 ; CHECK-NEXT: .byte 0
194 ; CHECK-NEXT: .short 8
195 ; CHECK-NEXT: .short {{[0-9]+}}
196 ; CHECK-NEXT: .short 0
197 ; CHECK-NEXT: .long 0
199 ; CHECK-NEXT: .byte 1
200 ; CHECK-NEXT: .byte 0
201 ; CHECK-NEXT: .short 8
202 ; CHECK-NEXT: .short {{[0-9]+}}
203 ; CHECK-NEXT: .short 0
204 ; CHECK-NEXT: .long 0
206 ; CHECK-NEXT: .byte 1
207 ; CHECK-NEXT: .byte 0
208 ; CHECK-NEXT: .short 8
209 ; CHECK-NEXT: .short {{[0-9]+}}
210 ; CHECK-NEXT: .short 0
211 ; CHECK-NEXT: .long 0
213 ; CHECK-NEXT: .byte 1
214 ; CHECK-NEXT: .byte 0
215 ; CHECK-NEXT: .short 8
216 ; CHECK-NEXT: .short {{[0-9]+}}
217 ; CHECK-NEXT: .short 0
218 ; CHECK-NEXT: .long 0
220 ; CHECK-NEXT: .byte 1
221 ; CHECK-NEXT: .byte 0
222 ; CHECK-NEXT: .short 8
223 ; CHECK-NEXT: .short {{[0-9]+}}
224 ; CHECK-NEXT: .short 0
225 ; CHECK-NEXT: .long 0
227 ; CHECK-NEXT: .byte 1
228 ; CHECK-NEXT: .byte 0
229 ; CHECK-NEXT: .short 8
230 ; CHECK-NEXT: .short {{[0-9]+}}
231 ; CHECK-NEXT: .short 0
232 ; CHECK-NEXT: .long 0
234 ; CHECK-NEXT: .byte 1
235 ; CHECK-NEXT: .byte 0
236 ; CHECK-NEXT: .short 8
237 ; CHECK-NEXT: .short {{[0-9]+}}
238 ; CHECK-NEXT: .short 0
239 ; CHECK-NEXT: .long 0
241 ; CHECK-NEXT: .byte 1
242 ; CHECK-NEXT: .byte 0
243 ; CHECK-NEXT: .short 8
244 ; CHECK-NEXT: .short {{[0-9]+}}
245 ; CHECK-NEXT: .short 0
246 ; CHECK-NEXT: .long 0
248 ; CHECK-NEXT: .byte 1
249 ; CHECK-NEXT: .byte 0
250 ; CHECK-NEXT: .short 8
251 ; CHECK-NEXT: .short {{[0-9]+}}
252 ; CHECK-NEXT: .short 0
253 ; CHECK-NEXT: .long 0
254 define i64 @anyreg_test1(ptr %a1, ptr %a2, ptr %a3, ptr %a4, ptr %a5, ptr %a6, ptr %a7, ptr %a8, ptr %a9, ptr %a10, ptr %a11, ptr %a12) nounwind ssp uwtable {
256 %f = inttoptr i64 12297829382473034410 to ptr
257 %ret = call anyregcc i64 (i64, i32, ptr, i32, ...) @llvm.experimental.patchpoint.i64(i64 4, i32 14, ptr %f, i32 12, ptr %a1, ptr %a2, ptr %a3, ptr %a4, ptr %a5, ptr %a6, ptr %a7, ptr %a8, ptr %a9, ptr %a10, ptr %a11, ptr %a12)
262 ; CHECK: .long .L{{.*}}-anyreg_test2
263 ; CHECK-NEXT: .short 0
265 ; CHECK-NEXT: .short 13
266 ; Loc 0: Register <-- this is the return register
267 ; CHECK-NEXT: .byte 1
268 ; CHECK-NEXT: .byte 0
269 ; CHECK-NEXT: .short 8
270 ; CHECK-NEXT: .short {{[0-9]+}}
271 ; CHECK-NEXT: .short 0
272 ; CHECK-NEXT: .long 0
274 ; CHECK-NEXT: .byte 1
275 ; CHECK-NEXT: .byte 0
276 ; CHECK-NEXT: .short 8
277 ; CHECK-NEXT: .short {{[0-9]+}}
278 ; CHECK-NEXT: .short 0
279 ; CHECK-NEXT: .long 0
281 ; CHECK-NEXT: .byte 1
282 ; CHECK-NEXT: .byte 0
283 ; CHECK-NEXT: .short 8
284 ; CHECK-NEXT: .short {{[0-9]+}}
285 ; CHECK-NEXT: .short 0
286 ; CHECK-NEXT: .long 0
288 ; CHECK-NEXT: .byte 1
289 ; CHECK-NEXT: .byte 0
290 ; CHECK-NEXT: .short 8
291 ; CHECK-NEXT: .short {{[0-9]+}}
292 ; CHECK-NEXT: .short 0
293 ; CHECK-NEXT: .long 0
295 ; CHECK-NEXT: .byte 1
296 ; CHECK-NEXT: .byte 0
297 ; CHECK-NEXT: .short 8
298 ; CHECK-NEXT: .short {{[0-9]+}}
299 ; CHECK-NEXT: .short 0
300 ; CHECK-NEXT: .long 0
302 ; CHECK-NEXT: .byte 1
303 ; CHECK-NEXT: .byte 0
304 ; CHECK-NEXT: .short 8
305 ; CHECK-NEXT: .short {{[0-9]+}}
306 ; CHECK-NEXT: .short 0
307 ; CHECK-NEXT: .long 0
309 ; CHECK-NEXT: .byte 1
310 ; CHECK-NEXT: .byte 0
311 ; CHECK-NEXT: .short 8
312 ; CHECK-NEXT: .short {{[0-9]+}}
313 ; CHECK-NEXT: .short 0
314 ; CHECK-NEXT: .long 0
316 ; CHECK-NEXT: .byte 1
317 ; CHECK-NEXT: .byte 0
318 ; CHECK-NEXT: .short 8
319 ; CHECK-NEXT: .short {{[0-9]+}}
320 ; CHECK-NEXT: .short 0
321 ; CHECK-NEXT: .long 0
323 ; CHECK-NEXT: .byte 1
324 ; CHECK-NEXT: .byte 0
325 ; CHECK-NEXT: .short 8
326 ; CHECK-NEXT: .short 13
327 ; CHECK-NEXT: .short 0
328 ; CHECK-NEXT: .long 0
330 ; CHECK-NEXT: .byte 3
331 ; CHECK-NEXT: .byte 0
332 ; CHECK-NEXT: .short 8
333 ; CHECK-NEXT: .short {{[0-9]+}}
334 ; CHECK-NEXT: .short 0
335 ; CHECK-NEXT: .long 344
336 ; Loc 10: IndirectMem
337 ; CHECK-NEXT: .byte 3
338 ; CHECK-NEXT: .byte 0
339 ; CHECK-NEXT: .short 8
340 ; CHECK-NEXT: .short {{[0-9]+}}
341 ; CHECK-NEXT: .short 0
342 ; CHECK-NEXT: .long 352
343 ; Loc 11: IndirectMem
344 ; CHECK-NEXT: .byte 3
345 ; CHECK-NEXT: .byte 0
346 ; CHECK-NEXT: .short 8
347 ; CHECK-NEXT: .short {{[0-9]+}}
348 ; CHECK-NEXT: .short 0
349 ; CHECK-NEXT: .long 360
350 ; Loc 12: IndirectMem
351 ; CHECK-NEXT: .byte 3
352 ; CHECK-NEXT: .byte 0
353 ; CHECK-NEXT: .short 8
354 ; CHECK-NEXT: .short {{[0-9]+}}
355 ; CHECK-NEXT: .short 0
356 ; CHECK-NEXT: .long 368
357 define i64 @anyreg_test2(ptr %a1, ptr %a2, ptr %a3, ptr %a4, ptr %a5, ptr %a6, ptr %a7, ptr %a8, ptr %a9, ptr %a10, ptr %a11, ptr %a12) nounwind ssp uwtable {
359 %f = inttoptr i64 12297829382473034410 to ptr
360 %ret = call anyregcc i64 (i64, i32, ptr, i32, ...) @llvm.experimental.patchpoint.i64(i64 5, i32 14, ptr %f, i32 8, ptr %a1, ptr %a2, ptr %a3, ptr %a4, ptr %a5, ptr %a6, ptr %a7, ptr %a8, ptr %a9, ptr %a10, ptr %a11, ptr %a12)
364 ; Test spilling the return value of an anyregcc call.
366 ; <rdar://problem/15432754> [JS] Assertion: "Folded a def to a non-store!"
368 ; CHECK: .long .L{{.*}}-patchpoint_spilldef
369 ; CHECK-NEXT: .short 0
370 ; CHECK-NEXT: .short 3
371 ; Loc 0: Register (some register that will be spilled to the stack)
372 ; CHECK-NEXT: .byte 1
373 ; CHECK-NEXT: .byte 0
374 ; CHECK-NEXT: .short 8
375 ; CHECK-NEXT: .short {{[0-9]+}}
376 ; CHECK-NEXT: .short 0
377 ; CHECK-NEXT: .long 0
378 ; Loc 1: Register %r2
379 ; CHECK-NEXT: .byte 1
380 ; CHECK-NEXT: .byte 0
381 ; CHECK-NEXT: .short 8
382 ; CHECK-NEXT: .short 2
383 ; CHECK-NEXT: .short 0
384 ; CHECK-NEXT: .long 0
385 ; Loc 1: Register %r3
386 ; CHECK-NEXT: .byte 1
387 ; CHECK-NEXT: .byte 0
388 ; CHECK-NEXT: .short 8
389 ; CHECK-NEXT: .short 3
390 ; CHECK-NEXT: .short 0
391 ; CHECK-NEXT: .long 0
392 define i64 @patchpoint_spilldef(i64 %p1, i64 %p2, i64 %p3, i64 %p4) {
394 %result = tail call anyregcc i64 (i64, i32, ptr, i32, ...) @llvm.experimental.patchpoint.i64(i64 12, i32 14, ptr inttoptr (i64 0 to ptr), i32 2, i64 %p1, i64 %p2)
395 tail call void asm sideeffect "nopr %r0", "~{r0},~{r1},~{r2},~{r3},~{r4},~{r5},~{r6},~{r7},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14}"() nounwind
399 ; Test spilling the arguments of an anyregcc call.
401 ; <rdar://problem/15487687> [JS] AnyRegCC argument ends up being spilled
403 ; CHECK: .long .L{{.*}}-patchpoint_spillargs
404 ; CHECK-NEXT: .short 0
405 ; CHECK-NEXT: .short 5
406 ; Loc 0: Return a register
407 ; CHECK-NEXT: .byte 1
408 ; CHECK-NEXT: .byte 0
409 ; CHECK-NEXT: .short 8
410 ; CHECK-NEXT: .short {{[0-9]+}}
411 ; CHECK-NEXT: .short 0
412 ; CHECK-NEXT: .long 0
413 ; Loc 1: Arg0 in a Register
414 ; CHECK-NEXT: .byte 1
415 ; CHECK-NEXT: .byte 0
416 ; CHECK-NEXT: .short 8
417 ; CHECK-NEXT: .short {{[0-9]+}}
418 ; CHECK-NEXT: .short 0
419 ; CHECK-NEXT: .long 0
420 ; Loc 2: Arg1 in a Register
421 ; CHECK-NEXT: .byte 1
422 ; CHECK-NEXT: .byte 0
423 ; CHECK-NEXT: .short 8
424 ; CHECK-NEXT: .short {{[0-9]+}}
425 ; CHECK-NEXT: .short 0
426 ; CHECK-NEXT: .long 0
427 ; Loc 3: Arg2 spilled to %r15 +
428 ; CHECK-NEXT: .byte 3
429 ; CHECK-NEXT: .byte 0
430 ; CHECK-NEXT: .short 8
431 ; CHECK-NEXT: .short 15
432 ; CHECK-NEXT: .short 0
434 ; Loc 4: Arg3 spilled to %r15 +
435 ; CHECK-NEXT: .byte 3
436 ; CHECK-NEXT: .byte 0
437 ; CHECK-NEXT: .short 8
438 ; CHECK-NEXT: .short 15
439 ; CHECK-NEXT: .short 0
441 define i64 @patchpoint_spillargs(i64 %p1, i64 %p2, i64 %p3, i64 %p4) {
443 tail call void asm sideeffect "nopr %r0", "~{r0},~{r1},~{r2},~{r3},~{r4},~{r5},~{r6},~{r7},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14}"() nounwind
444 %result = tail call anyregcc i64 (i64, i32, ptr, i32, ...) @llvm.experimental.patchpoint.i64(i64 13, i32 14, ptr inttoptr (i64 0 to ptr), i32 2, i64 %p1, i64 %p2, i64 %p3, i64 %p4)
448 declare void @llvm.experimental.patchpoint.void(i64, i32, ptr, i32, ...)
449 declare i64 @llvm.experimental.patchpoint.i64(i64, i32, ptr, i32, ...)