[llvm] [RISCV] Support VLS for VCIX (PR #67289)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 25 09:43:09 PDT 2023
================
@@ -8163,6 +8200,46 @@ SDValue RISCVTargetLowering::LowerINTRINSIC_W_CHAIN(SDValue Op,
Results.push_back(Result.getValue(NF));
return DAG.getMergeValues(Results, DL);
}
+ case Intrinsic::riscv_sf_vc_v_x_se:
+ case Intrinsic::riscv_sf_vc_v_i_se:
+ case Intrinsic::riscv_sf_vc_v_xv_se:
+ case Intrinsic::riscv_sf_vc_v_iv_se:
+ case Intrinsic::riscv_sf_vc_v_vv_se:
+ case Intrinsic::riscv_sf_vc_v_fv_se:
+ case Intrinsic::riscv_sf_vc_v_xvv_se:
+ case Intrinsic::riscv_sf_vc_v_ivv_se:
+ case Intrinsic::riscv_sf_vc_v_vvv_se:
+ case Intrinsic::riscv_sf_vc_v_fvv_se:
+ case Intrinsic::riscv_sf_vc_v_xvw_se:
+ case Intrinsic::riscv_sf_vc_v_ivw_se:
+ case Intrinsic::riscv_sf_vc_v_vvw_se:
+ case Intrinsic::riscv_sf_vc_v_fvw_se: {
+ MVT VT = Op.getSimpleValueType();
+
+ if (!VT.isFixedLengthVector())
+ break;
+
+ SmallVector<SDValue, 6> Ops;
+ for (const SDValue &V : Op->op_values()) {
+ // Skip non-fixed vector operands.
+ if (!V.getValueType().isFixedLengthVector()) {
+ Ops.push_back(V);
+ continue;
+ }
+
+ MVT OpContainerVT =
+ getContainerForFixedLengthVector(V.getSimpleValueType());
+ Ops.push_back(convertToScalableVector(OpContainerVT, V, DAG, Subtarget));
+ }
+
+ SDLoc DL(Op);
+ MVT RetContainerVT = getContainerForFixedLengthVector(VT);
+ SDValue ScalableVector =
+ DAG.getNode(ISD::INTRINSIC_W_CHAIN, DL, RetContainerVT, Ops);
+ SDValue FixedVector =
+ convertFromScalableVector(VT, ScalableVector, DAG, Subtarget);
+ return DAG.getMergeValues({FixedVector, Op.getOperand(0)}, DL);
----------------
topperc wrote:
`Op.getOperand(0)` should be `ScalableVector.getValue(1)` after making `ScalableVector` have two results.
https://github.com/llvm/llvm-project/pull/67289
More information about the llvm-commits
mailing list