From cb806510914ed909b934d285062a9efb13b1cea4 Mon Sep 17 00:00:00 2001 From: Jim Lin Date: Tue, 1 Jul 2025 14:13:30 +0800 Subject: [PATCH] [RISCV] Merge AllBFloatVectors into AllFloatVectors. NFC. --- .../Target/RISCV/RISCVInstrInfoVPseudos.td | 31 ++----------------- .../Target/RISCV/RISCVInstrInfoVSDPatterns.td | 2 +- .../Target/RISCV/RISCVInstrInfoVVLPatterns.td | 6 ++-- 3 files changed, 7 insertions(+), 32 deletions(-) diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td b/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td index 9fecd4794fad..442a19be0fd1 100644 --- a/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td @@ -351,10 +351,13 @@ defset list AllVectors = { def VF16MF4: VTypeInfo; def VF16MF2: VTypeInfo; def VF32MF2: VTypeInfo; + def VBF16MF4: VTypeInfo; + def VBF16MF2: VTypeInfo; } def VF16M1: VTypeInfo; def VF32M1: VTypeInfo; def VF64M1: VTypeInfo; + def VBF16M1: VTypeInfo; } defset list GroupFloatVectors = { @@ -378,19 +381,7 @@ defset list AllVectors = { V_M4, f64, FPR64>; def VF64M8: GroupVTypeInfo; - } - } - defset list AllBFloatVectors = { - defset list NoGroupBFloatVectors = { - defset list FractionalGroupBFloatVectors = { - def VBF16MF4: VTypeInfo; - def VBF16MF2: VTypeInfo; - } - def VBF16M1: VTypeInfo; - } - - defset list GroupBFloatVectors = { def VBF16M2: GroupVTypeInfo; def VBF16M4: GroupVTypeInfo; } -foreach vti = AllBFloatVectors in - let Predicates = [HasVInstructionsBF16Minimal] in - defm : VPatBinaryCarryInTAIL<"int_riscv_vmerge", "PseudoVMERGE", "VVM", - vti.Vector, - vti.Vector, vti.Vector, vti.Mask, - vti.Log2SEW, vti.LMul, vti.RegClass, - vti.RegClass, vti.RegClass>; - foreach fvti = AllFloatVectors in { defvar instr = !cast("PseudoVMERGE_VIM_"#fvti.LMul.MX); let Predicates = GetVTypePredicates.Predicates in @@ -7418,9 +7401,6 @@ defm : VPatTernaryV_VX_VI<"int_riscv_vslidedown", "PseudoVSLIDEDOWN", AllFloatVe defm : VPatBinaryV_VX<"int_riscv_vfslide1up", "PseudoVFSLIDE1UP", AllFloatVectors>; defm : VPatBinaryV_VX<"int_riscv_vfslide1down", "PseudoVFSLIDE1DOWN", AllFloatVectors>; -defm : VPatTernaryV_VX_VI<"int_riscv_vslideup", "PseudoVSLIDEUP", AllBFloatVectors, uimm5>; -defm : VPatTernaryV_VX_VI<"int_riscv_vslidedown", "PseudoVSLIDEDOWN", AllBFloatVectors, uimm5>; - //===----------------------------------------------------------------------===// // 16.4. Vector Register Gather Instructions //===----------------------------------------------------------------------===// @@ -7431,18 +7411,13 @@ defm : VPatBinaryV_VV_INT_EEW<"int_riscv_vrgatherei16_vv", "PseudoVRGATHEREI16", defm : VPatBinaryV_VV_VX_VI_INT<"int_riscv_vrgather", "PseudoVRGATHER", AllFloatVectors, uimm5>; -defm : VPatBinaryV_VV_VX_VI_INT<"int_riscv_vrgather", "PseudoVRGATHER", - AllBFloatVectors, uimm5>; defm : VPatBinaryV_VV_INT_EEW<"int_riscv_vrgatherei16_vv", "PseudoVRGATHEREI16", eew=16, vtilist=AllFloatVectors>; -defm : VPatBinaryV_VV_INT_EEW<"int_riscv_vrgatherei16_vv", "PseudoVRGATHEREI16", - eew=16, vtilist=AllBFloatVectors>; //===----------------------------------------------------------------------===// // 16.5. Vector Compress Instruction //===----------------------------------------------------------------------===// defm : VPatUnaryV_V_AnyMask<"int_riscv_vcompress", "PseudoVCOMPRESS", AllIntegerVectors>; defm : VPatUnaryV_V_AnyMask<"int_riscv_vcompress", "PseudoVCOMPRESS", AllFloatVectors>; -defm : VPatUnaryV_V_AnyMask<"int_riscv_vcompress", "PseudoVCOMPRESS", AllBFloatVectors>; // Include the non-intrinsic ISel patterns include "RISCVInstrInfoVVLPatterns.td" diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td b/llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td index 520959b0896f..b9b7ee4674ae 100644 --- a/llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td @@ -1390,7 +1390,7 @@ defm : VPatFPSetCCSDNode_VV_VF_FV; // Floating-point vselects: // 11.15. Vector Integer Merge Instructions // 13.15. Vector Floating-Point Merge Instruction -foreach fvti = !listconcat(AllFloatVectors, AllBFloatVectors) in { +foreach fvti = AllFloatVectors in { defvar ivti = GetIntVTypeInfo.Vti; let Predicates = GetVTypePredicates.Predicates in { def : Pat<(fvti.Vector (vselect (fvti.Mask VMV0:$vm), fvti.RegClass:$rs1, diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td b/llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td index 6328e6c860f7..1f598863c8d0 100644 --- a/llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td @@ -2580,7 +2580,7 @@ foreach vti = AllFloatVectors in { } } -foreach fvti = !listconcat(AllFloatVectors, AllBFloatVectors) in { +foreach fvti = AllFloatVectors in { // Floating-point vselects: // 11.15. Vector Integer Merge Instructions // 13.15. Vector Floating-Point Merge Instruction @@ -2630,7 +2630,7 @@ foreach fvti = AllFloatVectors in { } } -foreach fvti = !listconcat(AllFloatVectors, AllBFloatVectors) in { +foreach fvti = AllFloatVectors in { defvar ivti = GetIntVTypeInfo.Vti; let Predicates = GetVTypePredicates.Predicates in { // 13.16. Vector Floating-Point Move Instruction @@ -2954,7 +2954,7 @@ foreach vti = NoGroupFloatVectors in { } } -foreach vti = !listconcat(AllFloatVectors, AllBFloatVectors) in { +foreach vti = AllFloatVectors in { defvar ivti = GetIntVTypeInfo.Vti; let Predicates = GetVTypePredicates.Predicates in { def : Pat<(vti.Vector