[llvm] [RISCV] Lower VP_SELECT constant false to use vmerge.vxm/vmerge.vim (PR #144461)
Liao Chunyu via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 17 22:26:36 PDT 2025
================
@@ -13176,6 +13182,23 @@ SDValue RISCVTargetLowering::lowerVPFPIntConvOp(SDValue Op,
return convertFromScalableVector(VT, Result, DAG, Subtarget);
}
+SDValue
+RISCVTargetLowering::lowerVPSelectConstantFalse(SDValue Op,
+ SelectionDAG &DAG) const {
+ SDLoc DL(Op);
+ MVT VT = Op.getSimpleValueType();
+ SDValue TrueVal = Op.getOperand(1);
+ SDValue FalseVal = Op.getOperand(2);
+ SDValue VL = Op.getOperand(3);
+
+ MVT MaskVT = VT.changeVectorElementType(MVT::i1);
+ SDValue AllOneMask = DAG.getNode(RISCVISD::VMSET_VL, DL, MaskVT, VL);
+ SDValue NewMask = DAG.getNode(RISCVISD::VMXOR_VL, DL, MaskVT,
----------------
ChunyuLiao wrote:
By switching to SDNode, we do not need additional patches, the existing optimization is reused. thanks.
https://github.com/llvm/llvm-project/pull/144461
More information about the llvm-commits
mailing list