1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv32 -mattr=+v -run-pass=legalizer %s -o - | FileCheck %s
3 # RUN: llc -mtriple=riscv64 -mattr=+v -run-pass=legalizer %s -o - | FileCheck %s
8 tracksRegLiveness: true
11 ; CHECK-LABEL: name: bitcast_nxv1i8
12 ; CHECK: [[DEF:%[0-9]+]]:_(<vscale x 1 x s8>) = G_IMPLICIT_DEF
13 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(<vscale x 8 x s1>) = G_BITCAST [[DEF]](<vscale x 1 x s8>)
14 ; CHECK-NEXT: $v8 = COPY [[BITCAST]](<vscale x 8 x s1>)
15 ; CHECK-NEXT: PseudoRET implicit $v8
16 %0:_(<vscale x 1 x s8>) = G_IMPLICIT_DEF
17 %1:_(<vscale x 8 x s1>) = G_BITCAST %0(<vscale x 1 x s8>)
18 $v8 = COPY %1(<vscale x 8 x s1>)
19 PseudoRET implicit $v8
24 tracksRegLiveness: true
27 ; CHECK-LABEL: name: bitcast_nxv2i8
28 ; CHECK: [[DEF:%[0-9]+]]:_(<vscale x 2 x s8>) = G_IMPLICIT_DEF
29 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(<vscale x 1 x s16>) = G_BITCAST [[DEF]](<vscale x 2 x s8>)
30 ; CHECK-NEXT: $v8 = COPY [[BITCAST]](<vscale x 1 x s16>)
31 ; CHECK-NEXT: PseudoRET implicit $v8
32 %0:_(<vscale x 2 x s8>) = G_IMPLICIT_DEF
33 %1:_(<vscale x 1 x s16>) = G_BITCAST %0(<vscale x 2 x s8>)
34 $v8 = COPY %1(<vscale x 1 x s16>)
35 PseudoRET implicit $v8
40 tracksRegLiveness: true
43 ; CHECK-LABEL: name: bitcast_nxv4i8
44 ; CHECK: [[DEF:%[0-9]+]]:_(<vscale x 4 x s8>) = G_IMPLICIT_DEF
45 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(<vscale x 2 x s16>) = G_BITCAST [[DEF]](<vscale x 4 x s8>)
46 ; CHECK-NEXT: $v8 = COPY [[BITCAST]](<vscale x 2 x s16>)
47 ; CHECK-NEXT: PseudoRET implicit $v8
48 %0:_(<vscale x 4 x s8>) = G_IMPLICIT_DEF
49 %1:_(<vscale x 2 x s16>) = G_BITCAST %0(<vscale x 4 x s8>)
50 $v8 = COPY %1(<vscale x 2 x s16>)
51 PseudoRET implicit $v8
56 tracksRegLiveness: true
59 ; CHECK-LABEL: name: bitcast_nxv8i8
60 ; CHECK: [[DEF:%[0-9]+]]:_(<vscale x 8 x s8>) = G_IMPLICIT_DEF
61 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(<vscale x 64 x s1>) = G_BITCAST [[DEF]](<vscale x 8 x s8>)
62 ; CHECK-NEXT: $v8 = COPY [[BITCAST]](<vscale x 64 x s1>)
63 ; CHECK-NEXT: PseudoRET implicit $v8
64 %0:_(<vscale x 8 x s8>) = G_IMPLICIT_DEF
65 %1:_(<vscale x 64 x s1>) = G_BITCAST %0(<vscale x 8 x s8>)
66 $v8 = COPY %1(<vscale x 64 x s1>)
67 PseudoRET implicit $v8
72 tracksRegLiveness: true
75 ; CHECK-LABEL: name: bitcast_nxv16i8
76 ; CHECK: [[DEF:%[0-9]+]]:_(<vscale x 16 x s8>) = G_IMPLICIT_DEF
77 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(<vscale x 4 x s32>) = G_BITCAST [[DEF]](<vscale x 16 x s8>)
78 ; CHECK-NEXT: $v8m2 = COPY [[BITCAST]](<vscale x 4 x s32>)
79 ; CHECK-NEXT: PseudoRET implicit $v8m2
80 %0:_(<vscale x 16 x s8>) = G_IMPLICIT_DEF
81 %1:_(<vscale x 4 x s32>) = G_BITCAST %0(<vscale x 16 x s8>)
82 $v8m2 = COPY %1(<vscale x 4 x s32>)
83 PseudoRET implicit $v8m2
88 tracksRegLiveness: true
91 ; CHECK-LABEL: name: bitcast_nxv32i8
92 ; CHECK: [[DEF:%[0-9]+]]:_(<vscale x 32 x s8>) = G_IMPLICIT_DEF
93 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(<vscale x 16 x s16>) = G_BITCAST [[DEF]](<vscale x 32 x s8>)
94 ; CHECK-NEXT: $v8m4 = COPY [[BITCAST]](<vscale x 16 x s16>)
95 ; CHECK-NEXT: PseudoRET implicit $v8m4
96 %0:_(<vscale x 32 x s8>) = G_IMPLICIT_DEF
97 %1:_(<vscale x 16 x s16>) = G_BITCAST %0(<vscale x 32 x s8>)
98 $v8m4 = COPY %1(<vscale x 16 x s16>)
99 PseudoRET implicit $v8m4
102 name: bitcast_nxv64i8
104 tracksRegLiveness: true
107 ; CHECK-LABEL: name: bitcast_nxv64i8
108 ; CHECK: [[DEF:%[0-9]+]]:_(<vscale x 64 x s8>) = G_IMPLICIT_DEF
109 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(<vscale x 8 x s64>) = G_BITCAST [[DEF]](<vscale x 64 x s8>)
110 ; CHECK-NEXT: $v8m8 = COPY [[BITCAST]](<vscale x 8 x s64>)
111 ; CHECK-NEXT: PseudoRET implicit $v8m8
112 %0:_(<vscale x 64 x s8>) = G_IMPLICIT_DEF
113 %1:_(<vscale x 8 x s64>) = G_BITCAST %0(<vscale x 64 x s8>)
114 $v8m8 = COPY %1(<vscale x 8 x s64>)
115 PseudoRET implicit $v8m8
118 name: bitcast_nxv1i16
120 tracksRegLiveness: true
123 ; CHECK-LABEL: name: bitcast_nxv1i16
124 ; CHECK: [[DEF:%[0-9]+]]:_(<vscale x 1 x s16>) = G_IMPLICIT_DEF
125 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(<vscale x 2 x s8>) = G_BITCAST [[DEF]](<vscale x 1 x s16>)
126 ; CHECK-NEXT: $v8 = COPY [[BITCAST]](<vscale x 2 x s8>)
127 ; CHECK-NEXT: PseudoRET implicit $v8
128 %0:_(<vscale x 1 x s16>) = G_IMPLICIT_DEF
129 %1:_(<vscale x 2 x s8>) = G_BITCAST %0(<vscale x 1 x s16>)
130 $v8 = COPY %1(<vscale x 2 x s8>)
131 PseudoRET implicit $v8
134 name: bitcast_nxv2i16
136 tracksRegLiveness: true
139 ; CHECK-LABEL: name: bitcast_nxv2i16
140 ; CHECK: [[DEF:%[0-9]+]]:_(<vscale x 2 x s16>) = G_IMPLICIT_DEF
141 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(<vscale x 1 x s32>) = G_BITCAST [[DEF]](<vscale x 2 x s16>)
142 ; CHECK-NEXT: $v8 = COPY [[BITCAST]](<vscale x 1 x s32>)
143 ; CHECK-NEXT: PseudoRET implicit $v8
144 %0:_(<vscale x 2 x s16>) = G_IMPLICIT_DEF
145 %1:_(<vscale x 1 x s32>) = G_BITCAST %0(<vscale x 2 x s16>)
146 $v8 = COPY %1(<vscale x 1 x s32>)
147 PseudoRET implicit $v8
150 name: bitcast_nxv4i16
152 tracksRegLiveness: true
155 ; CHECK-LABEL: name: bitcast_nxv4i16
156 ; CHECK: [[DEF:%[0-9]+]]:_(<vscale x 4 x s16>) = G_IMPLICIT_DEF
157 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(<vscale x 1 x s64>) = G_BITCAST [[DEF]](<vscale x 4 x s16>)
158 ; CHECK-NEXT: $v8 = COPY [[BITCAST]](<vscale x 1 x s64>)
159 ; CHECK-NEXT: PseudoRET implicit $v8
160 %0:_(<vscale x 4 x s16>) = G_IMPLICIT_DEF
161 %1:_(<vscale x 1 x s64>) = G_BITCAST %0(<vscale x 4 x s16>)
162 $v8 = COPY %1(<vscale x 1 x s64>)
163 PseudoRET implicit $v8
166 name: bitcast_nxv8i16
168 tracksRegLiveness: true
171 ; CHECK-LABEL: name: bitcast_nxv8i16
172 ; CHECK: [[DEF:%[0-9]+]]:_(<vscale x 8 x s16>) = G_IMPLICIT_DEF
173 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(<vscale x 2 x s64>) = G_BITCAST [[DEF]](<vscale x 8 x s16>)
174 ; CHECK-NEXT: $v8m2 = COPY [[BITCAST]](<vscale x 2 x s64>)
175 ; CHECK-NEXT: PseudoRET implicit $v8m2
176 %0:_(<vscale x 8 x s16>) = G_IMPLICIT_DEF
177 %1:_(<vscale x 2 x s64>) = G_BITCAST %0(<vscale x 8 x s16>)
178 $v8m2 = COPY %1(<vscale x 2 x s64>)
179 PseudoRET implicit $v8m2
182 name: bitcast_nxv16i16
184 tracksRegLiveness: true
187 ; CHECK-LABEL: name: bitcast_nxv16i16
188 ; CHECK: [[DEF:%[0-9]+]]:_(<vscale x 16 x s16>) = G_IMPLICIT_DEF
189 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(<vscale x 8 x s32>) = G_BITCAST [[DEF]](<vscale x 16 x s16>)
190 ; CHECK-NEXT: $v8m4 = COPY [[BITCAST]](<vscale x 8 x s32>)
191 ; CHECK-NEXT: PseudoRET implicit $v8m4
192 %0:_(<vscale x 16 x s16>) = G_IMPLICIT_DEF
193 %1:_(<vscale x 8 x s32>) = G_BITCAST %0(<vscale x 16 x s16>)
194 $v8m4 = COPY %1(<vscale x 8 x s32>)
195 PseudoRET implicit $v8m4
198 name: bitcast_nxv32i16
200 tracksRegLiveness: true
203 ; CHECK-LABEL: name: bitcast_nxv32i16
204 ; CHECK: [[DEF:%[0-9]+]]:_(<vscale x 32 x s16>) = G_IMPLICIT_DEF
205 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(<vscale x 8 x s64>) = G_BITCAST [[DEF]](<vscale x 32 x s16>)
206 ; CHECK-NEXT: $v8m8 = COPY [[BITCAST]](<vscale x 8 x s64>)
207 ; CHECK-NEXT: PseudoRET implicit $v8m8
208 %0:_(<vscale x 32 x s16>) = G_IMPLICIT_DEF
209 %1:_(<vscale x 8 x s64>) = G_BITCAST %0(<vscale x 32 x s16>)
210 $v8m8 = COPY %1(<vscale x 8 x s64>)
211 PseudoRET implicit $v8m8
214 name: bitcast_nxv1i32
216 tracksRegLiveness: true
219 ; CHECK-LABEL: name: bitcast_nxv1i32
220 ; CHECK: [[DEF:%[0-9]+]]:_(<vscale x 1 x s32>) = G_IMPLICIT_DEF
221 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(<vscale x 2 x s16>) = G_BITCAST [[DEF]](<vscale x 1 x s32>)
222 ; CHECK-NEXT: $v8 = COPY [[BITCAST]](<vscale x 2 x s16>)
223 ; CHECK-NEXT: PseudoRET implicit $v8
224 %0:_(<vscale x 1 x s32>) = G_IMPLICIT_DEF
225 %1:_(<vscale x 2 x s16>) = G_BITCAST %0(<vscale x 1 x s32>)
226 $v8 = COPY %1(<vscale x 2 x s16>)
227 PseudoRET implicit $v8
230 name: bitcast_nxv2i32
232 tracksRegLiveness: true
235 ; CHECK-LABEL: name: bitcast_nxv2i32
236 ; CHECK: [[DEF:%[0-9]+]]:_(<vscale x 2 x s32>) = G_IMPLICIT_DEF
237 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(<vscale x 4 x s16>) = G_BITCAST [[DEF]](<vscale x 2 x s32>)
238 ; CHECK-NEXT: $v8 = COPY [[BITCAST]](<vscale x 4 x s16>)
239 ; CHECK-NEXT: PseudoRET implicit $v8
240 %0:_(<vscale x 2 x s32>) = G_IMPLICIT_DEF
241 %1:_(<vscale x 4 x s16>) = G_BITCAST %0(<vscale x 2 x s32>)
242 $v8 = COPY %1(<vscale x 4 x s16>)
243 PseudoRET implicit $v8
246 name: bitcast_nxv4i32
248 tracksRegLiveness: true
251 ; CHECK-LABEL: name: bitcast_nxv4i32
252 ; CHECK: [[DEF:%[0-9]+]]:_(<vscale x 4 x s32>) = G_IMPLICIT_DEF
253 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(<vscale x 8 x s16>) = G_BITCAST [[DEF]](<vscale x 4 x s32>)
254 ; CHECK-NEXT: $v8m2 = COPY [[BITCAST]](<vscale x 8 x s16>)
255 ; CHECK-NEXT: PseudoRET implicit $v8m2
256 %0:_(<vscale x 4 x s32>) = G_IMPLICIT_DEF
257 %1:_(<vscale x 8 x s16>) = G_BITCAST %0(<vscale x 4 x s32>)
258 $v8m2 = COPY %1(<vscale x 8 x s16>)
259 PseudoRET implicit $v8m2
262 name: bitcast_nxv8i32
264 tracksRegLiveness: true
267 ; CHECK-LABEL: name: bitcast_nxv8i32
268 ; CHECK: [[DEF:%[0-9]+]]:_(<vscale x 8 x s32>) = G_IMPLICIT_DEF
269 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(<vscale x 4 x s64>) = G_BITCAST [[DEF]](<vscale x 8 x s32>)
270 ; CHECK-NEXT: $v8m4 = COPY [[BITCAST]](<vscale x 4 x s64>)
271 ; CHECK-NEXT: PseudoRET implicit $v8m4
272 %0:_(<vscale x 8 x s32>) = G_IMPLICIT_DEF
273 %1:_(<vscale x 4 x s64>) = G_BITCAST %0(<vscale x 8 x s32>)
274 $v8m4 = COPY %1(<vscale x 4 x s64>)
275 PseudoRET implicit $v8m4
278 name: bitcast_nxv16i32
280 tracksRegLiveness: true
283 ; CHECK-LABEL: name: bitcast_nxv16i32
284 ; CHECK: [[DEF:%[0-9]+]]:_(<vscale x 16 x s32>) = G_IMPLICIT_DEF
285 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(<vscale x 32 x s16>) = G_BITCAST [[DEF]](<vscale x 16 x s32>)
286 ; CHECK-NEXT: $v8m8 = COPY [[BITCAST]](<vscale x 32 x s16>)
287 ; CHECK-NEXT: PseudoRET implicit $v8m8
288 %0:_(<vscale x 16 x s32>) = G_IMPLICIT_DEF
289 %1:_(<vscale x 32 x s16>) = G_BITCAST %0(<vscale x 16 x s32>)
290 $v8m8 = COPY %1(<vscale x 32 x s16>)
291 PseudoRET implicit $v8m8
294 name: bitcast_nxv1i64
296 tracksRegLiveness: true
299 ; CHECK-LABEL: name: bitcast_nxv1i64
300 ; CHECK: [[DEF:%[0-9]+]]:_(<vscale x 1 x s64>) = G_IMPLICIT_DEF
301 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(<vscale x 2 x s32>) = G_BITCAST [[DEF]](<vscale x 1 x s64>)
302 ; CHECK-NEXT: $v8 = COPY [[BITCAST]](<vscale x 2 x s32>)
303 ; CHECK-NEXT: PseudoRET implicit $v8
304 %0:_(<vscale x 1 x s64>) = G_IMPLICIT_DEF
305 %1:_(<vscale x 2 x s32>) = G_BITCAST %0(<vscale x 1 x s64>)
306 $v8 = COPY %1(<vscale x 2 x s32>)
307 PseudoRET implicit $v8
310 name: bitcast_nxv2i64
312 tracksRegLiveness: true
315 ; CHECK-LABEL: name: bitcast_nxv2i64
316 ; CHECK: [[DEF:%[0-9]+]]:_(<vscale x 2 x s64>) = G_IMPLICIT_DEF
317 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(<vscale x 4 x s32>) = G_BITCAST [[DEF]](<vscale x 2 x s64>)
318 ; CHECK-NEXT: $v8m2 = COPY [[BITCAST]](<vscale x 4 x s32>)
319 ; CHECK-NEXT: PseudoRET implicit $v8m2
320 %0:_(<vscale x 2 x s64>) = G_IMPLICIT_DEF
321 %1:_(<vscale x 4 x s32>) = G_BITCAST %0(<vscale x 2 x s64>)
322 $v8m2 = COPY %1(<vscale x 4 x s32>)
323 PseudoRET implicit $v8m2
326 name: bitcast_nxv4i64
328 tracksRegLiveness: true
331 ; CHECK-LABEL: name: bitcast_nxv4i64
332 ; CHECK: [[DEF:%[0-9]+]]:_(<vscale x 4 x s64>) = G_IMPLICIT_DEF
333 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(<vscale x 16 x s16>) = G_BITCAST [[DEF]](<vscale x 4 x s64>)
334 ; CHECK-NEXT: $v8m4 = COPY [[BITCAST]](<vscale x 16 x s16>)
335 ; CHECK-NEXT: PseudoRET implicit $v8m4
336 %0:_(<vscale x 4 x s64>) = G_IMPLICIT_DEF
337 %1:_(<vscale x 16 x s16>) = G_BITCAST %0(<vscale x 4 x s64>)
338 $v8m4 = COPY %1(<vscale x 16 x s16>)
339 PseudoRET implicit $v8m4
342 name: bitcast_nxv8i64
344 tracksRegLiveness: true
347 ; CHECK-LABEL: name: bitcast_nxv8i64
348 ; CHECK: [[DEF:%[0-9]+]]:_(<vscale x 8 x s64>) = G_IMPLICIT_DEF
349 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(<vscale x 64 x s8>) = G_BITCAST [[DEF]](<vscale x 8 x s64>)
350 ; CHECK-NEXT: $v8m8 = COPY [[BITCAST]](<vscale x 64 x s8>)
351 ; CHECK-NEXT: PseudoRET implicit $v8m8
352 %0:_(<vscale x 8 x s64>) = G_IMPLICIT_DEF
353 %1:_(<vscale x 64 x s8>) = G_BITCAST %0(<vscale x 8 x s64>)
354 $v8m8 = COPY %1(<vscale x 64 x s8>)
355 PseudoRET implicit $v8m8