[llvm] [RISCV] Fold vmnot.m of an integer compare into the compare (PR #222553)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 10 01:58:27 PDT 2026
================
@@ -19253,6 +19253,28 @@ static SDValue performORCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI,
return combineSelectAndUseCommutative(N, DAG, /*AllOnes*/ false, Subtarget);
}
+// Fold (vmxor_vl (setcc_vl a, b, cc), vmset_vl) -> (setcc_vl a, b, !cc) for
+// integer compares.
+static SDValue combineVMNOTOfSetCC(SDNode *N, SelectionDAG &DAG) {
+ SDValue Cmp = N->getOperand(0);
+ if (Cmp.getOpcode() == RISCVISD::VMSET_VL)
+ Cmp = N->getOperand(1);
+ else if (N->getOperand(1).getOpcode() != RISCVISD::VMSET_VL)
+ return SDValue();
+
+ if (Cmp.getOpcode() != RISCVISD::SETCC_VL || !Cmp.hasOneUse() ||
+ !Cmp.getOperand(0).getValueType().isInteger() ||
+ !Cmp.getOperand(3).isUndef() ||
----------------
lukel97 wrote:
Is there a reason why we restrict the mask to not undef?
https://github.com/llvm/llvm-project/pull/222553
More information about the llvm-commits
mailing list