]> git.proxmox.com Git - rustc.git/blob - src/binaryen/test/llvm_autogenerated/cfg-stackify.s
New upstream version 1.23.0+dfsg1
[rustc.git] / src / binaryen / test / llvm_autogenerated / cfg-stackify.s
1 .text
2 .file "/s/llvm-upstream/llvm/test/CodeGen/WebAssembly/cfg-stackify.ll"
3 .globl test0
4 .type test0,@function
5 test0:
6 .param i32
7 .local i32
8 i32.const $1=, 1
9 .LBB0_1:
10 loop
11 block
12 i32.lt_s $push0=, $1, $0
13 br_if 0, $pop0
14 return
15 .LBB0_3:
16 end_block
17 i32.const $push1=, 1
18 i32.add $1=, $1, $pop1
19 call something@FUNCTION
20 br 0
21 .LBB0_4:
22 end_loop
23 .endfunc
24 .Lfunc_end0:
25 .size test0, .Lfunc_end0-test0
26
27 .globl test1
28 .type test1,@function
29 test1:
30 .param i32
31 .local i32
32 i32.const $1=, 1
33 .LBB1_1:
34 loop
35 block
36 i32.lt_s $push0=, $1, $0
37 br_if 0, $pop0
38 return
39 .LBB1_3:
40 end_block
41 i32.const $push1=, 1
42 i32.add $1=, $1, $pop1
43 call something@FUNCTION
44 br 0
45 .LBB1_4:
46 end_loop
47 .endfunc
48 .Lfunc_end1:
49 .size test1, .Lfunc_end1-test1
50
51 .globl test2
52 .type test2,@function
53 test2:
54 .param i32, i32
55 block
56 i32.const $push0=, 1
57 i32.lt_s $push1=, $1, $pop0
58 br_if 0, $pop1
59 .LBB2_2:
60 loop
61 f64.load $push2=, 0($0)
62 f64.const $push8=, 0x1.999999999999ap1
63 f64.mul $push3=, $pop2, $pop8
64 f64.store 0($0), $pop3
65 i32.const $push7=, 8
66 i32.add $0=, $0, $pop7
67 i32.const $push6=, -1
68 i32.add $push5=, $1, $pop6
69 tee_local $push4=, $1=, $pop5
70 br_if 0, $pop4
71 .LBB2_3:
72 end_loop
73 end_block
74 return
75 .endfunc
76 .Lfunc_end2:
77 .size test2, .Lfunc_end2-test2
78
79 .globl doublediamond
80 .type doublediamond,@function
81 doublediamond:
82 .param i32, i32, i32
83 .result i32
84 i32.const $push0=, 0
85 i32.store 0($2), $pop0
86 block
87 block
88 br_if 0, $0
89 i32.const $push4=, 1
90 i32.store 0($2), $pop4
91 br 1
92 .LBB3_2:
93 end_block
94 i32.const $push1=, 2
95 i32.store 0($2), $pop1
96 block
97 br_if 0, $1
98 i32.const $push3=, 3
99 i32.store 0($2), $pop3
100 br 1
101 .LBB3_4:
102 end_block
103 i32.const $push2=, 4
104 i32.store 0($2), $pop2
105 .LBB3_5:
106 end_block
107 i32.const $push5=, 5
108 i32.store 0($2), $pop5
109 i32.const $push6=, 0
110 return $pop6
111 .endfunc
112 .Lfunc_end3:
113 .size doublediamond, .Lfunc_end3-doublediamond
114
115 .globl triangle
116 .type triangle,@function
117 triangle:
118 .param i32, i32
119 .result i32
120 i32.const $push2=, 0
121 i32.store 0($0), $pop2
122 block
123 br_if 0, $1
124 i32.const $push0=, 1
125 i32.store 0($0), $pop0
126 .LBB4_2:
127 end_block
128 i32.const $push1=, 2
129 i32.store 0($0), $pop1
130 i32.const $push3=, 0
131 return $pop3
132 .endfunc
133 .Lfunc_end4:
134 .size triangle, .Lfunc_end4-triangle
135
136 .globl diamond
137 .type diamond,@function
138 diamond:
139 .param i32, i32
140 .result i32
141 i32.const $push0=, 0
142 i32.store 0($0), $pop0
143 block
144 block
145 br_if 0, $1
146 i32.const $push2=, 1
147 i32.store 0($0), $pop2
148 br 1
149 .LBB5_2:
150 end_block
151 i32.const $push1=, 2
152 i32.store 0($0), $pop1
153 .LBB5_3:
154 end_block
155 i32.const $push3=, 3
156 i32.store 0($0), $pop3
157 i32.const $push4=, 0
158 return $pop4
159 .endfunc
160 .Lfunc_end5:
161 .size diamond, .Lfunc_end5-diamond
162
163 .globl single_block
164 .type single_block,@function
165 single_block:
166 .param i32
167 .result i32
168 i32.const $push0=, 0
169 i32.store 0($0), $pop0
170 i32.const $push1=, 0
171 return $pop1
172 .endfunc
173 .Lfunc_end6:
174 .size single_block, .Lfunc_end6-single_block
175
176 .globl minimal_loop
177 .type minimal_loop,@function
178 minimal_loop:
179 .param i32
180 .result i32
181 i32.const $push0=, 0
182 i32.store 0($0), $pop0
183 .LBB7_1:
184 loop i32
185 i32.const $push1=, 1
186 i32.store 0($0), $pop1
187 br 0
188 .LBB7_2:
189 end_loop
190 .endfunc
191 .Lfunc_end7:
192 .size minimal_loop, .Lfunc_end7-minimal_loop
193
194 .globl simple_loop
195 .type simple_loop,@function
196 simple_loop:
197 .param i32, i32
198 .result i32
199 i32.const $push0=, 0
200 i32.store 0($0), $pop0
201 .LBB8_1:
202 loop
203 i32.const $push3=, 1
204 i32.store 0($0), $pop3
205 i32.eqz $push4=, $1
206 br_if 0, $pop4
207 end_loop
208 i32.const $push1=, 2
209 i32.store 0($0), $pop1
210 i32.const $push2=, 0
211 return $pop2
212 .endfunc
213 .Lfunc_end8:
214 .size simple_loop, .Lfunc_end8-simple_loop
215
216 .globl doubletriangle
217 .type doubletriangle,@function
218 doubletriangle:
219 .param i32, i32, i32
220 .result i32
221 i32.const $push4=, 0
222 i32.store 0($2), $pop4
223 block
224 br_if 0, $0
225 i32.const $push0=, 2
226 i32.store 0($2), $pop0
227 block
228 br_if 0, $1
229 i32.const $push1=, 3
230 i32.store 0($2), $pop1
231 .LBB9_3:
232 end_block
233 i32.const $push2=, 4
234 i32.store 0($2), $pop2
235 .LBB9_4:
236 end_block
237 i32.const $push3=, 5
238 i32.store 0($2), $pop3
239 i32.const $push5=, 0
240 return $pop5
241 .endfunc
242 .Lfunc_end9:
243 .size doubletriangle, .Lfunc_end9-doubletriangle
244
245 .globl ifelse_earlyexits
246 .type ifelse_earlyexits,@function
247 ifelse_earlyexits:
248 .param i32, i32, i32
249 .result i32
250 i32.const $push0=, 0
251 i32.store 0($2), $pop0
252 block
253 block
254 br_if 0, $0
255 i32.const $push3=, 1
256 i32.store 0($2), $pop3
257 br 1
258 .LBB10_2:
259 end_block
260 i32.const $push1=, 2
261 i32.store 0($2), $pop1
262 br_if 0, $1
263 i32.const $push2=, 3
264 i32.store 0($2), $pop2
265 .LBB10_4:
266 end_block
267 i32.const $push4=, 4
268 i32.store 0($2), $pop4
269 i32.const $push5=, 0
270 return $pop5
271 .endfunc
272 .Lfunc_end10:
273 .size ifelse_earlyexits, .Lfunc_end10-ifelse_earlyexits
274
275 .globl doublediamond_in_a_loop
276 .type doublediamond_in_a_loop,@function
277 doublediamond_in_a_loop:
278 .param i32, i32, i32
279 .result i32
280 .LBB11_1:
281 loop i32
282 i32.const $push0=, 0
283 i32.store 0($2), $pop0
284 block
285 br_if 0, $0
286 i32.const $push2=, 1
287 i32.store 0($2), $pop2
288 i32.const $push1=, 5
289 i32.store 0($2), $pop1
290 br 1
291 .LBB11_3:
292 end_block
293 i32.const $push3=, 2
294 i32.store 0($2), $pop3
295 block
296 br_if 0, $1
297 i32.const $push5=, 3
298 i32.store 0($2), $pop5
299 i32.const $push4=, 5
300 i32.store 0($2), $pop4
301 br 1
302 .LBB11_5:
303 end_block
304 i32.const $push7=, 4
305 i32.store 0($2), $pop7
306 i32.const $push6=, 5
307 i32.store 0($2), $pop6
308 br 0
309 .LBB11_6:
310 end_loop
311 .endfunc
312 .Lfunc_end11:
313 .size doublediamond_in_a_loop, .Lfunc_end11-doublediamond_in_a_loop
314
315 .globl test3
316 .type test3,@function
317 test3:
318 .param i32
319 block
320 i32.const $push0=, 0
321 br_if 0, $pop0
322 i32.eq $0=, $0, $0
323 .LBB12_2:
324 block
325 loop
326 br_if 1, $0
327 .LBB12_3:
328 loop
329 i32.eqz $push1=, $0
330 br_if 0, $pop1
331 end_loop
332 call bar@FUNCTION
333 br 0
334 .LBB12_5:
335 end_loop
336 end_block
337 unreachable
338 .LBB12_6:
339 end_block
340 return
341 .endfunc
342 .Lfunc_end12:
343 .size test3, .Lfunc_end12-test3
344
345 .globl test4
346 .type test4,@function
347 test4:
348 .param i32
349 block
350 block
351 i32.const $push0=, 3
352 i32.gt_s $push1=, $0, $pop0
353 br_if 0, $pop1
354 i32.eqz $push7=, $0
355 br_if 1, $pop7
356 i32.const $push6=, 2
357 i32.eq $drop=, $0, $pop6
358 br 1
359 .LBB13_3:
360 end_block
361 block
362 i32.const $push2=, 4
363 i32.eq $push3=, $0, $pop2
364 br_if 0, $pop3
365 i32.const $push4=, 622
366 i32.ne $push5=, $0, $pop4
367 br_if 1, $pop5
368 .LBB13_5:
369 end_block
370 return
371 .LBB13_6:
372 end_block
373 return
374 .endfunc
375 .Lfunc_end13:
376 .size test4, .Lfunc_end13-test4
377
378 .globl test5
379 .type test5,@function
380 test5:
381 .param i32, i32
382 i32.const $push5=, 1
383 i32.and $0=, $0, $pop5
384 i32.const $push4=, 1
385 i32.and $1=, $1, $pop4
386 .LBB14_1:
387 block
388 loop
389 i32.const $push7=, 0
390 i32.const $push6=, 0
391 i32.store 0($pop7), $pop6
392 i32.eqz $push10=, $0
393 br_if 1, $pop10
394 i32.const $push9=, 0
395 i32.const $push8=, 1
396 i32.store 0($pop9), $pop8
397 br_if 0, $1
398 end_loop
399 i32.const $push3=, 0
400 i32.const $push2=, 3
401 i32.store 0($pop3), $pop2
402 return
403 .LBB14_4:
404 end_block
405 i32.const $push1=, 0
406 i32.const $push0=, 2
407 i32.store 0($pop1), $pop0
408 return
409 .endfunc
410 .Lfunc_end14:
411 .size test5, .Lfunc_end14-test5
412
413 .globl test6
414 .type test6,@function
415 test6:
416 .param i32, i32
417 .local i32
418 i32.const $push6=, 1
419 i32.and $2=, $0, $pop6
420 .LBB15_1:
421 block
422 block
423 loop
424 i32.const $push8=, 0
425 i32.const $push7=, 0
426 i32.store 0($pop8), $pop7
427 i32.eqz $push16=, $2
428 br_if 2, $pop16
429 i32.const $push13=, 0
430 i32.const $push12=, 1
431 i32.store 0($pop13), $pop12
432 i32.const $push11=, 1
433 i32.and $push10=, $1, $pop11
434 tee_local $push9=, $0=, $pop10
435 i32.eqz $push17=, $pop9
436 br_if 1, $pop17
437 i32.const $push15=, 0
438 i32.const $push14=, 1
439 i32.store 0($pop15), $pop14
440 br_if 0, $0
441 end_loop
442 i32.const $push5=, 0
443 i32.const $push4=, 2
444 i32.store 0($pop5), $pop4
445 return
446 .LBB15_5:
447 end_block
448 i32.const $push1=, 0
449 i32.const $push0=, 3
450 i32.store 0($pop1), $pop0
451 .LBB15_6:
452 end_block
453 i32.const $push3=, 0
454 i32.const $push2=, 4
455 i32.store 0($pop3), $pop2
456 return
457 .endfunc
458 .Lfunc_end15:
459 .size test6, .Lfunc_end15-test6
460
461 .globl test7
462 .type test7,@function
463 test7:
464 .param i32, i32
465 i32.const $push8=, 0
466 i32.const $push7=, 0
467 i32.store 0($pop8), $pop7
468 i32.const $push6=, 1
469 i32.and $0=, $0, $pop6
470 .LBB16_1:
471 loop
472 i32.const $push10=, 0
473 i32.const $push9=, 1
474 i32.store 0($pop10), $pop9
475 block
476 br_if 0, $0
477 i32.const $push13=, 0
478 i32.const $push12=, 2
479 i32.store 0($pop13), $pop12
480 i32.const $push11=, 1
481 i32.and $push0=, $1, $pop11
482 br_if 1, $pop0
483 i32.const $push2=, 0
484 i32.const $push1=, 4
485 i32.store 0($pop2), $pop1
486 unreachable
487 .LBB16_4:
488 end_block
489 i32.const $push16=, 0
490 i32.const $push15=, 3
491 i32.store 0($pop16), $pop15
492 i32.const $push14=, 1
493 i32.and $push3=, $1, $pop14
494 br_if 0, $pop3
495 end_loop
496 i32.const $push5=, 0
497 i32.const $push4=, 5
498 i32.store 0($pop5), $pop4
499 unreachable
500 .endfunc
501 .Lfunc_end16:
502 .size test7, .Lfunc_end16-test7
503
504 .globl test8
505 .type test8,@function
506 test8:
507 .result i32
508 .LBB17_1:
509 loop i32
510 i32.const $push0=, 0
511 br_if 0, $pop0
512 br 0
513 .LBB17_2:
514 end_loop
515 .endfunc
516 .Lfunc_end17:
517 .size test8, .Lfunc_end17-test8
518
519 .globl test9
520 .type test9,@function
521 test9:
522 i32.const $push11=, 0
523 i32.const $push10=, 0
524 i32.store 0($pop11), $pop10
525 .LBB18_1:
526 block
527 loop
528 i32.const $push14=, 0
529 i32.const $push13=, 1
530 i32.store 0($pop14), $pop13
531 i32.call $push0=, a@FUNCTION
532 i32.const $push12=, 1
533 i32.and $push1=, $pop0, $pop12
534 i32.eqz $push24=, $pop1
535 br_if 1, $pop24
536 .LBB18_2:
537 loop
538 i32.const $push17=, 0
539 i32.const $push16=, 2
540 i32.store 0($pop17), $pop16
541 block
542 i32.call $push4=, a@FUNCTION
543 i32.const $push15=, 1
544 i32.and $push5=, $pop4, $pop15
545 i32.eqz $push25=, $pop5
546 br_if 0, $pop25
547 i32.const $push20=, 0
548 i32.const $push19=, 3
549 i32.store 0($pop20), $pop19
550 i32.call $push8=, a@FUNCTION
551 i32.const $push18=, 1
552 i32.and $push9=, $pop8, $pop18
553 i32.eqz $push26=, $pop9
554 br_if 2, $pop26
555 br 1
556 .LBB18_4:
557 end_block
558 i32.const $push23=, 0
559 i32.const $push22=, 4
560 i32.store 0($pop23), $pop22
561 i32.call $push6=, a@FUNCTION
562 i32.const $push21=, 1
563 i32.and $push7=, $pop6, $pop21
564 i32.eqz $push27=, $pop7
565 br_if 1, $pop27
566 br 0
567 .LBB18_5:
568 end_loop
569 end_loop
570 end_block
571 i32.const $push3=, 0
572 i32.const $push2=, 5
573 i32.store 0($pop3), $pop2
574 return
575 .endfunc
576 .Lfunc_end18:
577 .size test9, .Lfunc_end18-test9
578
579 .globl test10
580 .type test10,@function
581 test10:
582 .local i32, i32, i32, i32, i32
583 i32.const $0=, 2
584 .LBB19_1:
585 loop
586 copy_local $2=, $1
587 copy_local $3=, $0
588 i32.const $1=, 0
589 i32.const $0=, 3
590 br_if 0, $2
591 i32.const $2=, 4
592 .LBB19_3:
593 block
594 loop
595 copy_local $4=, $3
596 copy_local $3=, $2
597 .LBB19_4:
598 loop
599 copy_local $push3=, $4
600 tee_local $push2=, $2=, $pop3
601 i32.const $push1=, 4
602 i32.gt_u $push0=, $pop2, $pop1
603 br_if 3, $pop0
604 block
605 copy_local $4=, $3
606 br_table $2, 1, 0, 4, 2, 3, 1
607 .LBB19_6:
608 end_block
609 end_loop
610 end_loop
611 return
612 .LBB19_7:
613 end_block
614 i32.const $1=, 1
615 br 0
616 .LBB19_8:
617 end_loop
618 .endfunc
619 .Lfunc_end19:
620 .size test10, .Lfunc_end19-test10
621
622 .globl test11
623 .type test11,@function
624 test11:
625 i32.const $push14=, 0
626 i32.const $push13=, 0
627 i32.store 0($pop14), $pop13
628 block
629 block
630 block
631 block
632 i32.const $push12=, 0
633 br_if 0, $pop12
634 i32.const $push16=, 0
635 i32.const $push5=, 1
636 i32.store 0($pop16), $pop5
637 block
638 i32.const $push15=, 0
639 br_if 0, $pop15
640 i32.const $push7=, 0
641 i32.const $push6=, 2
642 i32.store 0($pop7), $pop6
643 i32.const $push17=, 0
644 br_if 2, $pop17
645 .LBB20_3:
646 end_block
647 i32.const $push11=, 0
648 i32.const $push10=, 3
649 i32.store 0($pop11), $pop10
650 return
651 .LBB20_4:
652 end_block
653 i32.const $push19=, 0
654 i32.const $push0=, 4
655 i32.store 0($pop19), $pop0
656 i32.const $push18=, 0
657 br_if 1, $pop18
658 i32.const $push21=, 0
659 i32.const $push1=, 5
660 i32.store 0($pop21), $pop1
661 i32.const $push20=, 0
662 i32.eqz $push23=, $pop20
663 br_if 2, $pop23
664 .LBB20_6:
665 end_block
666 i32.const $push9=, 0
667 i32.const $push8=, 7
668 i32.store 0($pop9), $pop8
669 return
670 .LBB20_7:
671 end_block
672 i32.const $push4=, 0
673 i32.const $push3=, 8
674 i32.store 0($pop4), $pop3
675 return
676 .LBB20_8:
677 end_block
678 i32.const $push22=, 0
679 i32.const $push2=, 6
680 i32.store 0($pop22), $pop2
681 return
682 .endfunc
683 .Lfunc_end20:
684 .size test11, .Lfunc_end20-test11
685
686 .globl test12
687 .type test12,@function
688 test12:
689 .param i32
690 .local i32
691 .LBB21_1:
692 block
693 loop
694 block
695 block
696 i32.load8_u $push7=, 0($0)
697 tee_local $push6=, $1=, $pop7
698 i32.const $push5=, 103
699 i32.gt_s $push0=, $pop6, $pop5
700 br_if 0, $pop0
701 i32.const $push8=, 42
702 i32.eq $push3=, $1, $pop8
703 br_if 1, $pop3
704 i32.const $push9=, 76
705 i32.eq $push4=, $1, $pop9
706 br_if 1, $pop4
707 br 3
708 .LBB21_4:
709 end_block
710 i32.const $push10=, 108
711 i32.eq $push1=, $1, $pop10
712 br_if 0, $pop1
713 i32.const $push11=, 104
714 i32.ne $push2=, $1, $pop11
715 br_if 2, $pop2
716 .LBB21_6:
717 end_block
718 i32.const $push12=, 1
719 i32.add $0=, $0, $pop12
720 br 0
721 .LBB21_7:
722 end_loop
723 end_block
724 return
725 .endfunc
726 .Lfunc_end21:
727 .size test12, .Lfunc_end21-test12
728
729 .globl test13
730 .type test13,@function
731 test13:
732 .local i32
733 block
734 block
735 i32.const $push0=, 0
736 br_if 0, $pop0
737 i32.const $0=, 0
738 block
739 i32.const $push3=, 0
740 br_if 0, $pop3
741 i32.const $0=, 0
742 .LBB22_3:
743 end_block
744 i32.const $push1=, 1
745 i32.and $push2=, $0, $pop1
746 br_if 1, $pop2
747 br 1
748 .LBB22_4:
749 end_block
750 return
751 .LBB22_5:
752 end_block
753 unreachable
754 .endfunc
755 .Lfunc_end22:
756 .size test13, .Lfunc_end22-test13
757
758 .globl test14
759 .type test14,@function
760 test14:
761 .LBB23_1:
762 loop
763 i32.const $push0=, 0
764 br_if 0, $pop0
765 end_loop
766 .LBB23_3:
767 loop
768 i32.const $push1=, 0
769 br_if 0, $pop1
770 end_loop
771 return
772 .endfunc
773 .Lfunc_end23:
774 .size test14, .Lfunc_end23-test14
775
776 .globl test15
777 .type test15,@function
778 test15:
779 .local i32, i32
780 block
781 block
782 i32.const $push0=, 1
783 br_if 0, $pop0
784 i32.const $0=, 0
785 .LBB24_2:
786 block
787 block
788 loop
789 i32.const $push1=, 1
790 br_if 1, $pop1
791 i32.const $1=, 0
792 i32.const $push4=, -4
793 i32.add $push3=, $0, $pop4
794 tee_local $push2=, $0=, $pop3
795 br_if 0, $pop2
796 br 2
797 .LBB24_4:
798 end_loop
799 end_block
800 i32.const $1=, 0
801 .LBB24_5:
802 end_block
803 i32.eqz $push5=, $1
804 br_if 1, $pop5
805 call test15_callee0@FUNCTION
806 return
807 .LBB24_7:
808 end_block
809 call test15_callee1@FUNCTION
810 .LBB24_8:
811 end_block
812 return
813 .endfunc
814 .Lfunc_end24:
815 .size test15, .Lfunc_end24-test15
816
817
818 .functype something, void
819 .functype bar, void
820 .functype a, i32
821 .functype test15_callee0, void
822 .functype test15_callee1, void