[llvm] [RISCV] custom scmp(x, 0) and scmp(0, x) lowering for RVV (PR #151753)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 4 00:51:20 PDT 2025
================
@@ -8223,6 +8225,40 @@ SDValue RISCVTargetLowering::LowerOperation(SDValue Op,
case ISD::SADDSAT:
case ISD::SSUBSAT:
return lowerToScalableOp(Op, DAG);
+ case ISD::SCMP: {
+ SDLoc DL(Op);
+ EVT VT = Op->getValueType(0);
+ EVT CCVT = getSetCCResultType(DAG.getDataLayout(), *DAG.getContext(), VT);
+
+ SDValue LHS = DAG.getFreeze(Op->getOperand(0));
+ SDValue RHS = DAG.getFreeze(Op->getOperand(1));
+ unsigned SEW = VT.getScalarSizeInBits();
----------------
lukel97 wrote:
These should be moved into the if branches so we avoid creating nodes if the lowering doesn't take place. Otherwise you end up with dead nodes that can affect some combines that check the number of users on a node.
I think constants are OK though.
https://github.com/llvm/llvm-project/pull/151753
More information about the llvm-commits
mailing list