Skip to content

Conversation

@topperc
Copy link
Collaborator

@topperc topperc commented Oct 18, 2025

These patterns already exist in our other V extension files using AllFloatAndBF16Vectors without Zvfbfmin predicate. Which is good because we need them for Zvfbfa without depending on Zvfbfmin.

…ions.

These patterns already exist in our other V extension files using
AllFloatAndBF16Vectors without Zvfbfmin predicate. Which is good
because we need them for Zvfbfa.
@llvmbot
Copy link
Member

llvmbot commented Oct 18, 2025

@llvm/pr-subscribers-backend-risc-v

Author: Craig Topper (topperc)

Changes

These patterns already exist in our other V extension files using AllFloatAndBF16Vectors without Zvfbfmin predicate. Which is good because we need them for Zvfbfa.


Full diff: https://github.com/llvm/llvm-project/pull/164110.diff

1 Files Affected:

  • (modified) llvm/lib/Target/RISCV/RISCVInstrInfoZvfbf.td (-54)
diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoZvfbf.td b/llvm/lib/Target/RISCV/RISCVInstrInfoZvfbf.td
index 9358486c13da2..45e97800ce3ab 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoZvfbf.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoZvfbf.td
@@ -439,20 +439,7 @@ let Predicates = [HasStdExtZvfbfmin] in {
                   fvti.AVL, fvti.Log2SEW, TA_MA)>;
   }
 
