Skip to content

Commit 1fc72db

Browse files
committed
[RISCV] Add test for doLocalPostpass issue not checking if VL was modified. NFC
1 parent 20d653f commit 1fc72db

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

llvm/test/CodeGen/RISCV/rvv/vsetvli-insert.mir

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@
7676
ret void
7777
}
7878

79+
define void @postpass_modify_vl() {
80+
ret void
81+
}
82+
7983
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
8084

8185
declare <vscale x 1 x i64> @llvm.riscv.vle.nxv1i64.i64(<vscale x 1 x i64>, ptr nocapture, i64) #4
@@ -503,3 +507,24 @@ body: |
503507
%5:vr = PseudoVMV_V_I_MF2 $noreg, 1, 2, 5, 0
504508
PseudoRET
505509
...
510+
---
511+
name: postpass_modify_vl
512+
tracksRegLiveness: true
513+
body: |
514+
bb.0:
515+
liveins: $x1
516+
; CHECK-LABEL: name: postpass_modify_vl
517+
; CHECK: liveins: $x1
518+
; CHECK-NEXT: {{ $}}
519+
; CHECK-NEXT: $x0 = PseudoVSETIVLI 3, 216 /* e64, m1, ta, ma */, implicit-def $vl, implicit-def $vtype
520+
; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $vtype
521+
; CHECK-NEXT: $vl = COPY $x1
522+
; CHECK-NEXT: [[PseudoVADD_VV_M1_:%[0-9]+]]:vr = PseudoVADD_VV_M1 $noreg, $noreg, $noreg, 3, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
523+
; CHECK-NEXT: PseudoRET
524+
dead $x0 = PseudoVSETIVLI 3, 216, implicit-def $vl, implicit-def $vtype
525+
%1:gpr = COPY $vtype
526+
$vl = COPY $x1
527+
dead $x0 = PseudoVSETIVLI 3, 216, implicit-def $vl, implicit-def $vtype
528+
%4:vr = PseudoVADD_VV_M1 $noreg, $noreg, $noreg, 3, 6, 0
529+
PseudoRET
530+
...

0 commit comments

Comments
 (0)