1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -verify-machineinstrs -mtriple riscv64 -run-pass=postrapseudos %s -o - | FileCheck %s
6 name: copy_different_lmul
7 tracksRegLiveness: true
12 ; CHECK-LABEL: name: copy_different_lmul
13 ; CHECK: liveins: $x14, $x16
15 ; CHECK-NEXT: $x15 = PseudoVSETVLI $x14, 82 /* e32, m4, ta, mu */, implicit-def $vl, implicit-def $vtype
16 ; CHECK-NEXT: $v28m4 = PseudoVLE32_V_M4 undef $v28m4, killed $x16, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
17 ; CHECK-NEXT: $v12m2 = VMV2R_V $v28m2
18 $x15 = PseudoVSETVLI $x14, 82, implicit-def $vl, implicit-def $vtype
19 $v28m4 = PseudoVLE32_V_M4 undef $v28m4, killed $x16, $noreg, 5, 0, implicit $vl, implicit $vtype
23 name: copy_convert_to_vmv_v_v
24 tracksRegLiveness: true
29 ; CHECK-LABEL: name: copy_convert_to_vmv_v_v
30 ; CHECK: liveins: $x14, $x16
32 ; CHECK-NEXT: $x15 = PseudoVSETVLI $x14, 82 /* e32, m4, ta, mu */, implicit-def $vl, implicit-def $vtype
33 ; CHECK-NEXT: $v28m4 = PseudoVLE32_V_M4 undef $v28m4, killed $x16, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
34 ; CHECK-NEXT: $v12m4 = PseudoVMV_V_V_M4 undef $v12m4, $v28m4, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
35 $x15 = PseudoVSETVLI $x14, 82, implicit-def $vl, implicit-def $vtype
36 $v28m4 = PseudoVLE32_V_M4 undef $v28m4, killed $x16, $noreg, 5, 0, implicit $vl, implicit $vtype
40 name: copy_convert_to_vmv_v_i
41 tracksRegLiveness: true
46 ; CHECK-LABEL: name: copy_convert_to_vmv_v_i
47 ; CHECK: liveins: $x14
49 ; CHECK-NEXT: $x15 = PseudoVSETVLI $x14, 82 /* e32, m4, ta, mu */, implicit-def $vl, implicit-def $vtype
50 ; CHECK-NEXT: $v28m4 = PseudoVMV_V_I_M4 undef $v28m4, 0, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
51 ; CHECK-NEXT: $v12m4 = PseudoVMV_V_I_M4 undef $v12m4, 0, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
52 $x15 = PseudoVSETVLI $x14, 82, implicit-def $vl, implicit-def $vtype
53 $v28m4 = PseudoVMV_V_I_M4 undef $v28m4, 0, $noreg, 5, 0, implicit $vl, implicit $vtype
57 name: copy_from_whole_load_store
58 tracksRegLiveness: true
63 ; CHECK-LABEL: name: copy_from_whole_load_store
64 ; CHECK: liveins: $x14, $x16
66 ; CHECK-NEXT: $x15 = PseudoVSETVLI $x14, 82 /* e32, m4, ta, mu */, implicit-def $vl, implicit-def $vtype
67 ; CHECK-NEXT: $v28m4 = VL4RE32_V $x16
68 ; CHECK-NEXT: $v12m4 = VMV4R_V $v28m4
69 $x15 = PseudoVSETVLI $x14, 82, implicit-def $vl, implicit-def $vtype
70 $v28m4 = VL4RE32_V $x16
75 tracksRegLiveness: true
80 ; CHECK-LABEL: name: copy_with_vleff
81 ; CHECK: liveins: $x14, $x16
83 ; CHECK-NEXT: $x15 = PseudoVSETVLI $x14, 82 /* e32, m4, ta, mu */, implicit-def $vl, implicit-def $vtype
84 ; CHECK-NEXT: $v28m4 = PseudoVMV_V_I_M4 undef $v28m4, 0, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
85 ; CHECK-NEXT: $v4m4, $x0 = PseudoVLE32FF_V_M4 undef $v4m4, $x16, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit-def $vl
86 ; CHECK-NEXT: $v12m4 = VMV4R_V $v28m4
87 $x15 = PseudoVSETVLI $x14, 82, implicit-def $vl, implicit-def $vtype
88 $v28m4 = PseudoVMV_V_I_M4 undef $v28m4, 0, $noreg, 5, 0, implicit $vl, implicit $vtype
89 $v4m4,$x0 = PseudoVLE32FF_V_M4 undef $v4m4, $x16, $noreg, 5, 0, implicit-def $vl
93 name: copy_with_vsetvl_x0_x0_1
94 tracksRegLiveness: true
97 liveins: $x14, $x16, $x17, $x18
100 ; CHECK-LABEL: name: copy_with_vsetvl_x0_x0_1
101 ; CHECK: liveins: $x14, $x16, $x17, $x18
103 ; CHECK-NEXT: $x15 = PseudoVSETVLI $x14, 82 /* e32, m4, ta, mu */, implicit-def $vl, implicit-def $vtype
104 ; CHECK-NEXT: $v28m4 = PseudoVLE32_V_M4 undef $v28m4, killed $x16, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
105 ; CHECK-NEXT: $x15 = PseudoVSETVLI $x17, 73 /* e16, m2, ta, mu */, implicit-def $vl, implicit-def $vtype
106 ; CHECK-NEXT: $v0m2 = PseudoVLE32_V_M2 undef $v0m2, $x18, $noreg, 4 /* e16 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
107 ; CHECK-NEXT: $x0 = PseudoVSETVLIX0 $x0, 82 /* e32, m4, ta, mu */, implicit-def $vl, implicit-def $vtype
108 ; CHECK-NEXT: $v4m4 = PseudoVLE32_V_M4 undef $v4m4, killed $x18, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
109 ; CHECK-NEXT: $v12m4 = VMV4R_V $v28m4
110 $x15 = PseudoVSETVLI $x14, 82, implicit-def $vl, implicit-def $vtype
111 $v28m4 = PseudoVLE32_V_M4 undef $v28m4, killed $x16, $noreg, 5, 0, implicit $vl, implicit $vtype
112 $x15 = PseudoVSETVLI $x17, 73, implicit-def $vl, implicit-def $vtype
113 $v0m2 = PseudoVLE32_V_M2 undef $v0m2, $x18, $noreg, 4, 0, implicit $vl, implicit $vtype
114 $x0 = PseudoVSETVLIX0 $x0, 82, implicit-def $vl, implicit-def $vtype
115 $v4m4 = PseudoVLE32_V_M4 undef $v4m4, killed $x18, $noreg, 5, 0, implicit $vl, implicit $vtype
119 name: copy_with_vsetvl_x0_x0_2
120 tracksRegLiveness: true
123 liveins: $x14, $x16, $x17, $x18
126 ; CHECK-LABEL: name: copy_with_vsetvl_x0_x0_2
127 ; CHECK: liveins: $x14, $x16, $x17, $x18
129 ; CHECK-NEXT: $x15 = PseudoVSETVLI $x14, 82 /* e32, m4, ta, mu */, implicit-def $vl, implicit-def $vtype
130 ; CHECK-NEXT: $v28m4 = PseudoVLE32_V_M4 undef $v28m4, killed $x16, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
131 ; CHECK-NEXT: $x0 = PseudoVSETVLIX0 $x0, 73 /* e16, m2, ta, mu */, implicit-def $vl, implicit-def $vtype
132 ; CHECK-NEXT: $v0m2 = PseudoVLE32_V_M2 undef $v0m2, $x18, $noreg, 4 /* e16 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
133 ; CHECK-NEXT: $x0 = PseudoVSETVLIX0 $x0, 82 /* e32, m4, ta, mu */, implicit-def $vl, implicit-def $vtype
134 ; CHECK-NEXT: $v4m4 = PseudoVLE32_V_M4 undef $v4m4, killed $x18, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
135 ; CHECK-NEXT: $v12m4 = PseudoVMV_V_V_M4 undef $v12m4, $v28m4, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
136 $x15 = PseudoVSETVLI $x14, 82, implicit-def $vl, implicit-def $vtype
137 $v28m4 = PseudoVLE32_V_M4 undef $v28m4, killed $x16, $noreg, 5, 0, implicit $vl, implicit $vtype
138 $x0 = PseudoVSETVLIX0 $x0, 73, implicit-def $vl, implicit-def $vtype
139 $v0m2 = PseudoVLE32_V_M2 undef $v0m2, $x18, $noreg, 4, 0, implicit $vl, implicit $vtype
140 $x0 = PseudoVSETVLIX0 $x0, 82, implicit-def $vl, implicit-def $vtype
141 $v4m4 = PseudoVLE32_V_M4 undef $v4m4, killed $x18, $noreg, 5, 0, implicit $vl, implicit $vtype
145 name: copy_with_vsetvl_x0_x0_3
146 tracksRegLiveness: true
149 liveins: $x14, $x16, $x17, $x18
152 ; CHECK-LABEL: name: copy_with_vsetvl_x0_x0_3
153 ; CHECK: liveins: $x14, $x16, $x17, $x18
155 ; CHECK-NEXT: $x15 = PseudoVSETVLI $x14, 82 /* e32, m4, ta, mu */, implicit-def $vl, implicit-def $vtype
156 ; CHECK-NEXT: $v28m4 = PseudoVLE32_V_M4 undef $v28m4, killed $x16, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
157 ; CHECK-NEXT: $x0 = PseudoVSETVLIX0 $x0, 73 /* e16, m2, ta, mu */, implicit-def $vl, implicit-def $vtype
158 ; CHECK-NEXT: $v0m2 = PseudoVLE32_V_M2 undef $v0m2, $x18, $noreg, 4 /* e16 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
159 ; CHECK-NEXT: $v12m4 = VMV4R_V $v28m4
160 $x15 = PseudoVSETVLI $x14, 82, implicit-def $vl, implicit-def $vtype
161 $v28m4 = PseudoVLE32_V_M4 undef $v28m4, killed $x16, $noreg, 5, 0, implicit $vl, implicit $vtype
162 $x0 = PseudoVSETVLIX0 $x0, 73, implicit-def $vl, implicit-def $vtype
163 $v0m2 = PseudoVLE32_V_M2 undef $v0m2, $x18, $noreg, 4, 0, implicit $vl, implicit $vtype
167 name: copy_subregister
168 tracksRegLiveness: true
173 ; CHECK-LABEL: name: copy_subregister
174 ; CHECK: liveins: $x16, $x17
176 ; CHECK-NEXT: $x15 = PseudoVSETIVLI 4, 73 /* e16, m2, ta, mu */, implicit-def $vl, implicit-def $vtype
177 ; CHECK-NEXT: $v26m2 = PseudoVLE16_V_M2 undef $v26m2, killed $x16, $noreg, 4 /* e16 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
178 ; CHECK-NEXT: $v8m2 = PseudoVLE16_V_M2 undef $v8m2, killed $x17, $noreg, 4 /* e16 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
179 ; CHECK-NEXT: early-clobber $v28m4 = PseudoVWADD_VV_M2 undef $v28m4, $v26m2, $v8m2, $noreg, 4 /* e16 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
180 ; CHECK-NEXT: $v12m2 = VMV2R_V $v28m2
181 $x15 = PseudoVSETIVLI 4, 73, implicit-def $vl, implicit-def $vtype
182 $v26m2 = PseudoVLE16_V_M2 undef $v26m2, killed $x16, $noreg, 4, 0, implicit $vl, implicit $vtype
183 $v8m2 = PseudoVLE16_V_M2 undef $v8m2, killed $x17, $noreg, 4, 0, implicit $vl, implicit $vtype
185 $v28m4 = PseudoVWADD_VV_M2 undef $v28m4, $v26m2, $v8m2, $noreg, 4, 0, implicit $vl, implicit $vtype
189 name: copy_with_different_vlmax
190 tracksRegLiveness: true
196 ; CHECK-LABEL: name: copy_with_different_vlmax
197 ; CHECK: liveins: $x14, $x16
199 ; CHECK-NEXT: $x15 = PseudoVSETVLI $x14, 82 /* e32, m4, ta, mu */, implicit-def $vl, implicit-def $vtype
200 ; CHECK-NEXT: $v28m4 = PseudoVLE32_V_M4 undef $v28m4, killed $x16, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
201 ; CHECK-NEXT: $x0 = PseudoVSETVLIX0 $x0, 74 /* e16, m4, ta, mu */, implicit-def $vl, implicit-def $vtype
202 ; CHECK-NEXT: $v12m4 = VMV4R_V $v28m4
203 $x15 = PseudoVSETVLI $x14, 82, implicit-def $vl, implicit-def $vtype
204 $v28m4 = PseudoVLE32_V_M4 undef $v28m4, killed $x16, $noreg, 5, 0, implicit $vl, implicit $vtype
205 $x0 = PseudoVSETVLIX0 $x0, 74, implicit-def $vl, implicit-def $vtype
209 name: copy_with_widening_reduction
210 tracksRegLiveness: true
213 liveins: $x10, $v8, $v26, $v27
214 ; CHECK-LABEL: name: copy_with_widening_reduction
215 ; CHECK: liveins: $x10, $v8, $v26, $v27
217 ; CHECK-NEXT: $x11 = PseudoVSETIVLI 1, 64 /* e8, m1, ta, mu */, implicit-def $vl, implicit-def $vtype
218 ; CHECK-NEXT: $v8 = PseudoVWREDSUM_VS_M1_E8 killed renamable $v8, killed renamable $v26, killed renamable $v27, 1, 3 /* e8 */, 1 /* ta, mu */, implicit $vl, implicit $vtype
219 ; CHECK-NEXT: $v26 = VMV1R_V killed $v8
220 ; CHECK-NEXT: $x10 = PseudoVSETVLI killed renamable $x10, 75 /* e16, m8, ta, mu */, implicit-def $vl, implicit-def $vtype
221 ; CHECK-NEXT: $v8m8 = VL8RE8_V killed $x10
222 $x11 = PseudoVSETIVLI 1, 64, implicit-def $vl, implicit-def $vtype
223 $v8 = PseudoVWREDSUM_VS_M1_E8 killed renamable $v8, killed renamable $v26, killed renamable $v27, 1, 3, 1, implicit $vl, implicit $vtype
224 $v26 = COPY killed renamable $v8
225 $x10 = PseudoVSETVLI killed renamable $x10, 75, implicit-def $vl, implicit-def $vtype
226 $v8m8 = VL8RE8_V killed $x10
229 name: copy_zvlsseg_reg
230 tracksRegLiveness: true
235 ; CHECK-LABEL: name: copy_zvlsseg_reg
236 ; CHECK: liveins: $x14, $x16
238 ; CHECK-NEXT: $x15 = PseudoVSETVLI $x14, 80 /* e32, m1, ta, mu */, implicit-def $vl, implicit-def $vtype
239 ; CHECK-NEXT: $v8_v9 = PseudoVLSEG2E32_V_M1 undef $v8_v9, killed $x16, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
240 ; CHECK-NEXT: $v10 = VMV1R_V $v8
241 $x15 = PseudoVSETVLI $x14, 80, implicit-def $vl, implicit-def $vtype
242 $v8_v9 = PseudoVLSEG2E32_V_M1 undef $v8_v9, killed $x16, $noreg, 5, 0, implicit $vl, implicit $vtype
246 name: copy_zvlsseg_reg_2
247 tracksRegLiveness: true
252 ; CHECK-LABEL: name: copy_zvlsseg_reg_2
253 ; CHECK: liveins: $x14, $x16
255 ; CHECK-NEXT: $x15 = PseudoVSETVLI $x14, 80 /* e32, m1, ta, mu */, implicit-def $vl, implicit-def $vtype
256 ; CHECK-NEXT: $v8_v9 = PseudoVLSEG2E32_V_M1 undef $v8_v9, killed $x16, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
257 ; CHECK-NEXT: $v10 = PseudoVMV_V_V_M1 undef $v10, $v8, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
258 ; CHECK-NEXT: $v11 = PseudoVMV_V_V_M1 undef $v11, $v9, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
259 $x15 = PseudoVSETVLI $x14, 80, implicit-def $vl, implicit-def $vtype
260 $v8_v9 = PseudoVLSEG2E32_V_M1 undef $v8_v9, killed $x16, $noreg, 5, 0, implicit $vl, implicit $vtype
261 $v10_v11 = COPY $v8_v9
264 name: copy_fractional_lmul
265 tracksRegLiveness: true
270 ; CHECK-LABEL: name: copy_fractional_lmul
271 ; CHECK: liveins: $x14, $x16
273 ; CHECK-NEXT: $x15 = PseudoVSETVLI $x14, 87 /* e32, mf2, ta, mu */, implicit-def $vl, implicit-def $vtype
274 ; CHECK-NEXT: $v28 = PseudoVLE32_V_MF2 undef $v28, killed $x16, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
275 ; CHECK-NEXT: $v12 = VMV1R_V $v28
276 $x15 = PseudoVSETVLI $x14, 87, implicit-def $vl, implicit-def $vtype
277 $v28 = PseudoVLE32_V_MF2 undef $v28, killed $x16, $noreg, 5, 0, implicit $vl, implicit $vtype
281 name: copy_implicit_def
282 tracksRegLiveness: true
285 liveins: $x12, $x14, $x16
287 ; CHECK-LABEL: name: copy_implicit_def
288 ; CHECK: liveins: $x12, $x14, $x16
290 ; CHECK-NEXT: $x0 = PseudoVSETVLI $x14, 80 /* e32, m1, ta, mu */, implicit-def $vl, implicit-def $vtype
291 ; CHECK-NEXT: $v8_v9_v10_v11_v12_v13_v14_v15 = PseudoVLSEG8E32_V_M1 undef $v8_v9_v10_v11_v12_v13_v14_v15, killed $x12, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
292 ; CHECK-NEXT: $x0 = PseudoVSETIVLI 10, 80 /* e32, m1, ta, mu */, implicit-def $vl, implicit-def $vtype
293 ; CHECK-NEXT: $v15 = PseudoVLE32_V_M1 undef $v15, killed $x16, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype, implicit killed $v8_v9_v10_v11_v12_v13_v14_v15, implicit-def $v8_v9_v10_v11_v12_v13_v14_v15
294 ; CHECK-NEXT: $v24 = VMV1R_V killed $v8
295 ; CHECK-NEXT: $v25 = VMV1R_V killed $v9
296 ; CHECK-NEXT: $v26 = VMV1R_V killed $v10
297 ; CHECK-NEXT: $v27 = VMV1R_V killed $v11
298 ; CHECK-NEXT: $v28 = VMV1R_V killed $v12
299 ; CHECK-NEXT: $v29 = VMV1R_V killed $v13
300 ; CHECK-NEXT: $v30 = VMV1R_V killed $v14
301 ; CHECK-NEXT: $v31 = VMV1R_V killed $v15
302 $x0 = PseudoVSETVLI $x14, 80, implicit-def $vl, implicit-def $vtype
303 $v8_v9_v10_v11_v12_v13_v14_v15 = PseudoVLSEG8E32_V_M1 undef $v8_v9_v10_v11_v12_v13_v14_v15, killed $x12, $noreg, 5, 0, implicit $vl, implicit $vtype
304 $x0 = PseudoVSETIVLI 10, 80, implicit-def $vl, implicit-def $vtype
305 $v15 = PseudoVLE32_V_M1 undef $v15, killed $x16, $noreg, 5, 0, implicit $vl, implicit $vtype, implicit killed $v8_v9_v10_v11_v12_v13_v14_v15, implicit-def $v8_v9_v10_v11_v12_v13_v14_v15
306 $v24_v25_v26_v27_v28_v29_v30_v31 = COPY killed $v8_v9_v10_v11_v12_v13_v14_v15
309 name: copy_narrow_copies_in_between
310 tracksRegLiveness: true
313 liveins: $x10, $x11, $v8, $v9
314 ; CHECK-LABEL: name: copy_narrow_copies_in_between
315 ; CHECK: liveins: $x10, $x11, $v8, $v9
317 ; CHECK-NEXT: $x0 = PseudoVSETVLI $x10, 201 /* e16, m2, ta, ma */, implicit-def $vl, implicit-def $vtype
318 ; CHECK-NEXT: $v10m2 = PseudoVLE16_V_M2 undef $v10m2, killed $x11, $noreg, 4 /* e16 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
319 ; CHECK-NEXT: $v10 = VMV1R_V $v8
320 ; CHECK-NEXT: $v11 = VMV1R_V $v9
321 ; CHECK-NEXT: $v12m2 = VMV2R_V $v10m2
322 $x0 = PseudoVSETVLI $x10, 201, implicit-def $vl, implicit-def $vtype
323 $v10m2 = PseudoVLE16_V_M2 undef $v10m2, killed $x11, $noreg, 4, 0, implicit $vl, implicit $vtype