-  defm : VPatUnaryV_V_AnyMask<"int_riscv_vcompress", "PseudoVCOMPRESS", AllBF16Vectors>;
-  defm : VPatBinaryV_VV_VX_VI_INT<"int_riscv_vrgather", "PseudoVRGATHER",
-                                  AllBF16Vectors, uimm5>;
-  defm : VPatBinaryV_VV_INT_EEW<"int_riscv_vrgatherei16_vv", "PseudoVRGATHEREI16",
-                                eew=16, vtilist=AllBF16Vectors>;
-  defm : VPatTernaryV_VX_VI<"int_riscv_vslideup", "PseudoVSLIDEUP", AllBF16Vectors, uimm5>;
-  defm : VPatTernaryV_VX_VI<"int_riscv_vslidedown", "PseudoVSLIDEDOWN", AllBF16Vectors, uimm5>;
-
   foreach fvti = AllBF16Vectors in {
-    defm : VPatBinaryCarryInTAIL<"int_riscv_vmerge", "PseudoVMERGE", "VVM",
-                                 fvti.Vector,
-                                 fvti.Vector, fvti.Vector, fvti.Mask,
-                                 fvti.Log2SEW, fvti.LMul, fvti.RegClass,
-                                 fvti.RegClass, fvti.RegClass>;
     defm : VPatBinaryCarryInTAIL<"int_riscv_vfmerge", "PseudoVFMERGE",
                                  "V"#fvti.ScalarSuffix#"M",
                                  fvti.Vector,
@@ -468,12 +455,6 @@ let Predicates = [HasStdExtZvfbfmin] in {
                      (fvti.Mask VMV0:$vm), GPR:$vl, fvti.Log2SEW)>;
 
     defvar ivti = GetIntVTypeInfo<fvti>.Vti;
-    def : Pat<(fvti.Vector (vselect (fvti.Mask VMV0:$vm), fvti.RegClass:$rs1,
-                                                          fvti.RegClass:$rs2)),
-              (!cast<Instruction>("PseudoVMERGE_VVM_"#fvti.LMul.MX)
-                   (fvti.Vector (IMPLICIT_DEF)),
-                   fvti.RegClass:$rs2, fvti.RegClass:$rs1, (fvti.Mask VMV0:$vm),
-                   fvti.AVL, fvti.Log2SEW)>;
 
     def : Pat<(fvti.Vector (vselect (fvti.Mask VMV0:$vm),
                                     (SplatFPOp (SelectScalarFPAsInt (XLenVT GPR:$imm))),
@@ -498,15 +479,6 @@ let Predicates = [HasStdExtZvfbfmin] in {
                    (fvti.Scalar fvti.ScalarRegClass:$rs1),
                    (fvti.Mask VMV0:$vm), fvti.AVL, fvti.Log2SEW)>;
 
-    def : Pat<(fvti.Vector (riscv_vmerge_vl (fvti.Mask VMV0:$vm),
-                                            fvti.RegClass:$rs1,
-                                            fvti.RegClass:$rs2,
-                                            fvti.RegClass:$passthru,
-                                            VLOpFrag)),
-              (!cast<Instruction>("PseudoVMERGE_VVM_"#fvti.LMul.MX)
-                   fvti.RegClass:$passthru, fvti.RegClass:$rs2, fvti.RegClass:$rs1, (fvti.Mask VMV0:$vm),
-                   GPR:$vl, fvti.Log2SEW)>;
-
     def : Pat<(fvti.Vector (riscv_vmerge_vl (fvti.Mask VMV0:$vm),
                                             (SplatFPOp (SelectScalarFPAsInt (XLenVT GPR:$imm))),
                                             fvti.RegClass:$rs2,
@@ -535,32 +507,6 @@ let Predicates = [HasStdExtZvfbfmin] in {
                    fvti.RegClass:$passthru, fvti.RegClass:$rs2,
                    (fvti.Scalar fvti.ScalarRegClass:$rs1),
                    (fvti.Mask VMV0:$vm), GPR:$vl, fvti.Log2SEW)>;
-
-    def : Pat<(fvti.Vector
-               (riscv_vrgather_vv_vl fvti.RegClass:$rs2,
-                                     (ivti.Vector fvti.RegClass:$rs1),
-                                     fvti.RegClass:$passthru,
-                                     (fvti.Mask VMV0:$vm),
-                                     VLOpFrag)),
-              (!cast<Instruction>("PseudoVRGATHER_VV_"# fvti.LMul.MX#"_E"# fvti.SEW#"_MASK")
-                   fvti.RegClass:$passthru, fvti.RegClass:$rs2, fvti.RegClass:$rs1,
-                   (fvti.Mask VMV0:$vm), GPR:$vl, fvti.Log2SEW, TAIL_AGNOSTIC)>;
-    def : Pat<(fvti.Vector (riscv_vrgather_vx_vl fvti.RegClass:$rs2, GPR:$rs1,
-                                                fvti.RegClass:$passthru,
-                                                (fvti.Mask VMV0:$vm),
-                                                VLOpFrag)),
-              (!cast<Instruction>("PseudoVRGATHER_VX_"# fvti.LMul.MX#"_MASK")
-                   fvti.RegClass:$passthru, fvti.RegClass:$rs2, GPR:$rs1,
-                   (fvti.Mask VMV0:$vm), GPR:$vl, fvti.Log2SEW, TAIL_AGNOSTIC)>;
-    def : Pat<(fvti.Vector
-               (riscv_vrgather_vx_vl fvti.RegClass:$rs2,
-                                     uimm5:$imm,
-                                     fvti.RegClass:$passthru,
-                                     (fvti.Mask VMV0:$vm),
-                                     VLOpFrag)),
-              (!cast<Instruction>("PseudoVRGATHER_VI_"# fvti.LMul.MX#"_MASK")
-                   fvti.RegClass:$passthru, fvti.RegClass:$rs2, uimm5:$imm,
-                   (fvti.Mask VMV0:$vm), GPR:$vl, fvti.Log2SEW, TAIL_AGNOSTIC)>;
   }
 }
 

Copy link
Member

@4vtomat 4vtomat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, that makes sense to me~

@topperc topperc enabled auto-merge (squash) October 19, 2025 16:32
@topperc topperc merged commit 6762cfe into llvm:main Oct 19, 2025
9 of 10 checks passed
@topperc topperc deleted the pr/duplicate-patterns branch October 19, 2025 23:34
Lukacma pushed a commit to Lukacma/llvm-project that referenced this pull request Oct 29, 2025
…ions. (llvm#164110)

These patterns already exist in our other V extension files using
AllFloatAndBF16Vectors without Zvfbfmin predicate. Which is good because
we need them for Zvfbfa without depending on Zvfbfmin.
aokblast pushed a commit to aokblast/llvm-project that referenced this pull request Oct 30, 2025
…ions. (llvm#164110)

These patterns already exist in our other V extension files using
AllFloatAndBF16Vectors without Zvfbfmin predicate. Which is good because
we need them for Zvfbfa without depending on Zvfbfmin.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants