Skip to content

Commit

Permalink
[RISCV] Remove vfmerge.vf patterns with bf16 types.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
topperc committed Jun 14, 2024
1 parent b954462 commit f83d5d2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
16 changes: 0 additions & 16 deletions llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
Original file line number Diff line number Diff line change
Expand Up @@ -382,17 +382,6 @@ class GetIntVTypeInfo<VTypeInfo vti> {
!cast<string>(vti))));
}

// This functor is used to obtain the fp vector type that has the same SEW and
// multiplier as the input parameter type.
class GetFpVTypeInfo<VTypeInfo vti> {
// Equivalent integer vector type. Eg.
// VF16M1 → VF16M1 (identity)
// VBF16M1 → VF16M1
VTypeInfo Vti = !cast<VTypeInfo>(!subst("VBF", "VF",
!subst("VI", "VF",
!cast<string>(vti))));
}

class MTypeInfo<ValueType Mas, LMULInfo M, string Bx> {
ValueType Mask = Mas;
// {SEW, VLMul} values set a valid VType to deal with this mask type.
Expand Down Expand Up @@ -769,11 +758,6 @@ class GetVTypePredicates<VTypeInfo vti> {
true : [HasVInstructions]);
}

class GetVTypeScalarPredicates<VTypeInfo vti> {
list<Predicate> Predicates = !cond(!eq(vti.Scalar, bf16) : [HasStdExtZfbfmin],
true : []);
}

class VPseudoUSLoadNoMask<VReg RetClass,
int EEW> :
Pseudo<(outs RetClass:$rd),
Expand Down
5 changes: 3 additions & 2 deletions llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td
Original file line number Diff line number Diff line change
Expand Up @@ -1412,9 +1412,10 @@ foreach fvti = !listconcat(AllFloatVectors, AllBFloatVectors) in {
fvti.RegClass:$rs2, 0, (fvti.Mask V0), fvti.AVL, fvti.Log2SEW)>;

}
}

let Predicates = !listconcat(GetVTypePredicates<GetFpVTypeInfo<fvti>.Vti>.Predicates,
GetVTypeScalarPredicates<fvti>.Predicates) in
foreach fvti = AllFloatVectors in {
let Predicates = GetVTypePredicates<fvti>.Predicates in
def : Pat<(fvti.Vector (vselect (fvti.Mask V0),
(SplatFPOp fvti.ScalarRegClass:$rs1),
fvti.RegClass:$rs2)),
Expand Down
5 changes: 3 additions & 2 deletions llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
Original file line number Diff line number Diff line change
Expand Up @@ -2638,9 +2638,10 @@ foreach fvti = !listconcat(AllFloatVectors, AllBFloatVectors) in {
fvti.RegClass:$merge, fvti.RegClass:$rs2, 0, (fvti.Mask V0),
GPR:$vl, fvti.Log2SEW)>;
}
}

let Predicates = !listconcat(GetVTypePredicates<GetFpVTypeInfo<fvti>.Vti>.Predicates,
GetVTypeScalarPredicates<fvti>.Predicates) in {
foreach fvti = AllFloatVectors in {
let Predicates = GetVTypePredicates<fvti>.Predicates in {
def : Pat<(fvti.Vector (riscv_vmerge_vl (fvti.Mask V0),
(SplatFPOp fvti.ScalarRegClass:$rs1),
fvti.RegClass:$rs2,
Expand Down

0 comments on commit f83d5d2

Please sign in to comment.