Skip to content

Commit ae439a6

Browse files
committed
Added MIR test
1 parent c1b6e12 commit ae439a6

File tree

1 file changed

+90
-0
lines changed

1 file changed

+90
-0
lines changed

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

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,24 @@
6868
ret <vscale x 1 x i64> %b
6969
}
7070

71+
define i64 @vsetvli_vleff() {
72+
entry:
73+
br label %while.cond
74+
75+
while.cond: ; preds = %while.body, %entry
76+
%new_vl.0 = phi i64 [ 0, %entry ], [ %1, %while.body ]
77+
%cmp = icmp eq i64 %new_vl.0, 0
78+
br i1 %cmp, label %while.body, label %while.end
79+
80+
while.body: ; preds = %while.cond
81+
%0 = tail call { <vscale x 4 x i16>, i64 } @llvm.riscv.vleff.nxv4i16.i64(<vscale x 4 x i16> zeroinitializer, ptr null, i64 0)
82+
%1 = extractvalue { <vscale x 4 x i16>, i64 } %0, 1
83+
br label %while.cond
84+
85+
while.end: ; preds = %while.cond
86+
ret i64 0
87+
}
88+
7189
define void @vmv_v_i_different_lmuls() {
7290
ret void
7391
}
@@ -622,3 +640,75 @@ body: |
622640
dead $x0 = PseudoVSETIVLI 1, 208, implicit-def $vl, implicit-def $vtype
623641
%v:vr = COPY $v8, implicit $vtype
624642
%x = PseudoVSETVLI %x, 208, implicit-def $vl, implicit-def $vtype
643+
...
644+
---
645+
name: vsetvli_vleff
646+
alignment: 4
647+
tracksRegLiveness: true
648+
registers:
649+
- { id: 0, class: gpr, preferred-register: '' }
650+
- { id: 1, class: gpr, preferred-register: '' }
651+
- { id: 2, class: gpr, preferred-register: '' }
652+
- { id: 3, class: gpr, preferred-register: '' }
653+
- { id: 4, class: gpr, preferred-register: '' }
654+
- { id: 5, class: vr, preferred-register: '%7' }
655+
- { id: 6, class: gpr, preferred-register: '' }
656+
- { id: 7, class: vr, preferred-register: '%5' }
657+
- { id: 8, class: vr, preferred-register: '' }
658+
- { id: 9, class: gpr, preferred-register: '' }
659+
frameInfo:
660+
maxAlignment: 1
661+
machineFunctionInfo: {}
662+
body: |
663+
; CHECK-LABEL: name: vsetvli_vleff
664+
; CHECK: bb.0.entry:
665+
; CHECK-NEXT: successors: %bb.1(0x80000000)
666+
; CHECK-NEXT: {{ $}}
667+
; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x0
668+
; CHECK-NEXT: dead [[PseudoVSETVLIX0_:%[0-9]+]]:gprnox0 = PseudoVSETVLIX0 killed $x0, 200 /* e16, m1, ta, ma */, implicit-def $vl, implicit-def $vtype
669+
; CHECK-NEXT: renamable $v8 = PseudoVMV_V_I_M1 undef renamable $v8, 0, -1, 4 /* e16 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
670+
; CHECK-NEXT: {{ $}}
671+
; CHECK-NEXT: bb.1.while.cond:
672+
; CHECK-NEXT: successors: %bb.2(0x7c000000), %bb.3(0x04000000)
673+
; CHECK-NEXT: liveins: $v8
674+
; CHECK-NEXT: {{ $}}
675+
; CHECK-NEXT: BNE [[COPY]], $x0, %bb.3
676+
; CHECK-NEXT: PseudoBR %bb.2
677+
; CHECK-NEXT: {{ $}}
678+
; CHECK-NEXT: bb.2.while.body:
679+
; CHECK-NEXT: successors: %bb.1(0x80000000)
680+
; CHECK-NEXT: liveins: $v8
681+
; CHECK-NEXT: {{ $}}
682+
; CHECK-NEXT: $x0 = PseudoVSETIVLI 0, 136 /* e16, m1, tu, ma */, implicit-def $vl, implicit-def $vtype
683+
; CHECK-NEXT: renamable $v9 = COPY renamable $v8, implicit $vtype
684+
; CHECK-NEXT: dead renamable $v9, $x0 = PseudoVLE16FF_V_M1 killed renamable $v9, $x0, 0, 4 /* e16 */, 2 /* tu, ma */, implicit-def dead $vl, implicit $vl, implicit $vtype :: (load unknown-size from `ptr null`, align 2)
685+
; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = PseudoReadVL implicit $vl
686+
; CHECK-NEXT: PseudoBR %bb.1
687+
; CHECK-NEXT: {{ $}}
688+
; CHECK-NEXT: bb.3.while.end:
689+
; CHECK-NEXT: $x10 = COPY $x0
690+
; CHECK-NEXT: PseudoRET implicit killed $x10
691+
bb.0.entry:
692+
successors: %bb.1(0x80000000)
693+
694+
%9:gpr = COPY $x0
695+
renamable $v8 = PseudoVMV_V_I_M1 undef renamable $v8, 0, -1, 4 /* e16 */, 0 /* tu, mu */
696+
697+
bb.1.while.cond:
698+
successors: %bb.2(0x7c000000), %bb.3(0x04000000)
699+
liveins: $v8
700+
701+
BNE %9, $x0, %bb.3
702+
PseudoBR %bb.2
703+
704+
bb.2.while.body:
705+
successors: %bb.1(0x80000000)
706+
liveins: $v8
707+
708+
renamable $v9 = COPY renamable $v8
709+
dead renamable $v9, %9:gpr = PseudoVLE16FF_V_M1 killed renamable $v9, $x0, 0, 4 /* e16 */, 2 /* tu, ma */, implicit-def dead $vl :: (load unknown-size from `ptr null`, align 2)
710+
PseudoBR %bb.1
711+
712+
bb.3.while.end:
713+
$x10 = COPY $x0
714+
PseudoRET implicit killed $x10

0 commit comments

Comments
 (0)