@@ -9141,9 +9141,7 @@ static SDValue lowerSelectToBinOp(SDNode *N, SelectionDAG &DAG,
91419141 return DAG.getNode(ISD::OR, DL, VT, Neg, DAG.getFreeze(TrueV));
91429142 }
91439143
9144- const bool HasCZero =
9145- VT.isScalarInteger() &&
9146- (Subtarget.hasStdExtZicond() || Subtarget.hasVendorXVentanaCondOps());
9144+ const bool HasCZero = VT.isScalarInteger() && Subtarget.hasCZEROLike();
91479145
91489146 // (select c, 0, y) -> (c-1) & y
91499147 if (isNullConstant(TrueV) && (!HasCZero || isSimm12Constant(FalseV))) {
@@ -9281,8 +9279,7 @@ SDValue RISCVTargetLowering::lowerSELECT(SDValue Op, SelectionDAG &DAG) const {
92819279 // nodes to implement the SELECT. Performing the lowering here allows for
92829280 // greater control over when CZERO_{EQZ/NEZ} are used vs another branchless
92839281 // sequence or RISCVISD::SELECT_CC node (branch-based select).
9284- if ((Subtarget.hasStdExtZicond() || Subtarget.hasVendorXVentanaCondOps()) &&
9285- VT.isScalarInteger()) {
9282+ if (Subtarget.hasCZEROLike() && VT.isScalarInteger()) {
92869283
92879284 // (select c, t, 0) -> (czero_eqz t, c)
92889285 if (isNullConstant(FalseV))
@@ -15487,9 +15484,7 @@ static SDValue combineSelectAndUse(SDNode *N, SDValue Slct, SDValue OtherOp,
1548715484
1548815485 if (!Subtarget.hasConditionalMoveFusion()) {
1548915486 // (select cond, x, (and x, c)) has custom lowering with Zicond.
15490- if ((!Subtarget.hasStdExtZicond() &&
15491- !Subtarget.hasVendorXVentanaCondOps()) ||
15492- N->getOpcode() != ISD::AND)
15487+ if (!Subtarget.hasCZEROLike() || N->getOpcode() != ISD::AND)
1549315488 return SDValue();
1549415489
1549515490 // Maybe harmful when condition code has multiple use.
@@ -18953,8 +18948,7 @@ static SDValue useInversedSetcc(SDNode *N, SelectionDAG &DAG,
1895318948 // Replace (setcc eq (and x, C)) with (setcc ne (and x, C))) to generate
1895418949 // BEXTI, where C is power of 2.
1895518950 if (Subtarget.hasStdExtZbs() && VT.isScalarInteger() &&
18956- (Subtarget.hasStdExtZicond() || Subtarget.hasVendorXVentanaCondOps() ||
18957- Subtarget.hasVendorXTHeadCondMov())) {
18951+ (Subtarget.hasCZEROLike() || Subtarget.hasVendorXTHeadCondMov())) {
1895818952 SDValue LHS = Cond.getOperand(0);
1895918953 SDValue RHS = Cond.getOperand(1);
1896018954 ISD::CondCode CC = cast<CondCodeSDNode>(Cond.getOperand(2))->get();
@@ -24938,7 +24932,7 @@ RISCVTargetLowering::BuildSDIVPow2(SDNode *N, const APInt &Divisor,
2493824932
2493924933bool RISCVTargetLowering::shouldFoldSelectWithSingleBitTest(
2494024934 EVT VT, const APInt &AndMask) const {
24941- if (Subtarget.hasStdExtZicond() || Subtarget.hasVendorXVentanaCondOps ())
24935+ if (Subtarget.hasCZEROLike ())
2494224936 return !Subtarget.hasStdExtZbs() && AndMask.ugt(1024);
2494324937 return TargetLowering::shouldFoldSelectWithSingleBitTest(VT, AndMask);
2494424938}
0 commit comments