1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc %s -o - -mtriple=riscv64 -mattr=v -run-pass=liveintervals,riscv-insert-vsetvli \
3 # RUN: -verify-machineinstrs | FileCheck %s
6 source_filename = "vsetvli-insert.ll"
7 target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n64-S128"
8 target triple = "riscv64"
10 define <vscale x 1 x i64> @add(<vscale x 1 x i64> %0, <vscale x 1 x i64> %1, i64 %2) #0 {
12 %a = call <vscale x 1 x i64> @llvm.riscv.vadd.nxv1i64.nxv1i64.i64(<vscale x 1 x i64> undef, <vscale x 1 x i64> %0, <vscale x 1 x i64> %1, i64 %2)
13 ret <vscale x 1 x i64> %a
16 define <vscale x 1 x i64> @load_add(ptr %0, <vscale x 1 x i64> %1, i64 %2) #0 {
18 %a = call <vscale x 1 x i64> @llvm.riscv.vle.nxv1i64.i64(<vscale x 1 x i64> undef, ptr %0, i64 %2)
19 %b = call <vscale x 1 x i64> @llvm.riscv.vadd.nxv1i64.nxv1i64.i64(<vscale x 1 x i64> undef, <vscale x 1 x i64> %a, <vscale x 1 x i64> %1, i64 %2)
20 ret <vscale x 1 x i64> %b
23 define <vscale x 1 x i64> @load_zext(ptr %0, i64 %1) #0 {
25 %a = call <vscale x 1 x i32> @llvm.riscv.vle.nxv1i32.i64(<vscale x 1 x i32> undef, ptr %0, i64 %1)
26 %b = call <vscale x 1 x i64> @llvm.riscv.vzext.nxv1i64.nxv1i32.i64(<vscale x 1 x i64> undef, <vscale x 1 x i32> %a, i64 %1)
27 ret <vscale x 1 x i64> %b
30 declare i64 @llvm.riscv.vmv.x.s.nxv1i64(<vscale x 1 x i64>) #1
32 define i64 @vmv_x_s(<vscale x 1 x i64> %0) #0 {
34 %a = call i64 @llvm.riscv.vmv.x.s.nxv1i64(<vscale x 1 x i64> %0)
38 define void @add_v2i64(ptr %x, ptr %y) #0 {
39 %a = load <2 x i64>, ptr %x, align 16
40 %b = load <2 x i64>, ptr %y, align 16
41 %c = add <2 x i64> %a, %b
42 store <2 x i64> %c, ptr %x, align 16
46 declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #2
48 define i64 @vreduce_add_v2i64(ptr %x) #0 {
49 %v = load <2 x i64>, ptr %x, align 16
50 %red = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %v)
54 declare i64 @llvm.riscv.vsetvli.i64(i64, i64 immarg, i64 immarg) #3
56 define <vscale x 1 x i64> @vsetvli_add(<vscale x 1 x i64> %0, <vscale x 1 x i64> %1, i64 %avl) #0 {
58 %a = call i64 @llvm.riscv.vsetvli.i64(i64 %avl, i64 3, i64 0)
59 %b = call <vscale x 1 x i64> @llvm.riscv.vadd.nxv1i64.nxv1i64.i64(<vscale x 1 x i64> undef, <vscale x 1 x i64> %0, <vscale x 1 x i64> %1, i64 %a)
60 ret <vscale x 1 x i64> %b
63 define <vscale x 1 x i64> @load_add_inlineasm(ptr %0, <vscale x 1 x i64> %1, i64 %2) #0 {
65 %a = call <vscale x 1 x i64> @llvm.riscv.vle.nxv1i64.i64(<vscale x 1 x i64> undef, ptr %0, i64 %2)
66 call void asm sideeffect "", ""()
67 %b = call <vscale x 1 x i64> @llvm.riscv.vadd.nxv1i64.nxv1i64.i64(<vscale x 1 x i64> undef, <vscale x 1 x i64> %a, <vscale x 1 x i64> %1, i64 %2)
68 ret <vscale x 1 x i64> %b
71 define void @vmv_v_i_different_lmuls() {
75 define void @pre_same_sewlmul_ratio() {
79 define void @postpass_modify_vl() {
83 define void @coalesce_dead_avl_addi() {
87 define void @coalesce_dead_avl_nonvolatile_load() {
91 define void @coalesce_dead_avl_volatile_load() {
95 define void @coalesce_shrink_removed_vsetvlis_uses() {
99 declare <vscale x 1 x i64> @llvm.riscv.vadd.nxv1i64.nxv1i64.i64(<vscale x 1 x i64>, <vscale x 1 x i64>, <vscale x 1 x i64>, i64) #1
101 declare <vscale x 1 x i64> @llvm.riscv.vle.nxv1i64.i64(<vscale x 1 x i64>, ptr nocapture, i64) #4
103 declare <vscale x 1 x i32> @llvm.riscv.vle.nxv1i32.i64(<vscale x 1 x i32>, ptr nocapture, i64) #4
105 declare <vscale x 1 x i64> @llvm.riscv.vzext.nxv1i64.nxv1i32.i64(<vscale x 1 x i64>, <vscale x 1 x i32>, i64) #1
107 attributes #0 = { "target-features"="+v" }
108 attributes #1 = { nounwind readnone }
109 attributes #2 = { nofree nosync nounwind readnone willreturn }
110 attributes #3 = { nounwind }
111 attributes #4 = { nounwind readonly }
117 tracksRegLiveness: true
119 - { id: 0, class: vr }
120 - { id: 1, class: vr }
121 - { id: 2, class: gprnox0 }
122 - { id: 3, class: vr }
124 - { reg: '$v8', virtual-reg: '%0' }
125 - { reg: '$v9', virtual-reg: '%1' }
126 - { reg: '$x10', virtual-reg: '%2' }
129 machineFunctionInfo: {}
132 liveins: $v8, $v9, $x10
134 ; CHECK-LABEL: name: add
135 ; CHECK: liveins: $v8, $v9, $x10
137 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprnox0 = COPY $x10
138 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vr = COPY $v9
139 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vr = COPY $v8
140 ; CHECK-NEXT: dead $x0 = PseudoVSETVLI [[COPY]], 216 /* e64, m1, ta, ma */, implicit-def $vl, implicit-def $vtype
141 ; CHECK-NEXT: [[PseudoVADD_VV_M1_:%[0-9]+]]:vr = PseudoVADD_VV_M1 undef $noreg, [[COPY2]], [[COPY1]], $noreg, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
142 ; CHECK-NEXT: $v8 = COPY [[PseudoVADD_VV_M1_]]
143 ; CHECK-NEXT: PseudoRET implicit $v8
144 %2:gprnox0 = COPY $x10
147 %3:vr = PseudoVADD_VV_M1 undef $noreg, %0, %1, %2, 6, 0
149 PseudoRET implicit $v8
155 tracksRegLiveness: true
157 - { id: 0, class: gpr }
158 - { id: 1, class: vr }
159 - { id: 2, class: gprnox0 }
160 - { id: 3, class: vr }
161 - { id: 4, class: vr }
163 - { reg: '$x10', virtual-reg: '%0' }
164 - { reg: '$v8', virtual-reg: '%1' }
165 - { reg: '$x11', virtual-reg: '%2' }
168 machineFunctionInfo: {}
171 liveins: $x10, $v8, $x11
173 ; CHECK-LABEL: name: load_add
174 ; CHECK: liveins: $x10, $v8, $x11
176 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprnox0 = COPY $x11
177 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vr = COPY $v8
178 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x10
179 ; CHECK-NEXT: dead $x0 = PseudoVSETVLI [[COPY]], 216 /* e64, m1, ta, ma */, implicit-def $vl, implicit-def $vtype
180 ; CHECK-NEXT: [[PseudoVLE64_V_M1_:%[0-9]+]]:vr = PseudoVLE64_V_M1 undef $noreg, [[COPY2]], $noreg, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
181 ; CHECK-NEXT: [[PseudoVADD_VV_M1_:%[0-9]+]]:vr = PseudoVADD_VV_M1 undef $noreg, [[PseudoVLE64_V_M1_]], [[COPY1]], $noreg, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
182 ; CHECK-NEXT: $v8 = COPY [[PseudoVADD_VV_M1_]]
183 ; CHECK-NEXT: PseudoRET implicit $v8
184 %2:gprnox0 = COPY $x11
187 %3:vr = PseudoVLE64_V_M1 undef $noreg, %0, %2, 6, 0
188 %4:vr = PseudoVADD_VV_M1 undef $noreg, killed %3, %1, %2, 6, 0
190 PseudoRET implicit $v8
196 tracksRegLiveness: true
198 - { id: 0, class: gpr }
199 - { id: 1, class: gprnox0 }
200 - { id: 2, class: vr }
201 - { id: 3, class: vr }
203 - { reg: '$x10', virtual-reg: '%0' }
204 - { reg: '$x11', virtual-reg: '%1' }
207 machineFunctionInfo: {}
212 ; CHECK-LABEL: name: load_zext
213 ; CHECK: liveins: $x10, $x11
215 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprnox0 = COPY $x11
216 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x10
217 ; CHECK-NEXT: dead $x0 = PseudoVSETVLI [[COPY]], 216 /* e64, m1, ta, ma */, implicit-def $vl, implicit-def $vtype
218 ; CHECK-NEXT: [[PseudoVLE32_V_MF2_:%[0-9]+]]:vr = PseudoVLE32_V_MF2 undef $noreg, [[COPY1]], $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
219 ; CHECK-NEXT: early-clobber %3:vr = PseudoVZEXT_VF2_M1 undef $noreg, [[PseudoVLE32_V_MF2_]], $noreg, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
220 ; CHECK-NEXT: $v8 = COPY %3
221 ; CHECK-NEXT: PseudoRET implicit $v8
222 %1:gprnox0 = COPY $x11
224 %2:vr = PseudoVLE32_V_MF2 undef $noreg, %0, %1, 5, 0
225 early-clobber %3:vr = PseudoVZEXT_VF2_M1 undef $noreg, killed %2, %1, 6, 0
227 PseudoRET implicit $v8
233 tracksRegLiveness: true
235 - { id: 0, class: vr }
236 - { id: 1, class: gpr }
238 - { reg: '$v8', virtual-reg: '%0' }
241 machineFunctionInfo: {}
246 ; CHECK-LABEL: name: vmv_x_s
247 ; CHECK: liveins: $v8
249 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vr = COPY $v8
250 ; CHECK-NEXT: dead $x0 = PseudoVSETIVLI 1, 216 /* e64, m1, ta, ma */, implicit-def $vl, implicit-def $vtype
251 ; CHECK-NEXT: [[PseudoVMV_X_S:%[0-9]+]]:gpr = PseudoVMV_X_S [[COPY]], 6 /* e64 */, implicit $vtype
252 ; CHECK-NEXT: $x10 = COPY [[PseudoVMV_X_S]]
253 ; CHECK-NEXT: PseudoRET implicit $x10
255 %1:gpr = PseudoVMV_X_S %0, 6
257 PseudoRET implicit $x10
263 tracksRegLiveness: true
265 - { id: 0, class: gpr }
266 - { id: 1, class: gpr }
267 - { id: 2, class: vr }
268 - { id: 3, class: vr }
269 - { id: 4, class: vr }
271 - { reg: '$x10', virtual-reg: '%0' }
272 - { reg: '$x11', virtual-reg: '%1' }
275 machineFunctionInfo: {}
280 ; CHECK-LABEL: name: add_v2i64
281 ; CHECK: liveins: $x10, $x11
283 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x11
284 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x10
285 ; CHECK-NEXT: dead $x0 = PseudoVSETIVLI 2, 216 /* e64, m1, ta, ma */, implicit-def $vl, implicit-def $vtype
286 ; CHECK-NEXT: [[PseudoVLE64_V_M1_:%[0-9]+]]:vr = PseudoVLE64_V_M1 undef $noreg, [[COPY1]], 2, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype :: (load (s128) from %ir.x)
287 ; CHECK-NEXT: [[PseudoVLE64_V_M1_1:%[0-9]+]]:vr = PseudoVLE64_V_M1 undef $noreg, [[COPY]], 2, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype :: (load (s128) from %ir.y)
288 ; CHECK-NEXT: [[PseudoVADD_VV_M1_:%[0-9]+]]:vr = PseudoVADD_VV_M1 undef $noreg, [[PseudoVLE64_V_M1_]], [[PseudoVLE64_V_M1_1]], 2, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
289 ; CHECK-NEXT: PseudoVSE64_V_M1 [[PseudoVADD_VV_M1_]], [[COPY1]], 2, 6 /* e64 */, implicit $vl, implicit $vtype :: (store (s128) into %ir.x)
290 ; CHECK-NEXT: PseudoRET
293 %2:vr = PseudoVLE64_V_M1 undef $noreg, %0, 2, 6, 0 :: (load (s128) from %ir.x)
294 %3:vr = PseudoVLE64_V_M1 undef $noreg, %1, 2, 6, 0 :: (load (s128) from %ir.y)
295 %4:vr = PseudoVADD_VV_M1 undef $noreg, killed %2, killed %3, 2, 6, 0
296 PseudoVSE64_V_M1 killed %4, %0, 2, 6 :: (store (s128) into %ir.x)
301 name: vreduce_add_v2i64
303 tracksRegLiveness: true
305 - { id: 0, class: gpr }
306 - { id: 1, class: vr }
307 - { id: 2, class: vr }
308 - { id: 3, class: vr }
309 - { id: 4, class: vr }
310 - { id: 5, class: gpr }
312 - { reg: '$x10', virtual-reg: '%0' }
315 machineFunctionInfo: {}
320 ; CHECK-LABEL: name: vreduce_add_v2i64
321 ; CHECK: liveins: $x10
323 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
324 ; CHECK-NEXT: dead $x0 = PseudoVSETIVLI 2, 216 /* e64, m1, ta, ma */, implicit-def $vl, implicit-def $vtype
325 ; CHECK-NEXT: [[PseudoVLE64_V_M1_:%[0-9]+]]:vr = PseudoVLE64_V_M1 undef $noreg, [[COPY]], 2, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype :: (load (s128) from %ir.x)
326 ; CHECK-NEXT: dead [[PseudoVSETVLIX0_:%[0-9]+]]:gpr = PseudoVSETVLIX0 killed $x0, 216 /* e64, m1, ta, ma */, implicit-def $vl, implicit-def $vtype
327 ; CHECK-NEXT: [[PseudoVMV_V_I_M1_:%[0-9]+]]:vr = PseudoVMV_V_I_M1 undef $noreg, 0, -1, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
328 ; CHECK-NEXT: dead $x0 = PseudoVSETIVLI 2, 216 /* e64, m1, ta, ma */, implicit-def $vl, implicit-def $vtype
329 ; CHECK-NEXT: [[PseudoVREDSUM_VS_M1_E8_:%[0-9]+]]:vr = PseudoVREDSUM_VS_M1_E8 undef $noreg, [[PseudoVLE64_V_M1_]], [[PseudoVMV_V_I_M1_]], 2, 6 /* e64 */, 1 /* ta, mu */, implicit $vl, implicit $vtype
330 ; CHECK-NEXT: [[PseudoVMV_X_S:%[0-9]+]]:gpr = PseudoVMV_X_S [[PseudoVREDSUM_VS_M1_E8_]], 6 /* e64 */, implicit $vtype
331 ; CHECK-NEXT: $x10 = COPY [[PseudoVMV_X_S]]
332 ; CHECK-NEXT: PseudoRET implicit $x10
334 %1:vr = PseudoVLE64_V_M1 undef $noreg, %0, 2, 6, 0 :: (load (s128) from %ir.x)
335 %2:vr = PseudoVMV_V_I_M1 undef $noreg, 0, -1, 6, 0
336 %3:vr = PseudoVREDSUM_VS_M1_E8 undef $noreg, killed %1, killed %2, 2, 6, 1
337 %5:gpr = PseudoVMV_X_S killed %3, 6
339 PseudoRET implicit $x10
345 tracksRegLiveness: true
347 - { id: 0, class: vr }
348 - { id: 1, class: vr }
349 - { id: 2, class: gprnox0 }
350 - { id: 3, class: gprnox0 }
351 - { id: 4, class: vr }
353 - { reg: '$v8', virtual-reg: '%0' }
354 - { reg: '$v9', virtual-reg: '%1' }
355 - { reg: '$x10', virtual-reg: '%2' }
358 machineFunctionInfo: {}
361 liveins: $v8, $v9, $x10
363 ; CHECK-LABEL: name: vsetvli_add
364 ; CHECK: liveins: $v8, $v9, $x10
366 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprnox0 = COPY $x10
367 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vr = COPY $v9
368 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vr = COPY $v8
369 ; CHECK-NEXT: dead [[PseudoVSETVLI:%[0-9]+]]:gprnox0 = PseudoVSETVLI [[COPY]], 88 /* e64, m1, ta, mu */, implicit-def $vl, implicit-def $vtype
370 ; CHECK-NEXT: [[PseudoVADD_VV_M1_:%[0-9]+]]:vr = PseudoVADD_VV_M1 undef $noreg, [[COPY2]], [[COPY1]], $noreg, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
371 ; CHECK-NEXT: $v8 = COPY [[PseudoVADD_VV_M1_]]
372 ; CHECK-NEXT: PseudoRET implicit $v8
373 %2:gprnox0 = COPY $x10
376 %3:gprnox0 = PseudoVSETVLI %2, 88, implicit-def dead $vl, implicit-def dead $vtype
377 %4:vr = PseudoVADD_VV_M1 undef $noreg, %0, %1, killed %3, 6, 0
379 PseudoRET implicit $v8
383 name: load_add_inlineasm
385 tracksRegLiveness: true
387 - { id: 0, class: gpr }
388 - { id: 1, class: vr }
389 - { id: 2, class: gprnox0 }
390 - { id: 3, class: vr }
391 - { id: 4, class: vr }
393 - { reg: '$x10', virtual-reg: '%0' }
394 - { reg: '$v8', virtual-reg: '%1' }
395 - { reg: '$x11', virtual-reg: '%2' }
398 machineFunctionInfo: {}
401 liveins: $x10, $v8, $x11
403 ; CHECK-LABEL: name: load_add_inlineasm
404 ; CHECK: liveins: $x10, $v8, $x11
406 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprnox0 = COPY $x11
407 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vr = COPY $v8
408 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x10
409 ; CHECK-NEXT: dead $x0 = PseudoVSETVLI [[COPY]], 216 /* e64, m1, ta, ma */, implicit-def $vl, implicit-def $vtype
410 ; CHECK-NEXT: [[PseudoVLE64_V_M1_:%[0-9]+]]:vr = PseudoVLE64_V_M1 undef $noreg, [[COPY2]], $noreg, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
411 ; CHECK-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */
412 ; CHECK-NEXT: dead $x0 = PseudoVSETVLI [[COPY]], 216 /* e64, m1, ta, ma */, implicit-def $vl, implicit-def $vtype
413 ; CHECK-NEXT: [[PseudoVADD_VV_M1_:%[0-9]+]]:vr = PseudoVADD_VV_M1 undef $noreg, [[PseudoVLE64_V_M1_]], [[COPY1]], $noreg, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
414 ; CHECK-NEXT: $v8 = COPY [[PseudoVADD_VV_M1_]]
415 ; CHECK-NEXT: PseudoRET implicit $v8
416 %2:gprnox0 = COPY $x11
419 %3:vr = PseudoVLE64_V_M1 undef $noreg, %0, %2, 6, 0
420 INLINEASM &"", 1 /* sideeffect attdialect */
421 %4:vr = PseudoVADD_VV_M1 undef $noreg, killed %3, %1, %2, 6, 0
423 PseudoRET implicit $v8
427 name: vmv_v_i_different_lmuls
428 tracksRegLiveness: true
431 liveins: $x10, $v8, $x11
433 ; CHECK-LABEL: name: vmv_v_i_different_lmuls
434 ; CHECK: liveins: $x10, $v8, $x11
436 ; CHECK-NEXT: dead $x0 = PseudoVSETIVLI 4, 217 /* e64, m2, ta, ma */, implicit-def $vl, implicit-def $vtype
437 ; CHECK-NEXT: dead [[PseudoVID_V_M2_:%[0-9]+]]:vrm2 = PseudoVID_V_M2 undef $noreg, 4, 6 /* e64 */, 3 /* ta, ma */, implicit $vl, implicit $vtype
438 ; CHECK-NEXT: dead $x0 = PseudoVSETVLIX0 killed $x0, 198 /* e8, mf4, ta, ma */, implicit-def $vl, implicit-def $vtype, implicit $vl
439 ; CHECK-NEXT: dead [[PseudoVMV_V_I_MF4_:%[0-9]+]]:vr = PseudoVMV_V_I_MF4 undef $noreg, 0, 4, 3 /* e8 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
440 ; CHECK-NEXT: PseudoRET
441 %0:vrm2 = PseudoVID_V_M2 undef $noreg, 4, 6, 3
442 %4:vr = PseudoVMV_V_I_MF4 undef $noreg, 0, 4, 3, 0
446 # make sure we don't try to perform PRE when one of the blocks is sew/lmul ratio
448 name: pre_same_sewlmul_ratio
449 tracksRegLiveness: true
451 ; CHECK-LABEL: name: pre_same_sewlmul_ratio
453 ; CHECK-NEXT: successors: %bb.2(0x40000000), %bb.1(0x40000000)
454 ; CHECK-NEXT: liveins: $x10
456 ; CHECK-NEXT: %cond:gpr = COPY $x10
457 ; CHECK-NEXT: dead $x0 = PseudoVSETIVLI 2, 215 /* e32, mf2, ta, ma */, implicit-def $vl, implicit-def $vtype
458 ; CHECK-NEXT: dead [[PseudoVMV_V_I_MF2_:%[0-9]+]]:vr = PseudoVMV_V_I_MF2 undef $noreg, 1, 2, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
459 ; CHECK-NEXT: BEQ %cond, $x0, %bb.2
462 ; CHECK-NEXT: successors: %bb.2(0x80000000)
464 ; CHECK-NEXT: dead $x0 = PseudoVSETVLIX0 killed $x0, 216 /* e64, m1, ta, ma */, implicit-def $vl, implicit-def $vtype, implicit $vl
465 ; CHECK-NEXT: dead [[PseudoVMV_V_I_M1_:%[0-9]+]]:vr = PseudoVMV_V_I_M1 undef $noreg, 1, 2, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
468 ; CHECK-NEXT: successors: %bb.4(0x40000000), %bb.3(0x40000000)
470 ; CHECK-NEXT: BEQ %cond, $x0, %bb.4
473 ; CHECK-NEXT: successors: %bb.4(0x80000000)
475 ; CHECK-NEXT: PseudoCALL $noreg, csr_ilp32_lp64
478 ; CHECK-NEXT: $x0 = PseudoVSETIVLI 2, 215 /* e32, mf2, ta, ma */, implicit-def $vl, implicit-def $vtype
479 ; CHECK-NEXT: dead [[PseudoVMV_X_S:%[0-9]+]]:gpr = PseudoVMV_X_S undef $noreg, 5 /* e32 */, implicit $vtype
480 ; CHECK-NEXT: dead [[PseudoVMV_V_I_MF2_1:%[0-9]+]]:vr = PseudoVMV_V_I_MF2 undef $noreg, 1, 2, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
481 ; CHECK-NEXT: PseudoRET
484 %cond:gpr = COPY $x10
485 %1:vr = PseudoVMV_V_I_MF2 undef $noreg, 1, 2, 5, 0
486 BEQ %cond, $x0, %bb.2
488 %2:vr = PseudoVMV_V_I_M1 undef $noreg, 1, 2, 6, 0
489 bb.2: ; the exit info here should have sew/lmul ratio only
490 BEQ %cond, $x0, %bb.4
492 PseudoCALL $noreg, csr_ilp32_lp64
493 bb.4: ; this block will have PRE attempted on it
494 %4:gpr = PseudoVMV_X_S undef $noreg, 5
495 %5:vr = PseudoVMV_V_I_MF2 undef $noreg, 1, 2, 5, 0
499 name: postpass_modify_vl
500 tracksRegLiveness: true
504 ; CHECK-LABEL: name: postpass_modify_vl
505 ; CHECK: liveins: $x1
507 ; CHECK-NEXT: dead $x0 = PseudoVSETIVLI 3, 216 /* e64, m1, ta, ma */, implicit-def $vl, implicit-def $vtype
508 ; CHECK-NEXT: dead [[COPY:%[0-9]+]]:gpr = COPY $vtype
509 ; CHECK-NEXT: $vl = COPY $x1
510 ; CHECK-NEXT: dead $x0 = PseudoVSETIVLI 3, 216 /* e64, m1, ta, ma */, implicit-def $vl, implicit-def $vtype
511 ; CHECK-NEXT: dead [[PseudoVADD_VV_M1_:%[0-9]+]]:vr = PseudoVADD_VV_M1 undef $noreg, undef $noreg, undef $noreg, 3, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
512 ; CHECK-NEXT: PseudoRET
513 dead $x0 = PseudoVSETIVLI 3, 216, implicit-def $vl, implicit-def $vtype
516 dead $x0 = PseudoVSETIVLI 3, 216, implicit-def $vl, implicit-def $vtype
517 %4:vr = PseudoVADD_VV_M1 undef $noreg, undef $noreg, undef $noreg, 3, 6, 0
521 name: coalesce_dead_avl_addi
522 tracksRegLiveness: true
525 ; CHECK-LABEL: name: coalesce_dead_avl_addi
526 ; CHECK: $x0 = PseudoVSETIVLI 3, 216 /* e64, m1, ta, ma */, implicit-def $vl, implicit-def $vtype
527 ; CHECK-NEXT: dead %x:gpr = PseudoVMV_X_S $noreg, 6 /* e64 */, implicit $vtype
528 ; CHECK-NEXT: $v0 = PseudoVADD_VV_M1 $noreg, $noreg, $noreg, 3, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
529 ; CHECK-NEXT: PseudoRET
530 %avl:gprnox0 = ADDI $x0, 42
531 dead $x0 = PseudoVSETVLI killed %avl, 216, implicit-def $vl, implicit-def $vtype
532 %x:gpr = PseudoVMV_X_S $noreg, 6
533 dead $x0 = PseudoVSETIVLI 3, 216, implicit-def $vl, implicit-def $vtype
534 $v0 = PseudoVADD_VV_M1 $noreg, $noreg, $noreg, 3, 6, 0
538 name: coalesce_dead_avl_nonvolatile_load
539 tracksRegLiveness: true
543 ; CHECK-LABEL: name: coalesce_dead_avl_nonvolatile_load
544 ; CHECK: liveins: $x1
546 ; CHECK-NEXT: %ptr:gpr = COPY $x1
547 ; CHECK-NEXT: dead %avl:gprnox0 = LW %ptr, 0 :: (dereferenceable load (s32))
548 ; CHECK-NEXT: $x0 = PseudoVSETIVLI 3, 216 /* e64, m1, ta, ma */, implicit-def $vl, implicit-def $vtype
549 ; CHECK-NEXT: dead %x:gpr = PseudoVMV_X_S $noreg, 6 /* e64 */, implicit $vtype
550 ; CHECK-NEXT: $v0 = PseudoVADD_VV_M1 $noreg, $noreg, $noreg, 3, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
551 ; CHECK-NEXT: PseudoRET
553 %avl:gprnox0 = LW killed %ptr, 0 :: (dereferenceable load (s32))
554 dead $x0 = PseudoVSETVLI killed %avl, 216, implicit-def $vl, implicit-def $vtype
555 %x:gpr = PseudoVMV_X_S $noreg, 6
556 dead $x0 = PseudoVSETIVLI 3, 216, implicit-def $vl, implicit-def $vtype
557 $v0 = PseudoVADD_VV_M1 $noreg, $noreg, $noreg, 3, 6, 0
561 name: coalesce_dead_avl_volatile_load
562 tracksRegLiveness: true
566 ; CHECK-LABEL: name: coalesce_dead_avl_volatile_load
567 ; CHECK: liveins: $x1
569 ; CHECK-NEXT: %ptr:gpr = COPY $x1
570 ; CHECK-NEXT: dead %avl:gprnox0 = LW %ptr, 0 :: (volatile dereferenceable load (s32))
571 ; CHECK-NEXT: $x0 = PseudoVSETIVLI 3, 216 /* e64, m1, ta, ma */, implicit-def $vl, implicit-def $vtype
572 ; CHECK-NEXT: dead %x:gpr = PseudoVMV_X_S $noreg, 6 /* e64 */, implicit $vtype
573 ; CHECK-NEXT: $v0 = PseudoVADD_VV_M1 $noreg, $noreg, $noreg, 3, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
574 ; CHECK-NEXT: PseudoRET
576 %avl:gprnox0 = LW killed %ptr, 0 :: (volatile dereferenceable load (s32))
577 dead $x0 = PseudoVSETVLI killed %avl, 216, implicit-def $vl, implicit-def $vtype
578 %x:gpr = PseudoVMV_X_S $noreg, 6
579 dead $x0 = PseudoVSETIVLI 3, 216, implicit-def $vl, implicit-def $vtype
580 $v0 = PseudoVADD_VV_M1 $noreg, $noreg, $noreg, 3, 6, 0
584 name: coalesce_shrink_removed_vsetvlis_uses
585 tracksRegLiveness: true
589 ; CHECK-LABEL: name: coalesce_shrink_removed_vsetvlis_uses
590 ; CHECK: liveins: $x10, $v8
592 ; CHECK-NEXT: %avl2:gprnox0 = ADDI $x0, 2
593 ; CHECK-NEXT: dead $x0 = PseudoVSETVLI %avl2, 209 /* e32, m2, ta, ma */, implicit-def $vl, implicit-def $vtype
594 ; CHECK-NEXT: %x:gpr = COPY $x10
595 ; CHECK-NEXT: renamable $v8 = PseudoVMV_S_X undef renamable $v8, %x, 1, 5 /* e32 */, implicit $vl, implicit $vtype
596 ; CHECK-NEXT: PseudoRET implicit $v8
597 %avl1:gprnox0 = ADDI $x0, 1
598 dead $x0 = PseudoVSETVLI %avl1:gprnox0, 209, implicit-def dead $vl, implicit-def dead $vtype
599 %avl2:gprnox0 = ADDI $x0, 2
600 dead $x0 = PseudoVSETVLI %avl2:gprnox0, 209, implicit-def dead $vl, implicit-def dead $vtype
602 renamable $v8 = PseudoVMV_S_X undef renamable $v8, killed renamable %x, 1, 5
603 PseudoRET implicit $v8