[llvm] [RISCV] Support VP_SPLAT mask operations (PR #132345)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 23 06:17:06 PDT 2025
================
@@ -12773,8 +12774,29 @@ SDValue RISCVTargetLowering::lowerVPSplatExperimental(SDValue Op,
Mask = convertToScalableVector(MaskVT, Mask, DAG, Subtarget);
}
- SDValue Result =
- lowerScalarSplat(SDValue(), Val, VL, ContainerVT, DL, DAG, Subtarget);
+ SDValue Result;
+ if (VT.getScalarType() == MVT::i1) {
+ if (auto *C = dyn_cast<ConstantSDNode>(Val)) {
+ Result = C->isZero()
+ ? DAG.getNode(RISCVISD::VMCLR_VL, DL, ContainerVT, VL)
+ : DAG.getNode(RISCVISD::VMSET_VL, DL, ContainerVT, VL);
+ if (!ISD::isConstantSplatVectorAllOnes(Mask.getNode()))
----------------
NexMing wrote:
Alright
https://github.com/llvm/llvm-project/pull/132345
More information about the llvm-commits
mailing list