1 ; RUN: llc -march=hexagon < %s | FileCheck %s
3 target triple = "hexagon"
5 declare void @llvm.write_register.i32(metadata, i32) #1
6 declare void @llvm.write_register.i64(metadata, i64) #1
7 declare i32 @llvm.read_register.i32(metadata) #2
8 declare i64 @llvm.read_register.i64(metadata) #2
10 ; CHECK-LABEL: reg_r0:
12 define dso_local i32 @reg_r0() #0 {
14 call void @llvm.write_register.i32(metadata !0, i32 1)
15 %0 = call i32 @llvm.read_register.i32(metadata !0)
19 ; CHECK-LABEL: reg_r1:
22 define dso_local i32 @reg_r1() #0 {
24 call void @llvm.write_register.i32(metadata !1, i32 1)
25 %0 = call i32 @llvm.read_register.i32(metadata !1)
29 ; CHECK-LABEL: reg_r2:
32 define dso_local i32 @reg_r2() #0 {
34 call void @llvm.write_register.i32(metadata !2, i32 1)
35 %0 = call i32 @llvm.read_register.i32(metadata !2)
39 ; CHECK-LABEL: reg_r3:
42 define dso_local i32 @reg_r3() #0 {
44 call void @llvm.write_register.i32(metadata !3, i32 1)
45 %0 = call i32 @llvm.read_register.i32(metadata !3)
49 ; CHECK-LABEL: reg_r4:
52 define dso_local i32 @reg_r4() #0 {
54 call void @llvm.write_register.i32(metadata !4, i32 1)
55 %0 = call i32 @llvm.read_register.i32(metadata !4)
59 ; CHECK-LABEL: reg_r5:
62 define dso_local i32 @reg_r5() #0 {
64 call void @llvm.write_register.i32(metadata !5, i32 1)
65 %0 = call i32 @llvm.read_register.i32(metadata !5)
69 ; CHECK-LABEL: reg_r6:
72 define dso_local i32 @reg_r6() #0 {
74 call void @llvm.write_register.i32(metadata !6, i32 1)
75 %0 = call i32 @llvm.read_register.i32(metadata !6)
79 ; CHECK-LABEL: reg_r7:
82 define dso_local i32 @reg_r7() #0 {
84 call void @llvm.write_register.i32(metadata !7, i32 1)
85 %0 = call i32 @llvm.read_register.i32(metadata !7)
89 ; CHECK-LABEL: reg_r8:
92 define dso_local i32 @reg_r8() #0 {
94 call void @llvm.write_register.i32(metadata !8, i32 1)
95 %0 = call i32 @llvm.read_register.i32(metadata !8)
99 ; CHECK-LABEL: reg_r9:
102 define dso_local i32 @reg_r9() #0 {
104 call void @llvm.write_register.i32(metadata !9, i32 1)
105 %0 = call i32 @llvm.read_register.i32(metadata !9)
109 ; CHECK-LABEL: reg_r10:
112 define dso_local i32 @reg_r10() #0 {
114 call void @llvm.write_register.i32(metadata !10, i32 1)
115 %0 = call i32 @llvm.read_register.i32(metadata !10)
119 ; CHECK-LABEL: reg_r11:
122 define dso_local i32 @reg_r11() #0 {
124 call void @llvm.write_register.i32(metadata !11, i32 1)
125 %0 = call i32 @llvm.read_register.i32(metadata !11)
129 ; CHECK-LABEL: reg_r12:
132 define dso_local i32 @reg_r12() #0 {
134 call void @llvm.write_register.i32(metadata !12, i32 1)
135 %0 = call i32 @llvm.read_register.i32(metadata !12)
139 ; CHECK-LABEL: reg_r13:
142 define dso_local i32 @reg_r13() #0 {
144 call void @llvm.write_register.i32(metadata !13, i32 1)
145 %0 = call i32 @llvm.read_register.i32(metadata !13)
149 ; CHECK-LABEL: reg_r14:
152 define dso_local i32 @reg_r14() #0 {
154 call void @llvm.write_register.i32(metadata !14, i32 1)
155 %0 = call i32 @llvm.read_register.i32(metadata !14)
159 ; CHECK-LABEL: reg_r15:
162 define dso_local i32 @reg_r15() #0 {
164 call void @llvm.write_register.i32(metadata !15, i32 1)
165 %0 = call i32 @llvm.read_register.i32(metadata !15)
169 ; CHECK-LABEL: reg_r16:
172 define dso_local i32 @reg_r16() #0 {
174 call void @llvm.write_register.i32(metadata !16, i32 1)
175 %0 = call i32 @llvm.read_register.i32(metadata !16)
179 ; CHECK-LABEL: reg_r17:
182 define dso_local i32 @reg_r17() #0 {
184 call void @llvm.write_register.i32(metadata !17, i32 1)
185 %0 = call i32 @llvm.read_register.i32(metadata !17)
189 ; CHECK-LABEL: reg_r18:
192 define dso_local i32 @reg_r18() #0 {
194 call void @llvm.write_register.i32(metadata !18, i32 1)
195 %0 = call i32 @llvm.read_register.i32(metadata !18)
199 ; CHECK-LABEL: reg_r19:
202 define dso_local i32 @reg_r19() #0 {
204 call void @llvm.write_register.i32(metadata !19, i32 1)
205 %0 = call i32 @llvm.read_register.i32(metadata !19)
209 ; CHECK-LABEL: reg_r20:
212 define dso_local i32 @reg_r20() #0 {
214 call void @llvm.write_register.i32(metadata !20, i32 1)
215 %0 = call i32 @llvm.read_register.i32(metadata !20)
219 ; CHECK-LABEL: reg_r21:
222 define dso_local i32 @reg_r21() #0 {
224 call void @llvm.write_register.i32(metadata !21, i32 1)
225 %0 = call i32 @llvm.read_register.i32(metadata !21)
229 ; CHECK-LABEL: reg_r22:
232 define dso_local i32 @reg_r22() #0 {
234 call void @llvm.write_register.i32(metadata !22, i32 1)
235 %0 = call i32 @llvm.read_register.i32(metadata !22)
239 ; CHECK-LABEL: reg_r23:
242 define dso_local i32 @reg_r23() #0 {
244 call void @llvm.write_register.i32(metadata !23, i32 1)
245 %0 = call i32 @llvm.read_register.i32(metadata !23)
249 ; CHECK-LABEL: reg_r24:
252 define dso_local i32 @reg_r24() #0 {
254 call void @llvm.write_register.i32(metadata !24, i32 1)
255 %0 = call i32 @llvm.read_register.i32(metadata !24)
259 ; CHECK-LABEL: reg_r25:
262 define dso_local i32 @reg_r25() #0 {
264 call void @llvm.write_register.i32(metadata !25, i32 1)
265 %0 = call i32 @llvm.read_register.i32(metadata !25)
269 ; CHECK-LABEL: reg_r26:
272 define dso_local i32 @reg_r26() #0 {
274 call void @llvm.write_register.i32(metadata !26, i32 1)
275 %0 = call i32 @llvm.read_register.i32(metadata !26)
279 ; CHECK-LABEL: reg_r27:
282 define dso_local i32 @reg_r27() #0 {
284 call void @llvm.write_register.i32(metadata !27, i32 1)
285 %0 = call i32 @llvm.read_register.i32(metadata !27)
289 ; CHECK-LABEL: reg_r28:
292 define dso_local i32 @reg_r28() #0 {
294 call void @llvm.write_register.i32(metadata !28, i32 1)
295 %0 = call i32 @llvm.read_register.i32(metadata !28)
299 ; CHECK-LABEL: reg_r29:
302 define dso_local i32 @reg_r29() #0 {
304 call void @llvm.write_register.i32(metadata !29, i32 1)
305 %0 = call i32 @llvm.read_register.i32(metadata !29)
309 ; CHECK-LABEL: reg_r30:
312 define dso_local i32 @reg_r30() #0 {
314 call void @llvm.write_register.i32(metadata !30, i32 1)
315 %0 = call i32 @llvm.read_register.i32(metadata !30)
319 ; CHECK-LABEL: reg_r31:
322 define dso_local i32 @reg_r31() #0 {
324 call void @llvm.write_register.i32(metadata !31, i32 1)
325 %0 = call i32 @llvm.read_register.i32(metadata !31)
329 ; CHECK-LABEL: reg_d0:
330 ; CHECK: r1:0 = combine(#0,#1)
331 define dso_local i64 @reg_d0() #0 {
333 call void @llvm.write_register.i64(metadata !32, i64 1)
334 %0 = call i64 @llvm.read_register.i64(metadata !32)
338 ; CHECK-LABEL: reg_d1:
339 ; CHECK: r3:2 = combine(#0,#1)
340 ; CHECK: r1:0 = combine(r3,r2)
341 define dso_local i64 @reg_d1() #0 {
343 call void @llvm.write_register.i64(metadata !33, i64 1)
344 %0 = call i64 @llvm.read_register.i64(metadata !33)
348 ; CHECK-LABEL: reg_d2:
349 ; CHECK: r5:4 = combine(#0,#1)
350 ; CHECK: r1:0 = combine(r5,r4)
351 define dso_local i64 @reg_d2() #0 {
353 call void @llvm.write_register.i64(metadata !34, i64 1)
354 %0 = call i64 @llvm.read_register.i64(metadata !34)
358 ; CHECK-LABEL: reg_d3:
359 ; CHECK: r7:6 = combine(#0,#1)
360 ; CHECK: r1:0 = combine(r7,r6)
361 define dso_local i64 @reg_d3() #0 {
363 call void @llvm.write_register.i64(metadata !35, i64 1)
364 %0 = call i64 @llvm.read_register.i64(metadata !35)
368 ; CHECK-LABEL: reg_d4:
369 ; CHECK: r9:8 = combine(#0,#1)
370 ; CHECK: r1:0 = combine(r9,r8)
371 define dso_local i64 @reg_d4() #0 {
373 call void @llvm.write_register.i64(metadata !36, i64 1)
374 %0 = call i64 @llvm.read_register.i64(metadata !36)
378 ; CHECK-LABEL: reg_d5:
379 ; CHECK: r11:10 = combine(#0,#1)
380 ; CHECK: r1:0 = combine(r11,r10)
381 define dso_local i64 @reg_d5() #0 {
383 call void @llvm.write_register.i64(metadata !37, i64 1)
384 %0 = call i64 @llvm.read_register.i64(metadata !37)
388 ; CHECK-LABEL: reg_d6:
389 ; CHECK: r13:12 = combine(#0,#1)
390 ; CHECK: r1:0 = combine(r13,r12)
391 define dso_local i64 @reg_d6() #0 {
393 call void @llvm.write_register.i64(metadata !38, i64 1)
394 %0 = call i64 @llvm.read_register.i64(metadata !38)
398 ; CHECK-LABEL: reg_d7:
399 ; CHECK: r15:14 = combine(#0,#1)
400 ; CHECK: r1:0 = combine(r15,r14)
401 define dso_local i64 @reg_d7() #0 {
403 call void @llvm.write_register.i64(metadata !39, i64 1)
404 %0 = call i64 @llvm.read_register.i64(metadata !39)
408 ; CHECK-LABEL: reg_d8:
409 ; CHECK: r17:16 = combine(#0,#1)
410 ; CHECK: r1:0 = combine(r17,r16)
411 define dso_local i64 @reg_d8() #0 {
413 call void @llvm.write_register.i64(metadata !40, i64 1)
414 %0 = call i64 @llvm.read_register.i64(metadata !40)
418 ; CHECK-LABEL: reg_d9:
419 ; CHECK: r19:18 = combine(#0,#1)
420 ; CHECK: r1:0 = combine(r19,r18)
421 define dso_local i64 @reg_d9() #0 {
423 call void @llvm.write_register.i64(metadata !41, i64 1)
424 %0 = call i64 @llvm.read_register.i64(metadata !41)
428 ; CHECK-LABEL: reg_d10:
429 ; CHECK: r21:20 = combine(#0,#1)
430 ; CHECK: r1:0 = combine(r21,r20)
431 define dso_local i64 @reg_d10() #0 {
433 call void @llvm.write_register.i64(metadata !42, i64 1)
434 %0 = call i64 @llvm.read_register.i64(metadata !42)
438 ; CHECK-LABEL: reg_d11:
439 ; CHECK: r23:22 = combine(#0,#1)
440 ; CHECK: r1:0 = combine(r23,r22)
441 define dso_local i64 @reg_d11() #0 {
443 call void @llvm.write_register.i64(metadata !43, i64 1)
444 %0 = call i64 @llvm.read_register.i64(metadata !43)
448 ; CHECK-LABEL: reg_d12:
449 ; CHECK: r25:24 = combine(#0,#1)
450 ; CHECK: r1:0 = combine(r25,r24)
451 define dso_local i64 @reg_d12() #0 {
453 call void @llvm.write_register.i64(metadata !44, i64 1)
454 %0 = call i64 @llvm.read_register.i64(metadata !44)
458 ; CHECK-LABEL: reg_d13:
459 ; CHECK: r27:26 = combine(#0,#1)
460 ; CHECK: r1:0 = combine(r27,r26)
461 define dso_local i64 @reg_d13() #0 {
463 call void @llvm.write_register.i64(metadata !45, i64 1)
464 %0 = call i64 @llvm.read_register.i64(metadata !45)
468 ; CHECK-LABEL: reg_d14:
469 ; CHECK: r29:28 = combine(#0,#1)
470 ; CHECK: r1:0 = combine(r29,r28)
471 define dso_local i64 @reg_d14() #0 {
473 call void @llvm.write_register.i64(metadata !46, i64 1)
474 %0 = call i64 @llvm.read_register.i64(metadata !46)
478 ; CHECK-LABEL: reg_d15:
479 ; CHECK: r31:30 = combine(#0,#1)
480 ; CHECK: r1:0 = combine(r31,r30)
481 define dso_local i64 @reg_d15() #0 {
483 call void @llvm.write_register.i64(metadata !47, i64 1)
484 %0 = call i64 @llvm.read_register.i64(metadata !47)
488 ; CHECK-LABEL: reg_sp:
491 define dso_local i32 @reg_sp() #0 {
493 call void @llvm.write_register.i32(metadata !48, i32 1)
494 %0 = call i32 @llvm.read_register.i32(metadata !48)
498 ; CHECK-LABEL: reg_fp:
501 define dso_local i32 @reg_fp() #0 {
503 call void @llvm.write_register.i32(metadata !49, i32 1)
504 %0 = call i32 @llvm.read_register.i32(metadata !49)
508 ; CHECK-LABEL: reg_lr:
511 define dso_local i32 @reg_lr() #0 {
513 call void @llvm.write_register.i32(metadata !50, i32 1)
514 %0 = call i32 @llvm.read_register.i32(metadata !50)
518 ; CHECK-LABEL: reg_p0:
521 define dso_local i32 @reg_p0() #0 {
523 %0 = call i32 @llvm.read_register.i32(metadata !31)
524 call void @llvm.write_register.i32(metadata !51, i32 %0)
525 %1 = call i32 @llvm.read_register.i32(metadata !51)
529 ; CHECK-LABEL: reg_p1:
532 define dso_local i32 @reg_p1() #0 {
534 %0 = call i32 @llvm.read_register.i32(metadata !31)
535 call void @llvm.write_register.i32(metadata !52, i32 %0)
536 %1 = call i32 @llvm.read_register.i32(metadata !52)
540 ; CHECK-LABEL: reg_p2:
543 define dso_local i32 @reg_p2() #0 {
545 %0 = call i32 @llvm.read_register.i32(metadata !31)
546 call void @llvm.write_register.i32(metadata !53, i32 %0)
547 %1 = call i32 @llvm.read_register.i32(metadata !53)
551 ; CHECK-LABEL: reg_p3:
554 define dso_local i32 @reg_p3() #0 {
556 %0 = call i32 @llvm.read_register.i32(metadata !31)
557 call void @llvm.write_register.i32(metadata !54, i32 %0)
558 %1 = call i32 @llvm.read_register.i32(metadata !54)
562 ; CHECK-LABEL: reg_sa0:
565 define dso_local i32 @reg_sa0() #0 {
567 %0 = call i32 @llvm.read_register.i32(metadata !31)
568 call void @llvm.write_register.i32(metadata !55, i32 %0)
569 %1 = call i32 @llvm.read_register.i32(metadata !55)
573 ; CHECK-LABEL: reg_lc0:
576 define dso_local i32 @reg_lc0() #0 {
578 %0 = call i32 @llvm.read_register.i32(metadata !31)
579 call void @llvm.write_register.i32(metadata !56, i32 %0)
580 %1 = call i32 @llvm.read_register.i32(metadata !56)
584 ; CHECK-LABEL: reg_sa1:
587 define dso_local i32 @reg_sa1() #0 {
589 %0 = call i32 @llvm.read_register.i32(metadata !31)
590 call void @llvm.write_register.i32(metadata !57, i32 %0)
591 %1 = call i32 @llvm.read_register.i32(metadata !57)
595 ; CHECK-LABEL: reg_lc1:
598 define dso_local i32 @reg_lc1() #0 {
600 %0 = call i32 @llvm.read_register.i32(metadata !31)
601 call void @llvm.write_register.i32(metadata !58, i32 %0)
602 %1 = call i32 @llvm.read_register.i32(metadata !58)
606 ; CHECK-LABEL: reg_m0:
609 define dso_local i32 @reg_m0() #0 {
611 %0 = call i32 @llvm.read_register.i32(metadata !31)
612 call void @llvm.write_register.i32(metadata !59, i32 %0)
613 %1 = call i32 @llvm.read_register.i32(metadata !59)
617 ; CHECK-LABEL: reg_m1:
620 define dso_local i32 @reg_m1() #0 {
622 %0 = call i32 @llvm.read_register.i32(metadata !31)
623 call void @llvm.write_register.i32(metadata !60, i32 %0)
624 %1 = call i32 @llvm.read_register.i32(metadata !60)
628 ; CHECK-LABEL: reg_usr:
631 define dso_local i32 @reg_usr() #0 {
633 %0 = call i32 @llvm.read_register.i32(metadata !31)
634 call void @llvm.write_register.i32(metadata !61, i32 %0)
635 %1 = call i32 @llvm.read_register.i32(metadata !61)
639 ; CHECK-LABEL: reg_ugp:
642 define dso_local i32 @reg_ugp() #0 {
644 %0 = call i32 @llvm.read_register.i32(metadata !31)
645 call void @llvm.write_register.i32(metadata !62, i32 %0)
646 %1 = call i32 @llvm.read_register.i32(metadata !62)
650 attributes #0 = { noinline nounwind optnone "target-cpu"="hexagonv62" }
651 attributes #1 = { nounwind }
652 attributes #2 = { nounwind readonly }
654 !llvm.named.register.r0 = !{!0}
655 !llvm.named.register.r1 = !{!1}
656 !llvm.named.register.r2 = !{!2}
657 !llvm.named.register.r3 = !{!3}
658 !llvm.named.register.r4 = !{!4}
659 !llvm.named.register.r5 = !{!5}
660 !llvm.named.register.r6 = !{!6}
661 !llvm.named.register.r7 = !{!7}
662 !llvm.named.register.r8 = !{!8}
663 !llvm.named.register.r9 = !{!9}
664 !llvm.named.register.r10 = !{!10}
665 !llvm.named.register.r11 = !{!11}
666 !llvm.named.register.r12 = !{!12}
667 !llvm.named.register.r13 = !{!13}
668 !llvm.named.register.r14 = !{!14}
669 !llvm.named.register.r15 = !{!15}
670 !llvm.named.register.r16 = !{!16}
671 !llvm.named.register.r17 = !{!17}
672 !llvm.named.register.r18 = !{!18}
673 !llvm.named.register.r19 = !{!19}
674 !llvm.named.register.r20 = !{!20}
675 !llvm.named.register.r21 = !{!21}
676 !llvm.named.register.r22 = !{!22}
677 !llvm.named.register.r23 = !{!23}
678 !llvm.named.register.r24 = !{!24}
679 !llvm.named.register.r25 = !{!25}
680 !llvm.named.register.r26 = !{!26}
681 !llvm.named.register.r27 = !{!27}
682 !llvm.named.register.r28 = !{!28}
683 !llvm.named.register.r29 = !{!29}
684 !llvm.named.register.r30 = !{!30}
685 !llvm.named.register.r31 = !{!31}
686 !llvm.named.register.r1\3A0 = !{!32}
687 !llvm.named.register.r3\3A2 = !{!33}
688 !llvm.named.register.r5\3A4 = !{!34}
689 !llvm.named.register.r7\3A6 = !{!35}
690 !llvm.named.register.r9\3A8 = !{!36}
691 !llvm.named.register.r11\3A10 = !{!37}
692 !llvm.named.register.r13\3A12 = !{!38}
693 !llvm.named.register.r15\3A14 = !{!39}
694 !llvm.named.register.r17\3A16 = !{!40}
695 !llvm.named.register.r19\3A18 = !{!41}
696 !llvm.named.register.r21\3A20 = !{!42}
697 !llvm.named.register.r23\3A22 = !{!43}
698 !llvm.named.register.r25\3A24 = !{!44}
699 !llvm.named.register.r27\3A26 = !{!45}
700 !llvm.named.register.r29\3A28 = !{!46}
701 !llvm.named.register.r31\3A30 = !{!47}
702 !llvm.named.register.sp = !{!48}
703 !llvm.named.register.fp = !{!49}
704 !llvm.named.register.lr = !{!50}
705 !llvm.named.register.p0 = !{!51}
706 !llvm.named.register.p1 = !{!52}
707 !llvm.named.register.p2 = !{!53}
708 !llvm.named.register.p3 = !{!54}
709 !llvm.named.register.sa0 = !{!55}
710 !llvm.named.register.lc0 = !{!56}
711 !llvm.named.register.sa1 = !{!57}
712 !llvm.named.register.lc1 = !{!58}
713 !llvm.named.register.m0 = !{!59}
714 !llvm.named.register.m1 = !{!60}
715 !llvm.named.register.usr = !{!61}
716 !llvm.named.register.ugp = !{!62}