1 ; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 ; RUN: llc -mtriple=riscv64 -mattr=+v -stop-after=finalize-isel -target-abi=lp64 < %s | FileCheck %s
4 declare { <vscale x 8 x i8>, i64 } @llvm.riscv.vleff.nxv8i8(<vscale x 8 x i8>, <vscale x 8 x i8>*, i64)
5 declare { <vscale x 8 x i8>, i64 } @llvm.riscv.vleff.mask.nxv8i8.i64(<vscale x 8 x i8>, <vscale x 8 x i8>*, <vscale x 8 x i1>, i64, i64 immarg)
7 declare {<vscale x 8 x i8>,<vscale x 8 x i8>, i64} @llvm.riscv.vlseg2ff.nxv8i8(<vscale x 8 x i8>, <vscale x 8 x i8>, i8* , i64)
8 declare {<vscale x 8 x i8>,<vscale x 8 x i8>, i64} @llvm.riscv.vlseg2ff.mask.nxv8i8(<vscale x 8 x i8>,<vscale x 8 x i8>, i8*, <vscale x 8 x i1>, i64, i64)
10 define i64 @test_vleff_nxv8i8(<vscale x 8 x i8> *%p, i64 %vl) {
11 ; CHECK-LABEL: name: test_vleff_nxv8i8
13 ; CHECK-NEXT: liveins: $x10, $x11
15 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprnox0 = COPY $x11
16 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x10
17 ; CHECK-NEXT: [[PseudoVLE8FF_V_M1_:%[0-9]+]]:vr, [[PseudoVLE8FF_V_M1_1:%[0-9]+]]:gpr = PseudoVLE8FF_V_M1 $noreg, [[COPY1]], [[COPY]], 3 /* e8 */, 2 /* tu, ma */, implicit-def dead $vl :: (load unknown-size from %ir.p, align 1)
18 ; CHECK-NEXT: $x10 = COPY [[PseudoVLE8FF_V_M1_1]]
19 ; CHECK-NEXT: PseudoRET implicit $x10
21 %0 = call { <vscale x 8 x i8>, i64 } @llvm.riscv.vleff.nxv8i8(<vscale x 8 x i8> undef, <vscale x 8 x i8>* %p, i64 %vl)
22 %1 = extractvalue { <vscale x 8 x i8>, i64 } %0, 1
26 define i64 @test_vleff_nxv8i8_tu(<vscale x 8 x i8> %merge, <vscale x 8 x i8> *%p, i64 %vl) {
27 ; CHECK-LABEL: name: test_vleff_nxv8i8_tu
29 ; CHECK-NEXT: liveins: $v8, $x10, $x11
31 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprnox0 = COPY $x11
32 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x10
33 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vr = COPY $v8
34 ; CHECK-NEXT: [[PseudoVLE8FF_V_M1_:%[0-9]+]]:vr, [[PseudoVLE8FF_V_M1_1:%[0-9]+]]:gpr = PseudoVLE8FF_V_M1 [[COPY2]], [[COPY1]], [[COPY]], 3 /* e8 */, 2 /* tu, ma */, implicit-def dead $vl :: (load unknown-size from %ir.p, align 1)
35 ; CHECK-NEXT: $x10 = COPY [[PseudoVLE8FF_V_M1_1]]
36 ; CHECK-NEXT: PseudoRET implicit $x10
38 %0 = call { <vscale x 8 x i8>, i64 } @llvm.riscv.vleff.nxv8i8(<vscale x 8 x i8> %merge, <vscale x 8 x i8>* %p, i64 %vl)
39 %1 = extractvalue { <vscale x 8 x i8>, i64 } %0, 1
43 define i64 @test_vleff_nxv8i8_mask(<vscale x 8 x i8> %maskedoff, <vscale x 8 x i8> *%p, <vscale x 8 x i1> %m, i64 %vl) {
44 ; CHECK-LABEL: name: test_vleff_nxv8i8_mask
46 ; CHECK-NEXT: liveins: $v8, $x10, $v0, $x11
48 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprnox0 = COPY $x11
49 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vr = COPY $v0
50 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x10
51 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:vrnov0 = COPY $v8
52 ; CHECK-NEXT: $v0 = COPY [[COPY1]]
53 ; CHECK-NEXT: [[PseudoVLE8FF_V_M1_MASK:%[0-9]+]]:vrnov0, [[PseudoVLE8FF_V_M1_MASK1:%[0-9]+]]:gpr = PseudoVLE8FF_V_M1_MASK [[COPY3]], [[COPY2]], $v0, [[COPY]], 3 /* e8 */, 0 /* tu, mu */, implicit-def dead $vl :: (load unknown-size from %ir.p, align 1)
54 ; CHECK-NEXT: $x10 = COPY [[PseudoVLE8FF_V_M1_MASK1]]
55 ; CHECK-NEXT: PseudoRET implicit $x10
57 %0 = call { <vscale x 8 x i8>, i64 } @llvm.riscv.vleff.mask.nxv8i8.i64(<vscale x 8 x i8> %maskedoff, <vscale x 8 x i8> *%p, <vscale x 8 x i1> %m, i64 %vl, i64 0)
58 %1 = extractvalue { <vscale x 8 x i8>, i64 } %0, 1
62 define i64 @test_vlseg2ff_nxv8i8(i8* %base, i64 %vl, i64* %outvl) {
63 ; CHECK-LABEL: name: test_vlseg2ff_nxv8i8
65 ; CHECK-NEXT: liveins: $x10, $x11
67 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprnox0 = COPY $x11
68 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x10
69 ; CHECK-NEXT: [[DEF:%[0-9]+]]:vr = IMPLICIT_DEF
70 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:vr = IMPLICIT_DEF
71 ; CHECK-NEXT: [[DEF2:%[0-9]+]]:vr = IMPLICIT_DEF
72 ; CHECK-NEXT: [[DEF3:%[0-9]+]]:vr = IMPLICIT_DEF
73 ; CHECK-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vrn2m1 = REG_SEQUENCE [[DEF]], %subreg.sub_vrm1_0, [[DEF2]], %subreg.sub_vrm1_1
74 ; CHECK-NEXT: [[PseudoVLSEG2E8FF_V_M1_:%[0-9]+]]:vrn2m1, [[PseudoVLSEG2E8FF_V_M1_1:%[0-9]+]]:gpr = PseudoVLSEG2E8FF_V_M1 [[REG_SEQUENCE]], [[COPY1]], [[COPY]], 3 /* e8 */, 2 /* tu, ma */, implicit-def dead $vl :: (load unknown-size from %ir.base, align 1)
75 ; CHECK-NEXT: $x10 = COPY [[PseudoVLSEG2E8FF_V_M1_1]]
76 ; CHECK-NEXT: PseudoRET implicit $x10
78 %0 = tail call {<vscale x 8 x i8>,<vscale x 8 x i8>, i64} @llvm.riscv.vlseg2ff.nxv8i8(<vscale x 8 x i8> undef, <vscale x 8 x i8> undef, i8* %base, i64 %vl)
79 %1 = extractvalue {<vscale x 8 x i8>,<vscale x 8 x i8>, i64} %0, 2
83 define i64 @test_vlseg2ff_nxv8i8_tu(<vscale x 8 x i8> %val, i8* %base, i64 %vl, i64* %outvl) {
84 ; CHECK-LABEL: name: test_vlseg2ff_nxv8i8_tu
86 ; CHECK-NEXT: liveins: $v8, $x10, $x11
88 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprnox0 = COPY $x11
89 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x10
90 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vr = COPY $v8
91 ; CHECK-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vrn2m1 = REG_SEQUENCE [[COPY2]], %subreg.sub_vrm1_0, [[COPY2]], %subreg.sub_vrm1_1
92 ; CHECK-NEXT: [[PseudoVLSEG2E8FF_V_M1_:%[0-9]+]]:vrn2m1, [[PseudoVLSEG2E8FF_V_M1_1:%[0-9]+]]:gpr = PseudoVLSEG2E8FF_V_M1 [[REG_SEQUENCE]], [[COPY1]], [[COPY]], 3 /* e8 */, 2 /* tu, ma */, implicit-def dead $vl :: (load unknown-size from %ir.base, align 1)
93 ; CHECK-NEXT: $x10 = COPY [[PseudoVLSEG2E8FF_V_M1_1]]
94 ; CHECK-NEXT: PseudoRET implicit $x10
96 %0 = tail call {<vscale x 8 x i8>,<vscale x 8 x i8>, i64} @llvm.riscv.vlseg2ff.nxv8i8(<vscale x 8 x i8> %val, <vscale x 8 x i8> %val, i8* %base, i64 %vl)
97 %1 = extractvalue {<vscale x 8 x i8>,<vscale x 8 x i8>, i64} %0, 2
101 define i64 @test_vlseg2ff_nxv8i8_mask(<vscale x 8 x i8> %val, i8* %base, <vscale x 8 x i1> %mask, i64 %vl, i64* %outvl) {
102 ; CHECK-LABEL: name: test_vlseg2ff_nxv8i8_mask
104 ; CHECK-NEXT: liveins: $v8, $x10, $v0, $x11
106 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprnox0 = COPY $x11
107 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vr = COPY $v0
108 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x10
109 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:vr = COPY $v8
110 ; CHECK-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vrn2m1nov0 = REG_SEQUENCE [[COPY3]], %subreg.sub_vrm1_0, [[COPY3]], %subreg.sub_vrm1_1
111 ; CHECK-NEXT: $v0 = COPY [[COPY1]]
112 ; CHECK-NEXT: [[PseudoVLSEG2E8FF_V_M1_MASK:%[0-9]+]]:vrn2m1nov0, [[PseudoVLSEG2E8FF_V_M1_MASK1:%[0-9]+]]:gpr = PseudoVLSEG2E8FF_V_M1_MASK [[REG_SEQUENCE]], [[COPY2]], $v0, [[COPY]], 3 /* e8 */, 0 /* tu, mu */, implicit-def dead $vl :: (load unknown-size from %ir.base, align 1)
113 ; CHECK-NEXT: $x10 = COPY [[PseudoVLSEG2E8FF_V_M1_MASK1]]
114 ; CHECK-NEXT: PseudoRET implicit $x10
116 %0 = tail call {<vscale x 8 x i8>,<vscale x 8 x i8>, i64} @llvm.riscv.vlseg2ff.mask.nxv8i8(<vscale x 8 x i8> %val, <vscale x 8 x i8> %val, i8* %base, <vscale x 8 x i1> %mask, i64 %vl, i64 0)
117 %1 = extractvalue {<vscale x 8 x i8>,<vscale x 8 x i8>, i64} %0, 2