Skip to content

Commit 532d4bf

Browse files
committed
[RISCV] Move riscv_vfmv_v_f_vl patterns to RISCVInstrInfoVVLPatterns.td for consistency with riscv_vmv_v_x_vl. NFC
1 parent 4220a81 commit 532d4bf

File tree

2 files changed

+25
-27
lines changed

2 files changed

+25
-27
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@
1414
///
1515
//===----------------------------------------------------------------------===//
1616

17-
def riscv_vmv_v_x_vl : SDNode<"RISCVISD::VMV_V_X_VL",
18-
SDTypeProfile<1, 2, [SDTCisVec<0>, SDTCisInt<0>,
19-
SDTCisVT<1, XLenVT>,
20-
SDTCisVT<2, XLenVT>]>>;
21-
def riscv_vfmv_v_f_vl : SDNode<"RISCVISD::VFMV_V_F_VL",
22-
SDTypeProfile<1, 2, [SDTCisVec<0>, SDTCisFP<0>,
23-
SDTCisEltOfVec<1, 0>,
24-
SDTCisVT<2, XLenVT>]>>;
25-
2617
def riscv_vmv_x_s : SDNode<"RISCVISD::VMV_X_S",
2718
SDTypeProfile<1, 1, [SDTCisInt<0>, SDTCisVec<1>,
2819
SDTCisInt<1>]>>;
@@ -4205,24 +4196,6 @@ foreach fvti = AllFloatVectors in {
42054196
(instr fvti.RegClass:$rs2, 0, (fvti.Mask V0), GPR:$vl, fvti.SEW)>;
42064197
}
42074198

4208-
//===----------------------------------------------------------------------===//
4209-
// 14.16. Vector Floating-Point Move Instruction
4210-
//===----------------------------------------------------------------------===//
4211-
foreach fvti = AllFloatVectors in {
4212-
// If we're splatting fpimm0, use vmv.v.x vd, x0.
4213-
def : Pat<(fvti.Vector (riscv_vfmv_v_f_vl
4214-
(fvti.Scalar (fpimm0)), (XLenVT (VLOp GPR:$vl)))),
4215-
(!cast<Instruction>("PseudoVMV_V_I_"#fvti.LMul.MX)
4216-
0, GPR:$vl, fvti.SEW)>;
4217-
4218-
def : Pat<(fvti.Vector (riscv_vfmv_v_f_vl
4219-
(fvti.Scalar fvti.ScalarRegClass:$rs2), (XLenVT (VLOp GPR:$vl)))),
4220-
(!cast<Instruction>("PseudoVFMV_V_" # fvti.ScalarSuffix # "_" #
4221-
fvti.LMul.MX)
4222-
(fvti.Scalar fvti.ScalarRegClass:$rs2),
4223-
GPR:$vl, fvti.SEW)>;
4224-
}
4225-
42264199
//===----------------------------------------------------------------------===//
42274200
// 14.17. Single-Width Floating-Point/Integer Type-Convert Instructions
42284201
//===----------------------------------------------------------------------===//

llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ def SDT_RISCVFPBinOp_VL : SDTypeProfile<1, 4, [SDTCisSameAs<0, 1>,
4646
SDTCisSameNumEltsAs<0, 3>,
4747
SDTCisVT<4, XLenVT>]>;
4848

49+
def riscv_vmv_v_x_vl : SDNode<"RISCVISD::VMV_V_X_VL",
50+
SDTypeProfile<1, 2, [SDTCisVec<0>, SDTCisInt<0>,
51+
SDTCisVT<1, XLenVT>,
52+
SDTCisVT<2, XLenVT>]>>;
53+
def riscv_vfmv_v_f_vl : SDNode<"RISCVISD::VFMV_V_F_VL",
54+
SDTypeProfile<1, 2, [SDTCisVec<0>, SDTCisFP<0>,
55+
SDTCisEltOfVec<1, 0>,
56+
SDTCisVT<2, XLenVT>]>>;
57+
4958
def riscv_vle_vl : SDNode<"RISCVISD::VLE_VL", SDT_RISCVVLE_VL,
5059
[SDNPHasChain, SDNPMayLoad, SDNPMemOperand]>;
5160
def riscv_vse_vl : SDNode<"RISCVISD::VSE_VL", SDT_RISCVVSE_VL,
@@ -461,6 +470,22 @@ foreach vti = AllFloatVectors in {
461470
vti.RegClass:$rs, vti.RegClass:$rs, GPR:$vl, vti.SEW)>;
462471
}
463472

473+
// 14.16. Vector Floating-Point Move Instruction
474+
foreach fvti = AllFloatVectors in {
475+
// If we're splatting fpimm0, use vmv.v.x vd, x0.
476+
def : Pat<(fvti.Vector (riscv_vfmv_v_f_vl
477+
(fvti.Scalar (fpimm0)), (XLenVT (VLOp GPR:$vl)))),
478+
(!cast<Instruction>("PseudoVMV_V_I_"#fvti.LMul.MX)
479+
0, GPR:$vl, fvti.SEW)>;
480+
481+
def : Pat<(fvti.Vector (riscv_vfmv_v_f_vl
482+
(fvti.Scalar fvti.ScalarRegClass:$rs2), (XLenVT (VLOp GPR:$vl)))),
483+
(!cast<Instruction>("PseudoVFMV_V_" # fvti.ScalarSuffix # "_" #
484+
fvti.LMul.MX)
485+
(fvti.Scalar fvti.ScalarRegClass:$rs2),
486+
GPR:$vl, fvti.SEW)>;
487+
}
488+
464489
} // Predicates = [HasStdExtV, HasStdExtF]
465490

466491
// 16.1 Vector Mask-Register Logical Instructions

0 commit comments

Comments
 (0)