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
11 ; CHECK-LABEL: name: copy_different_lmul
12 ; CHECK: liveins: $x14, $x16
14 ; CHECK-NEXT: $x15 = PseudoVSETVLI $x14, 82 /* e32, m4, ta, mu */, implicit-def $vl, implicit-def $vtype
15 ; CHECK-NEXT: $v28m4 = PseudoVLE32_V_M4 undef $v28m4, killed $x16, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
16 ; CHECK-NEXT: $v12m2 = VMV2R_V $v28m2
17 $x15 = PseudoVSETVLI $x14, 82, implicit-def $vl, implicit-def $vtype
18 $v28m4 = PseudoVLE32_V_M4 undef $v28m4, killed $x16, $noreg, 5, 0, implicit $vl, implicit $vtype
22 name: copy_convert_to_vmv_v_v
23 tracksRegLiveness: true
27 ; CHECK-LABEL: name: copy_convert_to_vmv_v_v
28 ; CHECK: liveins: $x14, $x16
30 ; CHECK-NEXT: $x15 = PseudoVSETVLI $x14, 82 /* e32, m4, ta, mu */, implicit-def $vl, implicit-def $vtype
31 ; CHECK-NEXT: $v28m4 = PseudoVLE32_V_M4 undef $v28m4, killed $x16, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
32 ; CHECK-NEXT: $v12m4 = PseudoVMV_V_V_M4 undef $v12m4, $v28m4, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
33 $x15 = PseudoVSETVLI $x14, 82, implicit-def $vl, implicit-def $vtype
34 $v28m4 = PseudoVLE32_V_M4 undef $v28m4, killed $x16, $noreg, 5, 0, implicit $vl, implicit $vtype
38 name: copy_convert_to_vmv_v_i
39 tracksRegLiveness: true
43 ; CHECK-LABEL: name: copy_convert_to_vmv_v_i
44 ; CHECK: liveins: $x14
46 ; CHECK-NEXT: $x15 = PseudoVSETVLI $x14, 82 /* e32, m4, ta, mu */, implicit-def $vl, implicit-def $vtype
47 ; CHECK-NEXT: $v28m4 = PseudoVMV_V_I_M4 undef $v28m4, 0, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
48 ; CHECK-NEXT: $v12m4 = PseudoVMV_V_I_M4 undef $v12m4, 0, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
49 $x15 = PseudoVSETVLI $x14, 82, implicit-def $vl, implicit-def $vtype
50 $v28m4 = PseudoVMV_V_I_M4 undef $v28m4, 0, $noreg, 5, 0, implicit $vl, implicit $vtype
54 name: copy_from_whole_load_store
55 tracksRegLiveness: true
59 ; CHECK-LABEL: name: copy_from_whole_load_store
60 ; CHECK: liveins: $x14, $x16
62 ; CHECK-NEXT: $x15 = PseudoVSETVLI $x14, 82 /* e32, m4, ta, mu */, implicit-def $vl, implicit-def $vtype
63 ; CHECK-NEXT: $v28m4 = VL4RE32_V $x16
64 ; CHECK-NEXT: $v12m4 = VMV4R_V $v28m4
65 $x15 = PseudoVSETVLI $x14, 82, implicit-def $vl, implicit-def $vtype
66 $v28m4 = VL4RE32_V $x16
71 tracksRegLiveness: true
75 ; CHECK-LABEL: name: copy_with_vleff
76 ; CHECK: liveins: $x14, $x16
78 ; CHECK-NEXT: $x15 = PseudoVSETVLI $x14, 82 /* e32, m4, ta, mu */, implicit-def $vl, implicit-def $vtype
79 ; CHECK-NEXT: $v28m4 = PseudoVMV_V_I_M4 undef $v28m4, 0, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
80 ; CHECK-NEXT: $v4m4, $x0 = PseudoVLE32FF_V_M4 undef $v4m4, $x16, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit-def $vl
81 ; CHECK-NEXT: $v12m4 = VMV4R_V $v28m4
82 $x15 = PseudoVSETVLI $x14, 82, implicit-def $vl, implicit-def $vtype
83 $v28m4 = PseudoVMV_V_I_M4 undef $v28m4, 0, $noreg, 5, 0, implicit $vl, implicit $vtype
84 $v4m4,$x0 = PseudoVLE32FF_V_M4 undef $v4m4, $x16, $noreg, 5, 0, implicit-def $vl
88 name: copy_with_vsetvl_x0_x0_1
89 tracksRegLiveness: true
92 liveins: $x14, $x16, $x17, $x18
93 ; CHECK-LABEL: name: copy_with_vsetvl_x0_x0_1
94 ; CHECK: liveins: $x14, $x16, $x17, $x18
96 ; CHECK-NEXT: $x15 = PseudoVSETVLI $x14, 82 /* e32, m4, ta, mu */, implicit-def $vl, implicit-def $vtype
97 ; CHECK-NEXT: $v28m4 = PseudoVLE32_V_M4 undef $v28m4, killed $x16, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
98 ; CHECK-NEXT: $x15 = PseudoVSETVLI $x17, 73 /* e16, m2, ta, mu */, implicit-def $vl, implicit-def $vtype
99 ; CHECK-NEXT: $v0m2 = PseudoVLE32_V_M2 undef $v0m2, $x18, $noreg, 4 /* e16 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
100 ; CHECK-NEXT: $x0 = PseudoVSETVLIX0 $x0, 82 /* e32, m4, ta, mu */, implicit-def $vl, implicit-def $vtype
101 ; CHECK-NEXT: $v4m4 = PseudoVLE32_V_M4 undef $v4m4, killed $x18, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
102 ; CHECK-NEXT: $v12m4 = VMV4R_V $v28m4
103 $x15 = PseudoVSETVLI $x14, 82, implicit-def $vl, implicit-def $vtype
104 $v28m4 = PseudoVLE32_V_M4 undef $v28m4, killed $x16, $noreg, 5, 0, implicit $vl, implicit $vtype
105 $x15 = PseudoVSETVLI $x17, 73, implicit-def $vl, implicit-def $vtype
106 $v0m2 = PseudoVLE32_V_M2 undef $v0m2, $x18, $noreg, 4, 0, implicit $vl, implicit $vtype
107 $x0 = PseudoVSETVLIX0 $x0, 82, implicit-def $vl, implicit-def $vtype
108 $v4m4 = PseudoVLE32_V_M4 undef $v4m4, killed $x18, $noreg, 5, 0, implicit $vl, implicit $vtype
112 name: copy_with_vsetvl_x0_x0_2
113 tracksRegLiveness: true
116 liveins: $x14, $x16, $x17, $x18
117 ; CHECK-LABEL: name: copy_with_vsetvl_x0_x0_2
118 ; CHECK: liveins: $x14, $x16, $x17, $x18
120 ; CHECK-NEXT: $x15 = PseudoVSETVLI $x14, 82 /* e32, m4, ta, mu */, implicit-def $vl, implicit-def $vtype
121 ; CHECK-NEXT: $v28m4 = PseudoVLE32_V_M4 undef $v28m4, killed $x16, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
122 ; CHECK-NEXT: $x0 = PseudoVSETVLIX0 $x0, 73 /* e16, m2, ta, mu */, implicit-def $vl, implicit-def $vtype
123 ; CHECK-NEXT: $v0m2 = PseudoVLE32_V_M2 undef $v0m2, $x18, $noreg, 4 /* e16 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
124 ; CHECK-NEXT: $x0 = PseudoVSETVLIX0 $x0, 82 /* e32, m4, ta, mu */, implicit-def $vl, implicit-def $vtype
125 ; CHECK-NEXT: $v4m4 = PseudoVLE32_V_M4 undef $v4m4, killed $x18, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
126 ; CHECK-NEXT: $v12m4 = PseudoVMV_V_V_M4 undef $v12m4, $v28m4, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
127 $x15 = PseudoVSETVLI $x14, 82, implicit-def $vl, implicit-def $vtype
128 $v28m4 = PseudoVLE32_V_M4 undef $v28m4, killed $x16, $noreg, 5, 0, implicit $vl, implicit $vtype
129 $x0 = PseudoVSETVLIX0 $x0, 73, implicit-def $vl, implicit-def $vtype
130 $v0m2 = PseudoVLE32_V_M2 undef $v0m2, $x18, $noreg, 4, 0, implicit $vl, implicit $vtype
131 $x0 = PseudoVSETVLIX0 $x0, 82, implicit-def $vl, implicit-def $vtype
132 $v4m4 = PseudoVLE32_V_M4 undef $v4m4, killed $x18, $noreg, 5, 0, implicit $vl, implicit $vtype
136 name: copy_with_vsetvl_x0_x0_3
137 tracksRegLiveness: true
140 liveins: $x14, $x16, $x17, $x18
141 ; CHECK-LABEL: name: copy_with_vsetvl_x0_x0_3
142 ; CHECK: liveins: $x14, $x16, $x17, $x18
144 ; CHECK-NEXT: $x15 = PseudoVSETVLI $x14, 82 /* e32, m4, ta, mu */, implicit-def $vl, implicit-def $vtype
145 ; CHECK-NEXT: $v28m4 = PseudoVLE32_V_M4 undef $v28m4, killed $x16, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
146 ; CHECK-NEXT: $x0 = PseudoVSETVLIX0 $x0, 73 /* e16, m2, ta, mu */, implicit-def $vl, implicit-def $vtype
147 ; CHECK-NEXT: $v0m2 = PseudoVLE32_V_M2 undef $v0m2, $x18, $noreg, 4 /* e16 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
148 ; CHECK-NEXT: $v12m4 = VMV4R_V $v28m4
149 $x15 = PseudoVSETVLI $x14, 82, implicit-def $vl, implicit-def $vtype
150 $v28m4 = PseudoVLE32_V_M4 undef $v28m4, killed $x16, $noreg, 5, 0, implicit $vl, implicit $vtype
151 $x0 = PseudoVSETVLIX0 $x0, 73, implicit-def $vl, implicit-def $vtype
152 $v0m2 = PseudoVLE32_V_M2 undef $v0m2, $x18, $noreg, 4, 0, implicit $vl, implicit $vtype
156 name: copy_subregister
157 tracksRegLiveness: true
161 ; CHECK-LABEL: name: copy_subregister
162 ; CHECK: liveins: $x16, $x17
164 ; CHECK-NEXT: $x15 = PseudoVSETIVLI 4, 73 /* e16, m2, ta, mu */, implicit-def $vl, implicit-def $vtype
165 ; CHECK-NEXT: $v26m2 = PseudoVLE16_V_M2 undef $v26m2, killed $x16, $noreg, 4 /* e16 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
166 ; CHECK-NEXT: $v8m2 = PseudoVLE16_V_M2 undef $v8m2, killed $x17, $noreg, 4 /* e16 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
167 ; CHECK-NEXT: early-clobber $v28m4 = PseudoVWADD_VV_M2 undef $v28m4, $v26m2, $v8m2, $noreg, 4 /* e16 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
168 ; CHECK-NEXT: $v12m2 = VMV2R_V $v28m2
169 $x15 = PseudoVSETIVLI 4, 73, implicit-def $vl, implicit-def $vtype
170 $v26m2 = PseudoVLE16_V_M2 undef $v26m2, killed $x16, $noreg, 4, 0, implicit $vl, implicit $vtype
171 $v8m2 = PseudoVLE16_V_M2 undef $v8m2, killed $x17, $noreg, 4, 0, implicit $vl, implicit $vtype
173 $v28m4 = PseudoVWADD_VV_M2 undef $v28m4, $v26m2, $v8m2, $noreg, 4, 0, implicit $vl, implicit $vtype
177 name: copy_with_different_vlmax
178 tracksRegLiveness: true
182 ; CHECK-LABEL: name: copy_with_different_vlmax
183 ; CHECK: liveins: $x14, $x16
185 ; CHECK-NEXT: $x15 = PseudoVSETVLI $x14, 82 /* e32, m4, ta, mu */, implicit-def $vl, implicit-def $vtype
186 ; CHECK-NEXT: $v28m4 = PseudoVLE32_V_M4 undef $v28m4, killed $x16, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
187 ; CHECK-NEXT: $x0 = PseudoVSETVLIX0 $x0, 74 /* e16, m4, ta, mu */, implicit-def $vl, implicit-def $vtype
188 ; CHECK-NEXT: $v12m4 = VMV4R_V $v28m4
189 $x15 = PseudoVSETVLI $x14, 82, implicit-def $vl, implicit-def $vtype
190 $v28m4 = PseudoVLE32_V_M4 undef $v28m4, killed $x16, $noreg, 5, 0, implicit $vl, implicit $vtype
191 $x0 = PseudoVSETVLIX0 $x0, 74, implicit-def $vl, implicit-def $vtype
195 name: copy_with_widening_reduction
196 tracksRegLiveness: true
199 liveins: $x10, $v8, $v26, $v27
200 ; CHECK-LABEL: name: copy_with_widening_reduction
201 ; CHECK: liveins: $x10, $v8, $v26, $v27
203 ; CHECK-NEXT: $x11 = PseudoVSETIVLI 1, 64 /* e8, m1, ta, mu */, implicit-def $vl, implicit-def $vtype
204 ; 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
205 ; CHECK-NEXT: $v26 = VMV1R_V killed $v8
206 ; CHECK-NEXT: $x10 = PseudoVSETVLI killed renamable $x10, 75 /* e16, m8, ta, mu */, implicit-def $vl, implicit-def $vtype
207 ; CHECK-NEXT: $v8m8 = VL8RE8_V killed $x10
208 $x11 = PseudoVSETIVLI 1, 64, implicit-def $vl, implicit-def $vtype
209 $v8 = PseudoVWREDSUM_VS_M1_E8 killed renamable $v8, killed renamable $v26, killed renamable $v27, 1, 3, 1, implicit $vl, implicit $vtype
210 $v26 = COPY killed renamable $v8
211 $x10 = PseudoVSETVLI killed renamable $x10, 75, implicit-def $vl, implicit-def $vtype
212 $v8m8 = VL8RE8_V killed $x10
215 name: copy_zvlsseg_reg
216 tracksRegLiveness: true
220 ; CHECK-LABEL: name: copy_zvlsseg_reg
221 ; CHECK: liveins: $x14, $x16
223 ; CHECK-NEXT: $x15 = PseudoVSETVLI $x14, 80 /* e32, m1, ta, mu */, implicit-def $vl, implicit-def $vtype
224 ; CHECK-NEXT: $v8_v9 = PseudoVLSEG2E32_V_M1 undef $v8_v9, killed $x16, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
225 ; CHECK-NEXT: $v10 = VMV1R_V $v8
226 $x15 = PseudoVSETVLI $x14, 80, implicit-def $vl, implicit-def $vtype
227 $v8_v9 = PseudoVLSEG2E32_V_M1 undef $v8_v9, killed $x16, $noreg, 5, 0, implicit $vl, implicit $vtype
231 name: copy_zvlsseg_reg_2
232 tracksRegLiveness: true
236 ; CHECK-LABEL: name: copy_zvlsseg_reg_2
237 ; CHECK: liveins: $x14, $x16
239 ; CHECK-NEXT: $x15 = PseudoVSETVLI $x14, 80 /* e32, m1, ta, mu */, implicit-def $vl, implicit-def $vtype
240 ; CHECK-NEXT: $v8_v9 = PseudoVLSEG2E32_V_M1 undef $v8_v9, killed $x16, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
241 ; CHECK-NEXT: $v10m2 = VMV2R_V $v8m2
242 $x15 = PseudoVSETVLI $x14, 80, implicit-def $vl, implicit-def $vtype
243 $v8_v9 = PseudoVLSEG2E32_V_M1 undef $v8_v9, killed $x16, $noreg, 5, 0, implicit $vl, implicit $vtype
244 $v10_v11 = COPY $v8_v9
247 name: copy_fractional_lmul
248 tracksRegLiveness: true
252 ; CHECK-LABEL: name: copy_fractional_lmul
253 ; CHECK: liveins: $x14, $x16
255 ; CHECK-NEXT: $x15 = PseudoVSETVLI $x14, 87 /* e32, mf2, ta, mu */, implicit-def $vl, implicit-def $vtype
256 ; CHECK-NEXT: $v28 = PseudoVLE32_V_MF2 undef $v28, killed $x16, $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
257 ; CHECK-NEXT: $v12 = VMV1R_V $v28
258 $x15 = PseudoVSETVLI $x14, 87, implicit-def $vl, implicit-def $vtype
259 $v28 = PseudoVLE32_V_MF2 undef $v28, killed $x16, $noreg, 5, 0, implicit $vl, implicit $vtype
263 name: copy_implicit_def
264 tracksRegLiveness: true
267 liveins: $x12, $x14, $x16
268 ; CHECK-LABEL: name: copy_implicit_def
269 ; CHECK: liveins: $x12, $x14, $x16
271 ; CHECK-NEXT: $x0 = PseudoVSETVLI $x14, 80 /* e32, m1, ta, mu */, implicit-def $vl, implicit-def $vtype
272 ; 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
273 ; CHECK-NEXT: $x0 = PseudoVSETIVLI 10, 80 /* e32, m1, ta, mu */, implicit-def $vl, implicit-def $vtype
274 ; 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
275 ; CHECK-NEXT: $v24m8 = VMV8R_V killed $v8m8
276 $x0 = PseudoVSETVLI $x14, 80, implicit-def $vl, implicit-def $vtype
277 $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
278 $x0 = PseudoVSETIVLI 10, 80, implicit-def $vl, implicit-def $vtype
279 $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
280 $v24_v25_v26_v27_v28_v29_v30_v31 = COPY killed $v8_v9_v10_v11_v12_v13_v14_v15
283 name: copy_narrow_copies_in_between
284 tracksRegLiveness: true
287 liveins: $x10, $x11, $v8, $v9
288 ; CHECK-LABEL: name: copy_narrow_copies_in_between
289 ; CHECK: liveins: $x10, $x11, $v8, $v9
291 ; CHECK-NEXT: $x0 = PseudoVSETVLI $x10, 201 /* e16, m2, ta, ma */, implicit-def $vl, implicit-def $vtype
292 ; CHECK-NEXT: $v10m2 = PseudoVLE16_V_M2 undef $v10m2, killed $x11, $noreg, 4 /* e16 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
293 ; CHECK-NEXT: $v10 = VMV1R_V $v8
294 ; CHECK-NEXT: $v11 = VMV1R_V $v9
295 ; CHECK-NEXT: $v12m2 = VMV2R_V $v10m2
296 $x0 = PseudoVSETVLI $x10, 201, implicit-def $vl, implicit-def $vtype
297 $v10m2 = PseudoVLE16_V_M2 undef $v10m2, killed $x11, $noreg, 4, 0, implicit $vl, implicit $vtype