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>, ptr, i64)
5 declare { <vscale x 8 x i8>, i64 } @llvm.riscv.vleff.mask.nxv8i8.i64(<vscale x 8 x i8>, ptr, <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>, ptr , 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>, ptr, <vscale x 8 x i1>, i64, i64)
10 define i64 @test_vleff_nxv8i8(ptr %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, ptr %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, ptr %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, ptr %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, ptr %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, ptr %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(ptr %base, i64 %vl, ptr %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: [[PseudoVLSEG2E8FF_V_M1_:%[0-9]+]]:vrn2m1, [[PseudoVLSEG2E8FF_V_M1_1:%[0-9]+]]:gpr = PseudoVLSEG2E8FF_V_M1 $noreg, [[COPY1]], [[COPY]], 3 /* e8 */, 2 /* tu, ma */, implicit-def dead $vl :: (load unknown-size from %ir.base, align 1)
70 ; CHECK-NEXT: $x10 = COPY [[PseudoVLSEG2E8FF_V_M1_1]]
71 ; CHECK-NEXT: PseudoRET implicit $x10
73 %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, ptr %base, i64 %vl)
74 %1 = extractvalue {<vscale x 8 x i8>,<vscale x 8 x i8>, i64} %0, 2
78 define i64 @test_vlseg2ff_nxv8i8_tu(<vscale x 8 x i8> %val, ptr %base, i64 %vl, ptr %outvl) {
79 ; CHECK-LABEL: name: test_vlseg2ff_nxv8i8_tu
81 ; CHECK-NEXT: liveins: $v8, $x10, $x11
83 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprnox0 = COPY $x11
84 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x10
85 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vr = COPY $v8
86 ; CHECK-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vrn2m1 = REG_SEQUENCE [[COPY2]], %subreg.sub_vrm1_0, [[COPY2]], %subreg.sub_vrm1_1
87 ; 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)
88 ; CHECK-NEXT: $x10 = COPY [[PseudoVLSEG2E8FF_V_M1_1]]
89 ; CHECK-NEXT: PseudoRET implicit $x10
91 %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, ptr %base, i64 %vl)
92 %1 = extractvalue {<vscale x 8 x i8>,<vscale x 8 x i8>, i64} %0, 2
96 define i64 @test_vlseg2ff_nxv8i8_mask(<vscale x 8 x i8> %val, ptr %base, <vscale x 8 x i1> %mask, i64 %vl, ptr %outvl) {
97 ; CHECK-LABEL: name: test_vlseg2ff_nxv8i8_mask
99 ; CHECK-NEXT: liveins: $v8, $x10, $v0, $x11
101 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprnox0 = COPY $x11
102 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vr = COPY $v0
103 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x10
104 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:vr = COPY $v8
105 ; CHECK-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vrn2m1nov0 = REG_SEQUENCE [[COPY3]], %subreg.sub_vrm1_0, [[COPY3]], %subreg.sub_vrm1_1
106 ; CHECK-NEXT: $v0 = COPY [[COPY1]]
107 ; 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)
108 ; CHECK-NEXT: $x10 = COPY [[PseudoVLSEG2E8FF_V_M1_MASK1]]
109 ; CHECK-NEXT: PseudoRET implicit $x10
111 %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, ptr %base, <vscale x 8 x i1> %mask, i64 %vl, i64 0)
112 %1 = extractvalue {<vscale x 8 x i8>,<vscale x 8 x i8>, i64} %0, 2