Skip to content

Commit f83d5d2

Browse files
committed
[RISCV] Remove vfmerge.vf patterns with bf16 types.
These patterns are no longer used because we don't generate bf16 to vector splats except for constants that can be handled with vmerge.vi.
1 parent b954462 commit f83d5d2

File tree

3 files changed

+6
-20
lines changed

3 files changed

+6
-20
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -382,17 +382,6 @@ class GetIntVTypeInfo<VTypeInfo vti> {
382382
!cast<string>(vti))));
383383
}
384384

385-
// This functor is used to obtain the fp vector type that has the same SEW and
386-
// multiplier as the input parameter type.
387-
class GetFpVTypeInfo<VTypeInfo vti> {
388-
// Equivalent integer vector type. Eg.
389-
// VF16M1 → VF16M1 (identity)
390-
// VBF16M1 → VF16M1
391-
VTypeInfo Vti = !cast<VTypeInfo>(!subst("VBF", "VF",
392-
!subst("VI", "VF",
393-
!cast<string>(vti))));
394-
}
395-
396385
class MTypeInfo<ValueType Mas, LMULInfo M, string Bx> {
397386
ValueType Mask = Mas;
398387
// {SEW, VLMul} values set a valid VType to deal with this mask type.
@@ -769,11 +758,6 @@ class GetVTypePredicates<VTypeInfo vti> {
769758
true : [HasVInstructions]);
770759
}
771760

772-
class GetVTypeScalarPredicates<VTypeInfo vti> {
773-
list<Predicate> Predicates = !cond(!eq(vti.Scalar, bf16) : [HasStdExtZfbfmin],
774-
true : []);
775-
}
776-
777761
class VPseudoUSLoadNoMask<VReg RetClass,
778762
int EEW> :
779763
Pseudo<(outs RetClass:$rd),

llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,9 +1412,10 @@ foreach fvti = !listconcat(AllFloatVectors, AllBFloatVectors) in {
14121412
fvti.RegClass:$rs2, 0, (fvti.Mask V0), fvti.AVL, fvti.Log2SEW)>;
14131413

14141414
}
1415+
}
14151416

1416-
let Predicates = !listconcat(GetVTypePredicates<GetFpVTypeInfo<fvti>.Vti>.Predicates,
1417-
GetVTypeScalarPredicates<fvti>.Predicates) in
1417+
foreach fvti = AllFloatVectors in {
1418+
let Predicates = GetVTypePredicates<fvti>.Predicates in
14181419
def : Pat<(fvti.Vector (vselect (fvti.Mask V0),
14191420
(SplatFPOp fvti.ScalarRegClass:$rs1),
14201421
fvti.RegClass:$rs2)),

llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2638,9 +2638,10 @@ foreach fvti = !listconcat(AllFloatVectors, AllBFloatVectors) in {
26382638
fvti.RegClass:$merge, fvti.RegClass:$rs2, 0, (fvti.Mask V0),
26392639
GPR:$vl, fvti.Log2SEW)>;
26402640
}
2641+
}
26412642

2642-
let Predicates = !listconcat(GetVTypePredicates<GetFpVTypeInfo<fvti>.Vti>.Predicates,
2643-
GetVTypeScalarPredicates<fvti>.Predicates) in {
2643+
foreach fvti = AllFloatVectors in {
2644+
let Predicates = GetVTypePredicates<fvti>.Predicates in {
26442645
def : Pat<(fvti.Vector (riscv_vmerge_vl (fvti.Mask V0),
26452646
(SplatFPOp fvti.ScalarRegClass:$rs1),
26462647
fvti.RegClass:$rs2,

0 commit comments

Comments
 (0)