diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td b/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td index a206974e53e510..45a57d1170814c 100644 --- a/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td @@ -382,17 +382,6 @@ class GetIntVTypeInfo { !cast(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 { - // Equivalent integer vector type. Eg. - // VF16M1 → VF16M1 (identity) - // VBF16M1 → VF16M1 - VTypeInfo Vti = !cast(!subst("VBF", "VF", - !subst("VI", "VF", - !cast(vti)))); -} - class MTypeInfo { ValueType Mask = Mas; // {SEW, VLMul} values set a valid VType to deal with this mask type. @@ -769,11 +758,6 @@ class GetVTypePredicates { true : [HasVInstructions]); } -class GetVTypeScalarPredicates { - list Predicates = !cond(!eq(vti.Scalar, bf16) : [HasStdExtZfbfmin], - true : []); -} - class VPseudoUSLoadNoMask : Pseudo<(outs RetClass:$rd), diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td b/llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td index 9042fe610a39fc..3489c62b2c5c1e 100644 --- a/llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td @@ -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.Vti>.Predicates, - GetVTypeScalarPredicates.Predicates) in +foreach fvti = AllFloatVectors in { + let Predicates = GetVTypePredicates.Predicates in def : Pat<(fvti.Vector (vselect (fvti.Mask V0), (SplatFPOp fvti.ScalarRegClass:$rs1), fvti.RegClass:$rs2)), diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td b/llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td index 440b8963dfe3fd..372f2c5bbf9f18 100644 --- a/llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td @@ -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.Vti>.Predicates, - GetVTypeScalarPredicates.Predicates) in { +foreach fvti = AllFloatVectors in { + let Predicates = GetVTypePredicates.Predicates in { def : Pat<(fvti.Vector (riscv_vmerge_vl (fvti.Mask V0), (SplatFPOp fvti.ScalarRegClass:$rs1), fvti.RegClass:$rs2,