@@ -1715,7 +1715,6 @@ const char *ARMTargetLowering::getTargetNodeName(unsigned Opcode) const {
17151715 MAKE_CASE(ARMISD::BCC_i64)
17161716 MAKE_CASE(ARMISD::FMSTAT)
17171717 MAKE_CASE(ARMISD::CMOV)
1718- MAKE_CASE(ARMISD::SUBS)
17191718 MAKE_CASE(ARMISD::SSAT)
17201719 MAKE_CASE(ARMISD::USAT)
17211720 MAKE_CASE(ARMISD::ASRL)
@@ -18475,9 +18474,9 @@ ARMTargetLowering::PerformCMOVCombine(SDNode *N, SelectionDAG &DAG) const {
1847518474 } else if (CC == ARMCC::NE && !isNullConstant(RHS) &&
1847618475 (!Subtarget->isThumb1Only() || isPowerOf2Constant(TrueVal))) {
1847718476 // This seems pointless but will allow us to combine it further below.
18478- // CMOV 0, z, !=, (CMPZ x, y) -> CMOV (SUBS x, y), z, !=, (SUBS x, y):1
18477+ // CMOV 0, z, !=, (CMPZ x, y) -> CMOV (SUBC x, y), z, !=, (SUBC x, y):1
1847918478 SDValue Sub =
18480- DAG.getNode(ARMISD::SUBS , dl, DAG.getVTList(VT, MVT::i32), LHS, RHS);
18479+ DAG.getNode(ARMISD::SUBC , dl, DAG.getVTList(VT, MVT::i32), LHS, RHS);
1848118480 SDValue CPSRGlue = DAG.getCopyToReg(DAG.getEntryNode(), dl, ARM::CPSR,
1848218481 Sub.getValue(1), SDValue());
1848318482 Res = DAG.getNode(ARMISD::CMOV, dl, VT, Sub, TrueVal, ARMcc,
@@ -18489,9 +18488,9 @@ ARMTargetLowering::PerformCMOVCombine(SDNode *N, SelectionDAG &DAG) const {
1848918488 (!Subtarget->isThumb1Only() || isPowerOf2Constant(FalseVal))) {
1849018489 // This seems pointless but will allow us to combine it further below
1849118490 // Note that we change == for != as this is the dual for the case above.
18492- // CMOV z, 0, ==, (CMPZ x, y) -> CMOV (SUBS x, y), z, !=, (SUBS x, y):1
18491+ // CMOV z, 0, ==, (CMPZ x, y) -> CMOV (SUBC x, y), z, !=, (SUBC x, y):1
1849318492 SDValue Sub =
18494- DAG.getNode(ARMISD::SUBS , dl, DAG.getVTList(VT, MVT::i32), LHS, RHS);
18493+ DAG.getNode(ARMISD::SUBC , dl, DAG.getVTList(VT, MVT::i32), LHS, RHS);
1849518494 SDValue CPSRGlue = DAG.getCopyToReg(DAG.getEntryNode(), dl, ARM::CPSR,
1849618495 Sub.getValue(1), SDValue());
1849718496 Res = DAG.getNode(ARMISD::CMOV, dl, VT, Sub, FalseVal,
@@ -18503,21 +18502,21 @@ ARMTargetLowering::PerformCMOVCombine(SDNode *N, SelectionDAG &DAG) const {
1850318502
1850418503 // On Thumb1, the DAG above may be further combined if z is a power of 2
1850518504 // (z == 2 ^ K).
18506- // CMOV (SUBS x, y), z, !=, (SUBS x, y):1 ->
18505+ // CMOV (SUBC x, y), z, !=, (SUBC x, y):1 ->
1850718506 // t1 = (USUBO (SUB x, y), 1)
1850818507 // t2 = (USUBO_CARRY (SUB x, y), t1:0, t1:1)
1850918508 // Result = if K != 0 then (SHL t2:0, K) else t2:0
1851018509 //
1851118510 // This also handles the special case of comparing against zero; it's
18512- // essentially, the same pattern, except there's no SUBS :
18511+ // essentially, the same pattern, except there's no SUBC :
1851318512 // CMOV x, z, !=, (CMPZ x, 0) ->
1851418513 // t1 = (USUBO x, 1)
1851518514 // t2 = (USUBO_CARRY x, t1:0, t1:1)
1851618515 // Result = if K != 0 then (SHL t2:0, K) else t2:0
1851718516 const APInt *TrueConst;
1851818517 if (Subtarget->isThumb1Only() && CC == ARMCC::NE &&
18519- ((FalseVal.getOpcode() == ARMISD::SUBS &&
18520- FalseVal.getOperand(0) == LHS && FalseVal.getOperand( 1) == RHS) ||
18518+ ((FalseVal.getOpcode() == ARMISD::SUBC && FalseVal.getOperand(0) == LHS &&
18519+ FalseVal.getOperand(1) == RHS) ||
1852118520 (FalseVal == LHS && isNullConstant(RHS))) &&
1852218521 (TrueConst = isPowerOf2Constant(TrueVal))) {
1852318522 SDVTList VTs = DAG.getVTList(VT, MVT::i32);
0 commit comments