[llvm] 532d4bf - [RISCV] Move riscv_vfmv_v_f_vl patterns to RISCVInstrInfoVVLPatterns.td for consistency with riscv_vmv_v_x_vl. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 12 16:11:57 PST 2021
Author: Craig Topper
Date: 2021-02-12T16:08:27-08:00
New Revision: 532d4bf025442cb1357789bf6d9941bb9c5219c6
URL: https://github.com/llvm/llvm-project/commit/532d4bf025442cb1357789bf6d9941bb9c5219c6
DIFF: https://github.com/llvm/llvm-project/commit/532d4bf025442cb1357789bf6d9941bb9c5219c6.diff
LOG: [RISCV] Move riscv_vfmv_v_f_vl patterns to RISCVInstrInfoVVLPatterns.td for consistency with riscv_vmv_v_x_vl. NFC
Added:
Modified:
llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
Removed:
################################################################################
diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td b/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
index e3e83923284e..90a3633cc04a 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
@@ -14,15 +14,6 @@
///
//===----------------------------------------------------------------------===//
-def riscv_vmv_v_x_vl : SDNode<"RISCVISD::VMV_V_X_VL",
- SDTypeProfile<1, 2, [SDTCisVec<0>, SDTCisInt<0>,
- SDTCisVT<1, XLenVT>,
- SDTCisVT<2, XLenVT>]>>;
-def riscv_vfmv_v_f_vl : SDNode<"RISCVISD::VFMV_V_F_VL",
- SDTypeProfile<1, 2, [SDTCisVec<0>, SDTCisFP<0>,
- SDTCisEltOfVec<1, 0>,
- SDTCisVT<2, XLenVT>]>>;
-
def riscv_vmv_x_s : SDNode<"RISCVISD::VMV_X_S",
SDTypeProfile<1, 1, [SDTCisInt<0>, SDTCisVec<1>,
SDTCisInt<1>]>>;
@@ -4205,24 +4196,6 @@ foreach fvti = AllFloatVectors in {
(instr fvti.RegClass:$rs2, 0, (fvti.Mask V0), GPR:$vl, fvti.SEW)>;
}
-//===----------------------------------------------------------------------===//
-// 14.16. Vector Floating-Point Move Instruction
-//===----------------------------------------------------------------------===//
-foreach fvti = AllFloatVectors in {
- // If we're splatting fpimm0, use vmv.v.x vd, x0.
- def : Pat<(fvti.Vector (riscv_vfmv_v_f_vl
- (fvti.Scalar (fpimm0)), (XLenVT (VLOp GPR:$vl)))),
- (!cast<Instruction>("PseudoVMV_V_I_"#fvti.LMul.MX)
- 0, GPR:$vl, fvti.SEW)>;
-
- def : Pat<(fvti.Vector (riscv_vfmv_v_f_vl
- (fvti.Scalar fvti.ScalarRegClass:$rs2), (XLenVT (VLOp GPR:$vl)))),
- (!cast<Instruction>("PseudoVFMV_V_" # fvti.ScalarSuffix # "_" #
- fvti.LMul.MX)
- (fvti.Scalar fvti.ScalarRegClass:$rs2),
- GPR:$vl, fvti.SEW)>;
-}
-
//===----------------------------------------------------------------------===//
// 14.17. Single-Width Floating-Point/Integer Type-Convert Instructions
//===----------------------------------------------------------------------===//
diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td b/llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
index 1ac477054e98..1ddd8af76148 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
@@ -46,6 +46,15 @@ def SDT_RISCVFPBinOp_VL : SDTypeProfile<1, 4, [SDTCisSameAs<0, 1>,
SDTCisSameNumEltsAs<0, 3>,
SDTCisVT<4, XLenVT>]>;
+def riscv_vmv_v_x_vl : SDNode<"RISCVISD::VMV_V_X_VL",
+ SDTypeProfile<1, 2, [SDTCisVec<0>, SDTCisInt<0>,
+ SDTCisVT<1, XLenVT>,
+ SDTCisVT<2, XLenVT>]>>;
+def riscv_vfmv_v_f_vl : SDNode<"RISCVISD::VFMV_V_F_VL",
+ SDTypeProfile<1, 2, [SDTCisVec<0>, SDTCisFP<0>,
+ SDTCisEltOfVec<1, 0>,
+ SDTCisVT<2, XLenVT>]>>;
+
def riscv_vle_vl : SDNode<"RISCVISD::VLE_VL", SDT_RISCVVLE_VL,
[SDNPHasChain, SDNPMayLoad, SDNPMemOperand]>;
def riscv_vse_vl : SDNode<"RISCVISD::VSE_VL", SDT_RISCVVSE_VL,
@@ -461,6 +470,22 @@ foreach vti = AllFloatVectors in {
vti.RegClass:$rs, vti.RegClass:$rs, GPR:$vl, vti.SEW)>;
}
+// 14.16. Vector Floating-Point Move Instruction
+foreach fvti = AllFloatVectors in {
+ // If we're splatting fpimm0, use vmv.v.x vd, x0.
+ def : Pat<(fvti.Vector (riscv_vfmv_v_f_vl
+ (fvti.Scalar (fpimm0)), (XLenVT (VLOp GPR:$vl)))),
+ (!cast<Instruction>("PseudoVMV_V_I_"#fvti.LMul.MX)
+ 0, GPR:$vl, fvti.SEW)>;
+
+ def : Pat<(fvti.Vector (riscv_vfmv_v_f_vl
+ (fvti.Scalar fvti.ScalarRegClass:$rs2), (XLenVT (VLOp GPR:$vl)))),
+ (!cast<Instruction>("PseudoVFMV_V_" # fvti.ScalarSuffix # "_" #
+ fvti.LMul.MX)
+ (fvti.Scalar fvti.ScalarRegClass:$rs2),
+ GPR:$vl, fvti.SEW)>;
+}
+
} // Predicates = [HasStdExtV, HasStdExtF]
// 16.1 Vector Mask-Register Logical Instructions
More information about the llvm-commits
mailing list