1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=avr < %s | FileCheck %s --check-prefix=CHECKA
3 ; RUN: llc -mtriple=avr -mattr=+movw < %s | FileCheck %s --check-prefix=CHECKB
5 %struct.s10 = type { i16, i16, i16, i16, i16 }
6 %struct.s06 = type { i16, i16, i16 }
7 %struct.s04 = type { i16, i16 }
9 define void @foo10(ptr sret(%struct.s10) %0, i16 %1, i16 %2, i16 %3) addrspace(1) {
10 ; CHECKA-LABEL: foo10:
12 ; CHECKA-NEXT: mov r30, r24
13 ; CHECKA-NEXT: mov r31, r25
14 ; CHECKA-NEXT: std Z+5, r23
15 ; CHECKA-NEXT: std Z+4, r22
16 ; CHECKA-NEXT: std Z+3, r21
17 ; CHECKA-NEXT: std Z+2, r20
18 ; CHECKA-NEXT: std Z+1, r19
19 ; CHECKA-NEXT: st Z, r18
22 ; CHECKB-LABEL: foo10:
24 ; CHECKB-NEXT: movw r30, r24
25 ; CHECKB-NEXT: std Z+5, r23
26 ; CHECKB-NEXT: std Z+4, r22
27 ; CHECKB-NEXT: std Z+3, r21
28 ; CHECKB-NEXT: std Z+2, r20
29 ; CHECKB-NEXT: std Z+1, r19
30 ; CHECKB-NEXT: st Z, r18
32 %5 = getelementptr inbounds %struct.s10, ptr %0, i16 0, i32 0
34 %6 = getelementptr inbounds %struct.s10, ptr %0, i16 0, i32 1
36 %7 = getelementptr inbounds %struct.s10, ptr %0, i16 0, i32 2
41 define %struct.s06 @foo06(i16 %0, i16 %1, i16 %2) addrspace(1) {
42 ; CHECKA-LABEL: foo06:
44 ; CHECKA-NEXT: mov r30, r20
45 ; CHECKA-NEXT: mov r31, r21
46 ; CHECKA-NEXT: mov r20, r22
47 ; CHECKA-NEXT: mov r21, r23
48 ; CHECKA-NEXT: mov r18, r24
49 ; CHECKA-NEXT: mov r19, r25
50 ; CHECKA-NEXT: mov r22, r30
51 ; CHECKA-NEXT: mov r23, r31
54 ; CHECKB-LABEL: foo06:
56 ; CHECKB-NEXT: movw r30, r20
57 ; CHECKB-NEXT: movw r20, r22
58 ; CHECKB-NEXT: movw r18, r24
59 ; CHECKB-NEXT: movw r22, r30
61 %4 = insertvalue %struct.s06 undef, i16 %0, 0
62 %5 = insertvalue %struct.s06 %4, i16 %1, 1
63 %6 = insertvalue %struct.s06 %5, i16 %2, 2
67 define %struct.s04 @foo04(i16 %0, i16 %1) addrspace(1) {
68 ; CHECKA-LABEL: foo04:
70 ; CHECKA-NEXT: mov r18, r22
71 ; CHECKA-NEXT: mov r19, r23
72 ; CHECKA-NEXT: mov r22, r24
73 ; CHECKA-NEXT: mov r23, r25
74 ; CHECKA-NEXT: mov r24, r18
75 ; CHECKA-NEXT: mov r25, r19
78 ; CHECKB-LABEL: foo04:
80 ; CHECKB-NEXT: movw r18, r22
81 ; CHECKB-NEXT: movw r22, r24
82 ; CHECKB-NEXT: movw r24, r18
84 %3 = insertvalue %struct.s04 undef, i16 %0, 0
85 %4 = insertvalue %struct.s04 %3, i16 %1, 1