[llvm] [RISCV] Avoid VMNOT by swapping VMERGE operands (PR #126751)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 19 20:00:00 PST 2025


================
@@ -8965,6 +8965,9 @@ SDValue RISCVTargetLowering::lowerVectorMaskExt(SDValue Op, SelectionDAG &DAG,
   if (VecVT.isScalableVector()) {
     SDValue SplatZero = DAG.getConstant(0, DL, VecVT);
     SDValue SplatTrueVal = DAG.getSignedConstant(ExtTrueVal, DL, VecVT);
+    if (Src.getOpcode() == ISD::XOR &&
+        ISD::isConstantSplatVectorAllOnes(Src.getOperand(1).getNode(), false))
----------------
lukel97 wrote:

The `BuildVectorOnly` arg defaults to false so you can omit if you'd like

https://github.com/llvm/llvm-project/pull/126751


More information about the llvm-commits mailing list