diff --git a/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.h b/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.h --- a/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.h +++ b/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.h @@ -65,6 +65,7 @@ bool selectVLOp(SDValue N, SDValue &VL); bool selectVSplat(SDValue N, SDValue &SplatVal); + bool selectVFPSplat(SDValue N, SDValue &SplatVal); bool selectVSplatSimm5(SDValue N, SDValue &SplatVal); bool selectVSplatUimm5(SDValue N, SDValue &SplatVal); bool selectVSplatSimm5Plus1(SDValue N, SDValue &SplatVal); diff --git a/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp b/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp --- a/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp +++ b/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp @@ -1840,6 +1840,14 @@ return true; } +bool RISCVDAGToDAGISel::selectVFPSplat(SDValue N, SDValue &SplatVal) { + if (N.getOpcode() != ISD::SPLAT_VECTOR && + N.getOpcode() != RISCVISD::VFMV_V_F_VL) + return false; + SplatVal = N.getOperand(0); + return true; +} + using ValidateFn = bool (*)(int64_t); static bool selectVSplatSimmHelper(SDValue N, SDValue &SplatVal, diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td b/llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td --- a/llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td @@ -261,6 +261,9 @@ def SplatFPOp : PatFrag<(ops node:$op), (riscv_vfmv_v_f_vl node:$op, srcvalue)>; +def SplatFPPat : ComplexPattern; + def sew8simm5 : ComplexPattern", []>; def sew16simm5 : ComplexPattern", []>; def sew32simm5 : ComplexPattern", []>; @@ -373,7 +376,7 @@ VReg vop_reg_class, RegisterClass scalar_reg_class> : Pat<(result_type (vop (vop_type vop_reg_class:$rs1), - (vop_type (SplatFPOp scalar_reg_class:$rs2)), + (vop_type (SplatFPPat scalar_reg_class:$rs2)), (mask_type true_mask), VLOpFrag)), (!cast(instruction_name#"_"#vlmul.MX) @@ -394,7 +397,7 @@ multiclass VPatBinaryFPVL_R_VF { foreach fvti = AllFloatVectors in - def : Pat<(fvti.Vector (vop (SplatFPOp fvti.ScalarRegClass:$rs2), + def : Pat<(fvti.Vector (vop (SplatFPPat fvti.ScalarRegClass:$rs2), fvti.RegClass:$rs1, (fvti.Mask true_mask), VLOpFrag)), @@ -480,14 +483,14 @@ (!cast(inst_name#"_VV_"#fvti.LMul.MX) fvti.RegClass:$rs1, fvti.RegClass:$rs2, GPR:$vl, fvti.Log2SEW)>; def : Pat<(fvti.Mask (riscv_setcc_vl (fvti.Vector fvti.RegClass:$rs1), - (SplatFPOp fvti.ScalarRegClass:$rs2), + (SplatFPPat fvti.ScalarRegClass:$rs2), cc, (fvti.Mask true_mask), VLOpFrag)), (!cast(inst_name#"_V"#fvti.ScalarSuffix#"_"#fvti.LMul.MX) fvti.RegClass:$rs1, fvti.ScalarRegClass:$rs2, GPR:$vl, fvti.Log2SEW)>; - def : Pat<(fvti.Mask (riscv_setcc_vl (SplatFPOp fvti.ScalarRegClass:$rs2), + def : Pat<(fvti.Mask (riscv_setcc_vl (SplatFPPat fvti.ScalarRegClass:$rs2), (fvti.Vector fvti.RegClass:$rs1), cc, (fvti.Mask true_mask), @@ -1049,14 +1052,14 @@ // The choice of VFMADD here is arbitrary, vfmadd.vf and vfmacc.vf are equally // commutable. - def : Pat<(vti.Vector (riscv_fma_vl (SplatFPOp vti.ScalarRegClass:$rs1), + def : Pat<(vti.Vector (riscv_fma_vl (SplatFPPat vti.ScalarRegClass:$rs1), vti.RegClass:$rd, vti.RegClass:$rs2, (vti.Mask true_mask), VLOpFrag)), (!cast("PseudoVFMADD_V" # vti.ScalarSuffix # "_" # suffix) vti.RegClass:$rd, vti.ScalarRegClass:$rs1, vti.RegClass:$rs2, GPR:$vl, vti.Log2SEW, TAIL_AGNOSTIC)>; - def : Pat<(vti.Vector (riscv_fma_vl (SplatFPOp vti.ScalarRegClass:$rs1), + def : Pat<(vti.Vector (riscv_fma_vl (SplatFPPat vti.ScalarRegClass:$rs1), vti.RegClass:$rd, (riscv_fneg_vl vti.RegClass:$rs2, (vti.Mask true_mask), @@ -1066,7 +1069,7 @@ (!cast("PseudoVFMSUB_V" # vti.ScalarSuffix # "_" # suffix) vti.RegClass:$rd, vti.ScalarRegClass:$rs1, vti.RegClass:$rs2, GPR:$vl, vti.Log2SEW, TAIL_AGNOSTIC)>; - def : Pat<(vti.Vector (riscv_fma_vl (SplatFPOp vti.ScalarRegClass:$rs1), + def : Pat<(vti.Vector (riscv_fma_vl (SplatFPPat vti.ScalarRegClass:$rs1), (riscv_fneg_vl vti.RegClass:$rd, (vti.Mask true_mask), VLOpFrag), @@ -1078,7 +1081,7 @@ (!cast("PseudoVFNMADD_V" # vti.ScalarSuffix # "_" # suffix) vti.RegClass:$rd, vti.ScalarRegClass:$rs1, vti.RegClass:$rs2, GPR:$vl, vti.Log2SEW, TAIL_AGNOSTIC)>; - def : Pat<(vti.Vector (riscv_fma_vl (SplatFPOp vti.ScalarRegClass:$rs1), + def : Pat<(vti.Vector (riscv_fma_vl (SplatFPPat vti.ScalarRegClass:$rs1), (riscv_fneg_vl vti.RegClass:$rd, (vti.Mask true_mask), VLOpFrag), @@ -1090,7 +1093,7 @@ GPR:$vl, vti.Log2SEW, TAIL_AGNOSTIC)>; // The splat might be negated. - def : Pat<(vti.Vector (riscv_fma_vl (riscv_fneg_vl (SplatFPOp vti.ScalarRegClass:$rs1), + def : Pat<(vti.Vector (riscv_fma_vl (riscv_fneg_vl (SplatFPPat vti.ScalarRegClass:$rs1), (vti.Mask true_mask), VLOpFrag), vti.RegClass:$rd, @@ -1102,7 +1105,7 @@ (!cast("PseudoVFNMADD_V" # vti.ScalarSuffix # "_" # suffix) vti.RegClass:$rd, vti.ScalarRegClass:$rs1, vti.RegClass:$rs2, GPR:$vl, vti.Log2SEW, TAIL_AGNOSTIC)>; - def : Pat<(vti.Vector (riscv_fma_vl (riscv_fneg_vl (SplatFPOp vti.ScalarRegClass:$rs1), + def : Pat<(vti.Vector (riscv_fma_vl (riscv_fneg_vl (SplatFPPat vti.ScalarRegClass:$rs1), (vti.Mask true_mask), VLOpFrag), vti.RegClass:$rd, vti.RegClass:$rs2, @@ -1163,7 +1166,7 @@ vti.RegClass:$rs1, vti.RegClass:$rs2, GPR:$vl, vti.Log2SEW)>; def : Pat<(riscv_fcopysign_vl (vti.Vector vti.RegClass:$rs1), - (SplatFPOp vti.ScalarRegClass:$rs2), + (SplatFPPat vti.ScalarRegClass:$rs2), (vti.Mask true_mask), VLOpFrag), (!cast("PseudoVFSGNJ_V"#vti.ScalarSuffix#"_"# vti.LMul.MX) @@ -1183,7 +1186,7 @@ GPR:$vl, fvti.Log2SEW)>; def : Pat<(fvti.Vector (riscv_vselect_vl (fvti.Mask V0), - (SplatFPOp fvti.ScalarRegClass:$rs1), + (SplatFPPat fvti.ScalarRegClass:$rs1), fvti.RegClass:$rs2, VLOpFrag)), (!cast("PseudoVFMERGE_V"#fvti.ScalarSuffix#"M_"#fvti.LMul.MX) diff --git a/llvm/test/CodeGen/RISCV/rvv/vfadd-vp.ll b/llvm/test/CodeGen/RISCV/rvv/vfadd-vp.ll --- a/llvm/test/CodeGen/RISCV/rvv/vfadd-vp.ll +++ b/llvm/test/CodeGen/RISCV/rvv/vfadd-vp.ll @@ -45,10 +45,8 @@ define @vfadd_vf_nxv1f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfadd_vf_nxv1f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, mf4, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, mu -; CHECK-NEXT: vfadd.vv v8, v8, v9 +; CHECK-NEXT: vfadd.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -99,10 +97,8 @@ define @vfadd_vf_nxv2f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfadd_vf_nxv2f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, mf2, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, mu -; CHECK-NEXT: vfadd.vv v8, v8, v9 +; CHECK-NEXT: vfadd.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -153,10 +149,8 @@ define @vfadd_vf_nxv4f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfadd_vf_nxv4f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, m1, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, mu -; CHECK-NEXT: vfadd.vv v8, v8, v9 +; CHECK-NEXT: vfadd.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -207,10 +201,8 @@ define @vfadd_vf_nxv8f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfadd_vf_nxv8f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, mu -; CHECK-NEXT: vfmv.v.f v10, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, mu -; CHECK-NEXT: vfadd.vv v8, v8, v10 +; CHECK-NEXT: vfadd.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -261,10 +253,8 @@ define @vfadd_vf_nxv16f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfadd_vf_nxv16f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, m4, ta, mu -; CHECK-NEXT: vfmv.v.f v12, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, mu -; CHECK-NEXT: vfadd.vv v8, v8, v12 +; CHECK-NEXT: vfadd.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -315,10 +305,8 @@ define @vfadd_vf_nxv32f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfadd_vf_nxv32f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, m8, ta, mu -; CHECK-NEXT: vfmv.v.f v16, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, m8, ta, mu -; CHECK-NEXT: vfadd.vv v8, v8, v16 +; CHECK-NEXT: vfadd.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -369,10 +357,8 @@ define @vfadd_vf_nxv1f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfadd_vf_nxv1f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, mf2, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, mu -; CHECK-NEXT: vfadd.vv v8, v8, v9 +; CHECK-NEXT: vfadd.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -423,10 +409,8 @@ define @vfadd_vf_nxv2f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfadd_vf_nxv2f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, m1, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, mu -; CHECK-NEXT: vfadd.vv v8, v8, v9 +; CHECK-NEXT: vfadd.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -477,10 +461,8 @@ define @vfadd_vf_nxv4f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfadd_vf_nxv4f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, mu -; CHECK-NEXT: vfmv.v.f v10, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, mu -; CHECK-NEXT: vfadd.vv v8, v8, v10 +; CHECK-NEXT: vfadd.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -531,10 +513,8 @@ define @vfadd_vf_nxv8f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfadd_vf_nxv8f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, mu -; CHECK-NEXT: vfmv.v.f v12, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, mu -; CHECK-NEXT: vfadd.vv v8, v8, v12 +; CHECK-NEXT: vfadd.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -585,10 +565,8 @@ define @vfadd_vf_nxv16f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfadd_vf_nxv16f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, m8, ta, mu -; CHECK-NEXT: vfmv.v.f v16, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, mu -; CHECK-NEXT: vfadd.vv v8, v8, v16 +; CHECK-NEXT: vfadd.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -639,10 +617,8 @@ define @vfadd_vf_nxv1f64_unmasked( %va, double %b, i32 zeroext %evl) { ; CHECK-LABEL: vfadd_vf_nxv1f64_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e64, m1, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, mu -; CHECK-NEXT: vfadd.vv v8, v8, v9 +; CHECK-NEXT: vfadd.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, double %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -693,10 +669,8 @@ define @vfadd_vf_nxv2f64_unmasked( %va, double %b, i32 zeroext %evl) { ; CHECK-LABEL: vfadd_vf_nxv2f64_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e64, m2, ta, mu -; CHECK-NEXT: vfmv.v.f v10, fa0 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, mu -; CHECK-NEXT: vfadd.vv v8, v8, v10 +; CHECK-NEXT: vfadd.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, double %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -747,10 +721,8 @@ define @vfadd_vf_nxv4f64_unmasked( %va, double %b, i32 zeroext %evl) { ; CHECK-LABEL: vfadd_vf_nxv4f64_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e64, m4, ta, mu -; CHECK-NEXT: vfmv.v.f v12, fa0 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, mu -; CHECK-NEXT: vfadd.vv v8, v8, v12 +; CHECK-NEXT: vfadd.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, double %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -813,10 +785,8 @@ define @vfadd_vf_nxv8f64_unmasked( %va, double %b, i32 zeroext %evl) { ; CHECK-LABEL: vfadd_vf_nxv8f64_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e64, m8, ta, mu -; CHECK-NEXT: vfmv.v.f v16, fa0 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, mu -; CHECK-NEXT: vfadd.vv v8, v8, v16 +; CHECK-NEXT: vfadd.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, double %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer diff --git a/llvm/test/CodeGen/RISCV/rvv/vfdiv-vp.ll b/llvm/test/CodeGen/RISCV/rvv/vfdiv-vp.ll --- a/llvm/test/CodeGen/RISCV/rvv/vfdiv-vp.ll +++ b/llvm/test/CodeGen/RISCV/rvv/vfdiv-vp.ll @@ -45,10 +45,8 @@ define @vfdiv_vf_nxv1f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfdiv_vf_nxv1f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, mf4, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v8, v9 +; CHECK-NEXT: vfdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -99,10 +97,8 @@ define @vfdiv_vf_nxv2f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfdiv_vf_nxv2f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, mf2, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v8, v9 +; CHECK-NEXT: vfdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -153,10 +149,8 @@ define @vfdiv_vf_nxv4f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfdiv_vf_nxv4f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, m1, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v8, v9 +; CHECK-NEXT: vfdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -207,10 +201,8 @@ define @vfdiv_vf_nxv8f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfdiv_vf_nxv8f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, mu -; CHECK-NEXT: vfmv.v.f v10, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v8, v10 +; CHECK-NEXT: vfdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -261,10 +253,8 @@ define @vfdiv_vf_nxv16f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfdiv_vf_nxv16f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, m4, ta, mu -; CHECK-NEXT: vfmv.v.f v12, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v8, v12 +; CHECK-NEXT: vfdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -315,10 +305,8 @@ define @vfdiv_vf_nxv32f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfdiv_vf_nxv32f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, m8, ta, mu -; CHECK-NEXT: vfmv.v.f v16, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, m8, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v8, v16 +; CHECK-NEXT: vfdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -369,10 +357,8 @@ define @vfdiv_vf_nxv1f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfdiv_vf_nxv1f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, mf2, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v8, v9 +; CHECK-NEXT: vfdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -423,10 +409,8 @@ define @vfdiv_vf_nxv2f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfdiv_vf_nxv2f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, m1, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v8, v9 +; CHECK-NEXT: vfdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -477,10 +461,8 @@ define @vfdiv_vf_nxv4f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfdiv_vf_nxv4f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, mu -; CHECK-NEXT: vfmv.v.f v10, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v8, v10 +; CHECK-NEXT: vfdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -531,10 +513,8 @@ define @vfdiv_vf_nxv8f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfdiv_vf_nxv8f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, mu -; CHECK-NEXT: vfmv.v.f v12, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v8, v12 +; CHECK-NEXT: vfdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -585,10 +565,8 @@ define @vfdiv_vf_nxv16f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfdiv_vf_nxv16f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, m8, ta, mu -; CHECK-NEXT: vfmv.v.f v16, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v8, v16 +; CHECK-NEXT: vfdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -639,10 +617,8 @@ define @vfdiv_vf_nxv1f64_unmasked( %va, double %b, i32 zeroext %evl) { ; CHECK-LABEL: vfdiv_vf_nxv1f64_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e64, m1, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v8, v9 +; CHECK-NEXT: vfdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, double %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -693,10 +669,8 @@ define @vfdiv_vf_nxv2f64_unmasked( %va, double %b, i32 zeroext %evl) { ; CHECK-LABEL: vfdiv_vf_nxv2f64_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e64, m2, ta, mu -; CHECK-NEXT: vfmv.v.f v10, fa0 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v8, v10 +; CHECK-NEXT: vfdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, double %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -747,10 +721,8 @@ define @vfdiv_vf_nxv4f64_unmasked( %va, double %b, i32 zeroext %evl) { ; CHECK-LABEL: vfdiv_vf_nxv4f64_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e64, m4, ta, mu -; CHECK-NEXT: vfmv.v.f v12, fa0 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v8, v12 +; CHECK-NEXT: vfdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, double %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -813,10 +785,8 @@ define @vfdiv_vf_nxv8f64_unmasked( %va, double %b, i32 zeroext %evl) { ; CHECK-LABEL: vfdiv_vf_nxv8f64_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e64, m8, ta, mu -; CHECK-NEXT: vfmv.v.f v16, fa0 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v8, v16 +; CHECK-NEXT: vfdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, double %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer diff --git a/llvm/test/CodeGen/RISCV/rvv/vfmul-vp.ll b/llvm/test/CodeGen/RISCV/rvv/vfmul-vp.ll --- a/llvm/test/CodeGen/RISCV/rvv/vfmul-vp.ll +++ b/llvm/test/CodeGen/RISCV/rvv/vfmul-vp.ll @@ -45,10 +45,8 @@ define @vfmul_vf_nxv1f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfmul_vf_nxv1f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, mf4, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, mu -; CHECK-NEXT: vfmul.vv v8, v8, v9 +; CHECK-NEXT: vfmul.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -99,10 +97,8 @@ define @vfmul_vf_nxv2f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfmul_vf_nxv2f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, mf2, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, mu -; CHECK-NEXT: vfmul.vv v8, v8, v9 +; CHECK-NEXT: vfmul.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -153,10 +149,8 @@ define @vfmul_vf_nxv4f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfmul_vf_nxv4f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, m1, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, mu -; CHECK-NEXT: vfmul.vv v8, v8, v9 +; CHECK-NEXT: vfmul.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -207,10 +201,8 @@ define @vfmul_vf_nxv8f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfmul_vf_nxv8f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, mu -; CHECK-NEXT: vfmv.v.f v10, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, mu -; CHECK-NEXT: vfmul.vv v8, v8, v10 +; CHECK-NEXT: vfmul.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -261,10 +253,8 @@ define @vfmul_vf_nxv16f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfmul_vf_nxv16f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, m4, ta, mu -; CHECK-NEXT: vfmv.v.f v12, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, mu -; CHECK-NEXT: vfmul.vv v8, v8, v12 +; CHECK-NEXT: vfmul.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -315,10 +305,8 @@ define @vfmul_vf_nxv32f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfmul_vf_nxv32f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, m8, ta, mu -; CHECK-NEXT: vfmv.v.f v16, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, m8, ta, mu -; CHECK-NEXT: vfmul.vv v8, v8, v16 +; CHECK-NEXT: vfmul.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -369,10 +357,8 @@ define @vfmul_vf_nxv1f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfmul_vf_nxv1f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, mf2, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, mu -; CHECK-NEXT: vfmul.vv v8, v8, v9 +; CHECK-NEXT: vfmul.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -423,10 +409,8 @@ define @vfmul_vf_nxv2f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfmul_vf_nxv2f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, m1, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, mu -; CHECK-NEXT: vfmul.vv v8, v8, v9 +; CHECK-NEXT: vfmul.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -477,10 +461,8 @@ define @vfmul_vf_nxv4f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfmul_vf_nxv4f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, mu -; CHECK-NEXT: vfmv.v.f v10, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, mu -; CHECK-NEXT: vfmul.vv v8, v8, v10 +; CHECK-NEXT: vfmul.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -531,10 +513,8 @@ define @vfmul_vf_nxv8f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfmul_vf_nxv8f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, mu -; CHECK-NEXT: vfmv.v.f v12, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, mu -; CHECK-NEXT: vfmul.vv v8, v8, v12 +; CHECK-NEXT: vfmul.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -585,10 +565,8 @@ define @vfmul_vf_nxv16f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfmul_vf_nxv16f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, m8, ta, mu -; CHECK-NEXT: vfmv.v.f v16, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, mu -; CHECK-NEXT: vfmul.vv v8, v8, v16 +; CHECK-NEXT: vfmul.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -639,10 +617,8 @@ define @vfmul_vf_nxv1f64_unmasked( %va, double %b, i32 zeroext %evl) { ; CHECK-LABEL: vfmul_vf_nxv1f64_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e64, m1, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, mu -; CHECK-NEXT: vfmul.vv v8, v8, v9 +; CHECK-NEXT: vfmul.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, double %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -693,10 +669,8 @@ define @vfmul_vf_nxv2f64_unmasked( %va, double %b, i32 zeroext %evl) { ; CHECK-LABEL: vfmul_vf_nxv2f64_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e64, m2, ta, mu -; CHECK-NEXT: vfmv.v.f v10, fa0 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, mu -; CHECK-NEXT: vfmul.vv v8, v8, v10 +; CHECK-NEXT: vfmul.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, double %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -747,10 +721,8 @@ define @vfmul_vf_nxv4f64_unmasked( %va, double %b, i32 zeroext %evl) { ; CHECK-LABEL: vfmul_vf_nxv4f64_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e64, m4, ta, mu -; CHECK-NEXT: vfmv.v.f v12, fa0 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, mu -; CHECK-NEXT: vfmul.vv v8, v8, v12 +; CHECK-NEXT: vfmul.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, double %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -813,10 +785,8 @@ define @vfmul_vf_nxv8f64_unmasked( %va, double %b, i32 zeroext %evl) { ; CHECK-LABEL: vfmul_vf_nxv8f64_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e64, m8, ta, mu -; CHECK-NEXT: vfmv.v.f v16, fa0 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, mu -; CHECK-NEXT: vfmul.vv v8, v8, v16 +; CHECK-NEXT: vfmul.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, double %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer diff --git a/llvm/test/CodeGen/RISCV/rvv/vfrdiv-vp.ll b/llvm/test/CodeGen/RISCV/rvv/vfrdiv-vp.ll --- a/llvm/test/CodeGen/RISCV/rvv/vfrdiv-vp.ll +++ b/llvm/test/CodeGen/RISCV/rvv/vfrdiv-vp.ll @@ -23,10 +23,8 @@ define @vfrdiv_vf_nxv1f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrdiv_vf_nxv1f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, mf4, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v9, v8 +; CHECK-NEXT: vfrdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -55,10 +53,8 @@ define @vfrdiv_vf_nxv2f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrdiv_vf_nxv2f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, mf2, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v9, v8 +; CHECK-NEXT: vfrdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -87,10 +83,8 @@ define @vfrdiv_vf_nxv4f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrdiv_vf_nxv4f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, m1, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v9, v8 +; CHECK-NEXT: vfrdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -119,10 +113,8 @@ define @vfrdiv_vf_nxv8f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrdiv_vf_nxv8f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, mu -; CHECK-NEXT: vfmv.v.f v10, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v10, v8 +; CHECK-NEXT: vfrdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -151,10 +143,8 @@ define @vfrdiv_vf_nxv16f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrdiv_vf_nxv16f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, m4, ta, mu -; CHECK-NEXT: vfmv.v.f v12, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v12, v8 +; CHECK-NEXT: vfrdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -183,10 +173,8 @@ define @vfrdiv_vf_nxv32f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrdiv_vf_nxv32f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, m8, ta, mu -; CHECK-NEXT: vfmv.v.f v16, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, m8, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v16, v8 +; CHECK-NEXT: vfrdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -215,10 +203,8 @@ define @vfrdiv_vf_nxv1f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrdiv_vf_nxv1f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, mf2, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v9, v8 +; CHECK-NEXT: vfrdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -247,10 +233,8 @@ define @vfrdiv_vf_nxv2f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrdiv_vf_nxv2f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, m1, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v9, v8 +; CHECK-NEXT: vfrdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -279,10 +263,8 @@ define @vfrdiv_vf_nxv4f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrdiv_vf_nxv4f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, mu -; CHECK-NEXT: vfmv.v.f v10, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v10, v8 +; CHECK-NEXT: vfrdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -311,10 +293,8 @@ define @vfrdiv_vf_nxv8f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrdiv_vf_nxv8f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, mu -; CHECK-NEXT: vfmv.v.f v12, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v12, v8 +; CHECK-NEXT: vfrdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -343,10 +323,8 @@ define @vfrdiv_vf_nxv16f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrdiv_vf_nxv16f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, m8, ta, mu -; CHECK-NEXT: vfmv.v.f v16, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v16, v8 +; CHECK-NEXT: vfrdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -375,10 +353,8 @@ define @vfrdiv_vf_nxv1f64_unmasked( %va, double %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrdiv_vf_nxv1f64_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e64, m1, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v9, v8 +; CHECK-NEXT: vfrdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, double %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -407,10 +383,8 @@ define @vfrdiv_vf_nxv2f64_unmasked( %va, double %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrdiv_vf_nxv2f64_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e64, m2, ta, mu -; CHECK-NEXT: vfmv.v.f v10, fa0 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v10, v8 +; CHECK-NEXT: vfrdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, double %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -439,10 +413,8 @@ define @vfrdiv_vf_nxv4f64_unmasked( %va, double %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrdiv_vf_nxv4f64_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e64, m4, ta, mu -; CHECK-NEXT: vfmv.v.f v12, fa0 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v12, v8 +; CHECK-NEXT: vfrdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, double %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -471,10 +443,8 @@ define @vfrdiv_vf_nxv8f64_unmasked( %va, double %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrdiv_vf_nxv8f64_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e64, m8, ta, mu -; CHECK-NEXT: vfmv.v.f v16, fa0 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, mu -; CHECK-NEXT: vfdiv.vv v8, v16, v8 +; CHECK-NEXT: vfrdiv.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, double %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer diff --git a/llvm/test/CodeGen/RISCV/rvv/vfrsub-vp.ll b/llvm/test/CodeGen/RISCV/rvv/vfrsub-vp.ll --- a/llvm/test/CodeGen/RISCV/rvv/vfrsub-vp.ll +++ b/llvm/test/CodeGen/RISCV/rvv/vfrsub-vp.ll @@ -23,10 +23,8 @@ define @vfrsub_vf_nxv1f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrsub_vf_nxv1f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, mf4, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, mu -; CHECK-NEXT: vfsub.vv v8, v9, v8 +; CHECK-NEXT: vfrsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -55,10 +53,8 @@ define @vfrsub_vf_nxv2f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrsub_vf_nxv2f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, mf2, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, mu -; CHECK-NEXT: vfsub.vv v8, v9, v8 +; CHECK-NEXT: vfrsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -87,10 +83,8 @@ define @vfrsub_vf_nxv4f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrsub_vf_nxv4f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, m1, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, mu -; CHECK-NEXT: vfsub.vv v8, v9, v8 +; CHECK-NEXT: vfrsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -119,10 +113,8 @@ define @vfrsub_vf_nxv8f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrsub_vf_nxv8f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, mu -; CHECK-NEXT: vfmv.v.f v10, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, mu -; CHECK-NEXT: vfsub.vv v8, v10, v8 +; CHECK-NEXT: vfrsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -151,10 +143,8 @@ define @vfrsub_vf_nxv16f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrsub_vf_nxv16f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, m4, ta, mu -; CHECK-NEXT: vfmv.v.f v12, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, mu -; CHECK-NEXT: vfsub.vv v8, v12, v8 +; CHECK-NEXT: vfrsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -183,10 +173,8 @@ define @vfrsub_vf_nxv32f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrsub_vf_nxv32f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, m8, ta, mu -; CHECK-NEXT: vfmv.v.f v16, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, m8, ta, mu -; CHECK-NEXT: vfsub.vv v8, v16, v8 +; CHECK-NEXT: vfrsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -215,10 +203,8 @@ define @vfrsub_vf_nxv1f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrsub_vf_nxv1f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, mf2, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, mu -; CHECK-NEXT: vfsub.vv v8, v9, v8 +; CHECK-NEXT: vfrsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -247,10 +233,8 @@ define @vfrsub_vf_nxv2f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrsub_vf_nxv2f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, m1, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, mu -; CHECK-NEXT: vfsub.vv v8, v9, v8 +; CHECK-NEXT: vfrsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -279,10 +263,8 @@ define @vfrsub_vf_nxv4f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrsub_vf_nxv4f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, mu -; CHECK-NEXT: vfmv.v.f v10, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, mu -; CHECK-NEXT: vfsub.vv v8, v10, v8 +; CHECK-NEXT: vfrsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -311,10 +293,8 @@ define @vfrsub_vf_nxv8f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrsub_vf_nxv8f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, mu -; CHECK-NEXT: vfmv.v.f v12, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, mu -; CHECK-NEXT: vfsub.vv v8, v12, v8 +; CHECK-NEXT: vfrsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -343,10 +323,8 @@ define @vfrsub_vf_nxv16f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrsub_vf_nxv16f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, m8, ta, mu -; CHECK-NEXT: vfmv.v.f v16, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, mu -; CHECK-NEXT: vfsub.vv v8, v16, v8 +; CHECK-NEXT: vfrsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -375,10 +353,8 @@ define @vfrsub_vf_nxv1f64_unmasked( %va, double %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrsub_vf_nxv1f64_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e64, m1, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, mu -; CHECK-NEXT: vfsub.vv v8, v9, v8 +; CHECK-NEXT: vfrsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, double %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -407,10 +383,8 @@ define @vfrsub_vf_nxv2f64_unmasked( %va, double %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrsub_vf_nxv2f64_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e64, m2, ta, mu -; CHECK-NEXT: vfmv.v.f v10, fa0 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, mu -; CHECK-NEXT: vfsub.vv v8, v10, v8 +; CHECK-NEXT: vfrsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, double %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -439,10 +413,8 @@ define @vfrsub_vf_nxv4f64_unmasked( %va, double %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrsub_vf_nxv4f64_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e64, m4, ta, mu -; CHECK-NEXT: vfmv.v.f v12, fa0 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, mu -; CHECK-NEXT: vfsub.vv v8, v12, v8 +; CHECK-NEXT: vfrsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, double %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -471,10 +443,8 @@ define @vfrsub_vf_nxv8f64_unmasked( %va, double %b, i32 zeroext %evl) { ; CHECK-LABEL: vfrsub_vf_nxv8f64_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e64, m8, ta, mu -; CHECK-NEXT: vfmv.v.f v16, fa0 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, mu -; CHECK-NEXT: vfsub.vv v8, v16, v8 +; CHECK-NEXT: vfrsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, double %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer diff --git a/llvm/test/CodeGen/RISCV/rvv/vfsub-vp.ll b/llvm/test/CodeGen/RISCV/rvv/vfsub-vp.ll --- a/llvm/test/CodeGen/RISCV/rvv/vfsub-vp.ll +++ b/llvm/test/CodeGen/RISCV/rvv/vfsub-vp.ll @@ -45,10 +45,8 @@ define @vfsub_vf_nxv1f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfsub_vf_nxv1f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, mf4, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, mu -; CHECK-NEXT: vfsub.vv v8, v8, v9 +; CHECK-NEXT: vfsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -99,10 +97,8 @@ define @vfsub_vf_nxv2f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfsub_vf_nxv2f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, mf2, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, mu -; CHECK-NEXT: vfsub.vv v8, v8, v9 +; CHECK-NEXT: vfsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -153,10 +149,8 @@ define @vfsub_vf_nxv4f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfsub_vf_nxv4f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, m1, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, mu -; CHECK-NEXT: vfsub.vv v8, v8, v9 +; CHECK-NEXT: vfsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -207,10 +201,8 @@ define @vfsub_vf_nxv8f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfsub_vf_nxv8f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, mu -; CHECK-NEXT: vfmv.v.f v10, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, mu -; CHECK-NEXT: vfsub.vv v8, v8, v10 +; CHECK-NEXT: vfsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -261,10 +253,8 @@ define @vfsub_vf_nxv16f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfsub_vf_nxv16f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, m4, ta, mu -; CHECK-NEXT: vfmv.v.f v12, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, mu -; CHECK-NEXT: vfsub.vv v8, v8, v12 +; CHECK-NEXT: vfsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -315,10 +305,8 @@ define @vfsub_vf_nxv32f16_unmasked( %va, half %b, i32 zeroext %evl) { ; CHECK-LABEL: vfsub_vf_nxv32f16_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e16, m8, ta, mu -; CHECK-NEXT: vfmv.v.f v16, fa0 ; CHECK-NEXT: vsetvli zero, a0, e16, m8, ta, mu -; CHECK-NEXT: vfsub.vv v8, v8, v16 +; CHECK-NEXT: vfsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, half %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -369,10 +357,8 @@ define @vfsub_vf_nxv1f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfsub_vf_nxv1f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, mf2, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, mu -; CHECK-NEXT: vfsub.vv v8, v8, v9 +; CHECK-NEXT: vfsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -423,10 +409,8 @@ define @vfsub_vf_nxv2f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfsub_vf_nxv2f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, m1, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, mu -; CHECK-NEXT: vfsub.vv v8, v8, v9 +; CHECK-NEXT: vfsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -477,10 +461,8 @@ define @vfsub_vf_nxv4f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfsub_vf_nxv4f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, mu -; CHECK-NEXT: vfmv.v.f v10, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, mu -; CHECK-NEXT: vfsub.vv v8, v8, v10 +; CHECK-NEXT: vfsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -531,10 +513,8 @@ define @vfsub_vf_nxv8f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfsub_vf_nxv8f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, mu -; CHECK-NEXT: vfmv.v.f v12, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, mu -; CHECK-NEXT: vfsub.vv v8, v8, v12 +; CHECK-NEXT: vfsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -585,10 +565,8 @@ define @vfsub_vf_nxv16f32_unmasked( %va, float %b, i32 zeroext %evl) { ; CHECK-LABEL: vfsub_vf_nxv16f32_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e32, m8, ta, mu -; CHECK-NEXT: vfmv.v.f v16, fa0 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, mu -; CHECK-NEXT: vfsub.vv v8, v8, v16 +; CHECK-NEXT: vfsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, float %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -639,10 +617,8 @@ define @vfsub_vf_nxv1f64_unmasked( %va, double %b, i32 zeroext %evl) { ; CHECK-LABEL: vfsub_vf_nxv1f64_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e64, m1, ta, mu -; CHECK-NEXT: vfmv.v.f v9, fa0 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, mu -; CHECK-NEXT: vfsub.vv v8, v8, v9 +; CHECK-NEXT: vfsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, double %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -693,10 +669,8 @@ define @vfsub_vf_nxv2f64_unmasked( %va, double %b, i32 zeroext %evl) { ; CHECK-LABEL: vfsub_vf_nxv2f64_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e64, m2, ta, mu -; CHECK-NEXT: vfmv.v.f v10, fa0 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, mu -; CHECK-NEXT: vfsub.vv v8, v8, v10 +; CHECK-NEXT: vfsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, double %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -747,10 +721,8 @@ define @vfsub_vf_nxv4f64_unmasked( %va, double %b, i32 zeroext %evl) { ; CHECK-LABEL: vfsub_vf_nxv4f64_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e64, m4, ta, mu -; CHECK-NEXT: vfmv.v.f v12, fa0 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, mu -; CHECK-NEXT: vfsub.vv v8, v8, v12 +; CHECK-NEXT: vfsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, double %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer @@ -813,10 +785,8 @@ define @vfsub_vf_nxv8f64_unmasked( %va, double %b, i32 zeroext %evl) { ; CHECK-LABEL: vfsub_vf_nxv8f64_unmasked: ; CHECK: # %bb.0: -; CHECK-NEXT: vsetvli a1, zero, e64, m8, ta, mu -; CHECK-NEXT: vfmv.v.f v16, fa0 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, mu -; CHECK-NEXT: vfsub.vv v8, v8, v16 +; CHECK-NEXT: vfsub.vf v8, v8, fa0 ; CHECK-NEXT: ret %elt.head = insertelement undef, double %b, i32 0 %vb = shufflevector %elt.head, undef, zeroinitializer