1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4
2 # RUN: llc -mtriple=riscv32 -mattr=+zcmp -x mir -start-before=prologepilog -stop-after=riscv-push-pop-opt -verify-machineinstrs -o - %s \
3 # RUN: | FileCheck -check-prefixes=CHECK-ZCMP32 %s
4 # RUN: llc -mtriple=riscv32 -mattr=+save-restore -x mir -start-before=prologepilog -stop-after=riscv-push-pop-opt -verify-machineinstrs -o - %s \
5 # RUN: | FileCheck -check-prefixes=CHECK-LIBCALL32 %s
6 # RUN: llc -mtriple=riscv64 -mattr=+zcmp -x mir -start-before=prologepilog -stop-after=riscv-push-pop-opt -verify-machineinstrs -o - %s \
7 # RUN: | FileCheck -check-prefixes=CHECK-ZCMP64 %s
8 # RUN: llc -mtriple=riscv64 -mattr=+save-restore -x mir -start-before=prologepilog -stop-after=riscv-push-pop-opt -verify-machineinstrs -o - %s \
9 # RUN: | FileCheck -check-prefixes=CHECK-LIBCALL64 %s
10 # RUN: llc -mtriple=riscv32 -x mir -start-before=prologepilog -stop-after=riscv-push-pop-opt -verify-machineinstrs -o - %s \
11 # RUN: | FileCheck -check-prefixes=CHECK-NO-ZCMP32 %s
12 # RUN: llc -mtriple=riscv64 -x mir -start-before=prologepilog -stop-after=riscv-push-pop-opt -verify-machineinstrs -o - %s \
13 # RUN: | FileCheck -check-prefixes=CHECK-NO-ZCMP64 %s
16 tracksRegLiveness: true
19 ; CHECK-ZCMP32-LABEL: name: popret_rvlist5
20 ; CHECK-ZCMP32: liveins: $x1, $x8
21 ; CHECK-ZCMP32-NEXT: {{ $}}
22 ; CHECK-ZCMP32-NEXT: frame-setup CM_PUSH 5, 0, implicit-def $x2, implicit $x2, implicit $x1, implicit $x8
23 ; CHECK-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
24 ; CHECK-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -8
25 ; CHECK-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -4
26 ; CHECK-ZCMP32-NEXT: $x1 = IMPLICIT_DEF
27 ; CHECK-ZCMP32-NEXT: $x8 = IMPLICIT_DEF
28 ; CHECK-ZCMP32-NEXT: CM_POPRET 5, 0, implicit-def $x2, implicit $x2, implicit-def $x1, implicit-def $x8
30 ; CHECK-LIBCALL32-LABEL: name: popret_rvlist5
31 ; CHECK-LIBCALL32: liveins: $x1, $x8
32 ; CHECK-LIBCALL32-NEXT: {{ $}}
33 ; CHECK-LIBCALL32-NEXT: $x5 = frame-setup PseudoCALLReg target-flags(riscv-call) &__riscv_save_1
34 ; CHECK-LIBCALL32-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
35 ; CHECK-LIBCALL32-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -4
36 ; CHECK-LIBCALL32-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -8
37 ; CHECK-LIBCALL32-NEXT: $x1 = IMPLICIT_DEF
38 ; CHECK-LIBCALL32-NEXT: $x8 = IMPLICIT_DEF
39 ; CHECK-LIBCALL32-NEXT: frame-destroy PseudoTAIL target-flags(riscv-call) &__riscv_restore_1, implicit $x2
41 ; CHECK-ZCMP64-LABEL: name: popret_rvlist5
42 ; CHECK-ZCMP64: liveins: $x1, $x8
43 ; CHECK-ZCMP64-NEXT: {{ $}}
44 ; CHECK-ZCMP64-NEXT: frame-setup CM_PUSH 5, 0, implicit-def $x2, implicit $x2, implicit $x1, implicit $x8
45 ; CHECK-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
46 ; CHECK-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -16
47 ; CHECK-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -8
48 ; CHECK-ZCMP64-NEXT: $x1 = IMPLICIT_DEF
49 ; CHECK-ZCMP64-NEXT: $x8 = IMPLICIT_DEF
50 ; CHECK-ZCMP64-NEXT: CM_POPRET 5, 0, implicit-def $x2, implicit $x2, implicit-def $x1, implicit-def $x8
52 ; CHECK-LIBCALL64-LABEL: name: popret_rvlist5
53 ; CHECK-LIBCALL64: liveins: $x1, $x8
54 ; CHECK-LIBCALL64-NEXT: {{ $}}
55 ; CHECK-LIBCALL64-NEXT: $x5 = frame-setup PseudoCALLReg target-flags(riscv-call) &__riscv_save_1
56 ; CHECK-LIBCALL64-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
57 ; CHECK-LIBCALL64-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -8
58 ; CHECK-LIBCALL64-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -16
59 ; CHECK-LIBCALL64-NEXT: $x1 = IMPLICIT_DEF
60 ; CHECK-LIBCALL64-NEXT: $x8 = IMPLICIT_DEF
61 ; CHECK-LIBCALL64-NEXT: frame-destroy PseudoTAIL target-flags(riscv-call) &__riscv_restore_1, implicit $x2
63 ; CHECK-NO-ZCMP32-LABEL: name: popret_rvlist5
64 ; CHECK-NO-ZCMP32: liveins: $x1, $x8
65 ; CHECK-NO-ZCMP32-NEXT: {{ $}}
66 ; CHECK-NO-ZCMP32-NEXT: $x2 = frame-setup ADDI $x2, -16
67 ; CHECK-NO-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
68 ; CHECK-NO-ZCMP32-NEXT: SW killed $x1, $x2, 12 :: (store (s32) into %stack.0)
69 ; CHECK-NO-ZCMP32-NEXT: SW killed $x8, $x2, 8 :: (store (s32) into %stack.1)
70 ; CHECK-NO-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -4
71 ; CHECK-NO-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -8
72 ; CHECK-NO-ZCMP32-NEXT: $x1 = IMPLICIT_DEF
73 ; CHECK-NO-ZCMP32-NEXT: $x8 = IMPLICIT_DEF
74 ; CHECK-NO-ZCMP32-NEXT: $x1 = LW $x2, 12 :: (load (s32) from %stack.0)
75 ; CHECK-NO-ZCMP32-NEXT: $x8 = LW $x2, 8 :: (load (s32) from %stack.1)
76 ; CHECK-NO-ZCMP32-NEXT: frame-destroy CFI_INSTRUCTION restore $x1
77 ; CHECK-NO-ZCMP32-NEXT: frame-destroy CFI_INSTRUCTION restore $x8
78 ; CHECK-NO-ZCMP32-NEXT: $x2 = frame-destroy ADDI $x2, 16
79 ; CHECK-NO-ZCMP32-NEXT: frame-destroy CFI_INSTRUCTION def_cfa_offset 0
80 ; CHECK-NO-ZCMP32-NEXT: PseudoRET
82 ; CHECK-NO-ZCMP64-LABEL: name: popret_rvlist5
83 ; CHECK-NO-ZCMP64: liveins: $x1, $x8
84 ; CHECK-NO-ZCMP64-NEXT: {{ $}}
85 ; CHECK-NO-ZCMP64-NEXT: $x2 = frame-setup ADDI $x2, -16
86 ; CHECK-NO-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
87 ; CHECK-NO-ZCMP64-NEXT: SD killed $x1, $x2, 8 :: (store (s64) into %stack.0)
88 ; CHECK-NO-ZCMP64-NEXT: SD killed $x8, $x2, 0 :: (store (s64) into %stack.1)
89 ; CHECK-NO-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -8
90 ; CHECK-NO-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -16
91 ; CHECK-NO-ZCMP64-NEXT: $x1 = IMPLICIT_DEF
92 ; CHECK-NO-ZCMP64-NEXT: $x8 = IMPLICIT_DEF
93 ; CHECK-NO-ZCMP64-NEXT: $x1 = LD $x2, 8 :: (load (s64) from %stack.0)
94 ; CHECK-NO-ZCMP64-NEXT: $x8 = LD $x2, 0 :: (load (s64) from %stack.1)
95 ; CHECK-NO-ZCMP64-NEXT: frame-destroy CFI_INSTRUCTION restore $x1
96 ; CHECK-NO-ZCMP64-NEXT: frame-destroy CFI_INSTRUCTION restore $x8
97 ; CHECK-NO-ZCMP64-NEXT: $x2 = frame-destroy ADDI $x2, 16
98 ; CHECK-NO-ZCMP64-NEXT: frame-destroy CFI_INSTRUCTION def_cfa_offset 0
99 ; CHECK-NO-ZCMP64-NEXT: PseudoRET
105 name: popretz_rvlist5
106 tracksRegLiveness: true
109 ; CHECK-ZCMP32-LABEL: name: popretz_rvlist5
110 ; CHECK-ZCMP32: liveins: $x1, $x8
111 ; CHECK-ZCMP32-NEXT: {{ $}}
112 ; CHECK-ZCMP32-NEXT: frame-setup CM_PUSH 5, 0, implicit-def $x2, implicit $x2, implicit $x1, implicit $x8
113 ; CHECK-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
114 ; CHECK-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -8
115 ; CHECK-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -4
116 ; CHECK-ZCMP32-NEXT: $x1 = IMPLICIT_DEF
117 ; CHECK-ZCMP32-NEXT: $x8 = IMPLICIT_DEF
118 ; CHECK-ZCMP32-NEXT: CM_POPRETZ 5, 0, implicit-def $x2, implicit-def $x10, implicit $x2, implicit-def $x1, implicit-def $x8
120 ; CHECK-LIBCALL32-LABEL: name: popretz_rvlist5
121 ; CHECK-LIBCALL32: liveins: $x1, $x8
122 ; CHECK-LIBCALL32-NEXT: {{ $}}
123 ; CHECK-LIBCALL32-NEXT: $x5 = frame-setup PseudoCALLReg target-flags(riscv-call) &__riscv_save_1
124 ; CHECK-LIBCALL32-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
125 ; CHECK-LIBCALL32-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -4
126 ; CHECK-LIBCALL32-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -8
127 ; CHECK-LIBCALL32-NEXT: $x1 = IMPLICIT_DEF
128 ; CHECK-LIBCALL32-NEXT: $x8 = IMPLICIT_DEF
129 ; CHECK-LIBCALL32-NEXT: $x10 = ADDI $x0, 0
130 ; CHECK-LIBCALL32-NEXT: frame-destroy PseudoTAIL target-flags(riscv-call) &__riscv_restore_1, implicit $x2, implicit $x10
132 ; CHECK-ZCMP64-LABEL: name: popretz_rvlist5
133 ; CHECK-ZCMP64: liveins: $x1, $x8
134 ; CHECK-ZCMP64-NEXT: {{ $}}
135 ; CHECK-ZCMP64-NEXT: frame-setup CM_PUSH 5, 0, implicit-def $x2, implicit $x2, implicit $x1, implicit $x8
136 ; CHECK-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
137 ; CHECK-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -16
138 ; CHECK-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -8
139 ; CHECK-ZCMP64-NEXT: $x1 = IMPLICIT_DEF
140 ; CHECK-ZCMP64-NEXT: $x8 = IMPLICIT_DEF
141 ; CHECK-ZCMP64-NEXT: CM_POPRETZ 5, 0, implicit-def $x2, implicit-def $x10, implicit $x2, implicit-def $x1, implicit-def $x8
143 ; CHECK-LIBCALL64-LABEL: name: popretz_rvlist5
144 ; CHECK-LIBCALL64: liveins: $x1, $x8
145 ; CHECK-LIBCALL64-NEXT: {{ $}}
146 ; CHECK-LIBCALL64-NEXT: $x5 = frame-setup PseudoCALLReg target-flags(riscv-call) &__riscv_save_1
147 ; CHECK-LIBCALL64-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
148 ; CHECK-LIBCALL64-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -8
149 ; CHECK-LIBCALL64-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -16
150 ; CHECK-LIBCALL64-NEXT: $x1 = IMPLICIT_DEF
151 ; CHECK-LIBCALL64-NEXT: $x8 = IMPLICIT_DEF
152 ; CHECK-LIBCALL64-NEXT: $x10 = ADDI $x0, 0
153 ; CHECK-LIBCALL64-NEXT: frame-destroy PseudoTAIL target-flags(riscv-call) &__riscv_restore_1, implicit $x2, implicit $x10
155 ; CHECK-NO-ZCMP32-LABEL: name: popretz_rvlist5
156 ; CHECK-NO-ZCMP32: liveins: $x1, $x8
157 ; CHECK-NO-ZCMP32-NEXT: {{ $}}
158 ; CHECK-NO-ZCMP32-NEXT: $x2 = frame-setup ADDI $x2, -16
159 ; CHECK-NO-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
160 ; CHECK-NO-ZCMP32-NEXT: SW killed $x1, $x2, 12 :: (store (s32) into %stack.0)
161 ; CHECK-NO-ZCMP32-NEXT: SW killed $x8, $x2, 8 :: (store (s32) into %stack.1)
162 ; CHECK-NO-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -4
163 ; CHECK-NO-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -8
164 ; CHECK-NO-ZCMP32-NEXT: $x1 = IMPLICIT_DEF
165 ; CHECK-NO-ZCMP32-NEXT: $x8 = IMPLICIT_DEF
166 ; CHECK-NO-ZCMP32-NEXT: $x10 = ADDI $x0, 0
167 ; CHECK-NO-ZCMP32-NEXT: $x1 = LW $x2, 12 :: (load (s32) from %stack.0)
168 ; CHECK-NO-ZCMP32-NEXT: $x8 = LW $x2, 8 :: (load (s32) from %stack.1)
169 ; CHECK-NO-ZCMP32-NEXT: frame-destroy CFI_INSTRUCTION restore $x1
170 ; CHECK-NO-ZCMP32-NEXT: frame-destroy CFI_INSTRUCTION restore $x8
171 ; CHECK-NO-ZCMP32-NEXT: $x2 = frame-destroy ADDI $x2, 16
172 ; CHECK-NO-ZCMP32-NEXT: frame-destroy CFI_INSTRUCTION def_cfa_offset 0
173 ; CHECK-NO-ZCMP32-NEXT: PseudoRET implicit $x10
175 ; CHECK-NO-ZCMP64-LABEL: name: popretz_rvlist5
176 ; CHECK-NO-ZCMP64: liveins: $x1, $x8
177 ; CHECK-NO-ZCMP64-NEXT: {{ $}}
178 ; CHECK-NO-ZCMP64-NEXT: $x2 = frame-setup ADDI $x2, -16
179 ; CHECK-NO-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
180 ; CHECK-NO-ZCMP64-NEXT: SD killed $x1, $x2, 8 :: (store (s64) into %stack.0)
181 ; CHECK-NO-ZCMP64-NEXT: SD killed $x8, $x2, 0 :: (store (s64) into %stack.1)
182 ; CHECK-NO-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -8
183 ; CHECK-NO-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -16
184 ; CHECK-NO-ZCMP64-NEXT: $x1 = IMPLICIT_DEF
185 ; CHECK-NO-ZCMP64-NEXT: $x8 = IMPLICIT_DEF
186 ; CHECK-NO-ZCMP64-NEXT: $x10 = ADDI $x0, 0
187 ; CHECK-NO-ZCMP64-NEXT: $x1 = LD $x2, 8 :: (load (s64) from %stack.0)
188 ; CHECK-NO-ZCMP64-NEXT: $x8 = LD $x2, 0 :: (load (s64) from %stack.1)
189 ; CHECK-NO-ZCMP64-NEXT: frame-destroy CFI_INSTRUCTION restore $x1
190 ; CHECK-NO-ZCMP64-NEXT: frame-destroy CFI_INSTRUCTION restore $x8
191 ; CHECK-NO-ZCMP64-NEXT: $x2 = frame-destroy ADDI $x2, 16
192 ; CHECK-NO-ZCMP64-NEXT: frame-destroy CFI_INSTRUCTION def_cfa_offset 0
193 ; CHECK-NO-ZCMP64-NEXT: PseudoRET implicit $x10
197 PseudoRET implicit $x10