@@ -1713,7 +1713,6 @@ const char *ARMTargetLowering::getTargetNodeName(unsigned Opcode) const {
1713
1713
MAKE_CASE(ARMISD::BCC_i64)
1714
1714
MAKE_CASE(ARMISD::FMSTAT)
1715
1715
MAKE_CASE(ARMISD::CMOV)
1716
- MAKE_CASE(ARMISD::SUBS)
1717
1716
MAKE_CASE(ARMISD::SSAT)
1718
1717
MAKE_CASE(ARMISD::USAT)
1719
1718
MAKE_CASE(ARMISD::ASRL)
@@ -18461,9 +18460,9 @@ ARMTargetLowering::PerformCMOVCombine(SDNode *N, SelectionDAG &DAG) const {
18461
18460
} else if (CC == ARMCC::NE && !isNullConstant(RHS) &&
18462
18461
(!Subtarget->isThumb1Only() || isPowerOf2Constant(TrueVal))) {
18463
18462
// This seems pointless but will allow us to combine it further below.
18464
- // CMOV 0, z, !=, (CMPZ x, y) -> CMOV (SUBS x, y), z, !=, (SUBS x, y):1
18463
+ // CMOV 0, z, !=, (CMPZ x, y) -> CMOV (SUBC x, y), z, !=, (SUBC x, y):1
18465
18464
SDValue Sub =
18466
- DAG.getNode(ARMISD::SUBS , dl, DAG.getVTList(VT, MVT::i32), LHS, RHS);
18465
+ DAG.getNode(ARMISD::SUBC , dl, DAG.getVTList(VT, MVT::i32), LHS, RHS);
18467
18466
SDValue CPSRGlue = DAG.getCopyToReg(DAG.getEntryNode(), dl, ARM::CPSR,
18468
18467
Sub.getValue(1), SDValue());
18469
18468
Res = DAG.getNode(ARMISD::CMOV, dl, VT, Sub, TrueVal, ARMcc,
@@ -18475,9 +18474,9 @@ ARMTargetLowering::PerformCMOVCombine(SDNode *N, SelectionDAG &DAG) const {
18475
18474
(!Subtarget->isThumb1Only() || isPowerOf2Constant(FalseVal))) {
18476
18475
// This seems pointless but will allow us to combine it further below
18477
18476
// Note that we change == for != as this is the dual for the case above.
18478
- // CMOV z, 0, ==, (CMPZ x, y) -> CMOV (SUBS x, y), z, !=, (SUBS x, y):1
18477
+ // CMOV z, 0, ==, (CMPZ x, y) -> CMOV (SUBC x, y), z, !=, (SUBC x, y):1
18479
18478
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);
18481
18480
SDValue CPSRGlue = DAG.getCopyToReg(DAG.getEntryNode(), dl, ARM::CPSR,
18482
18481
Sub.getValue(1), SDValue());
18483
18482
Res = DAG.getNode(ARMISD::CMOV, dl, VT, Sub, FalseVal,
@@ -18489,21 +18488,21 @@ ARMTargetLowering::PerformCMOVCombine(SDNode *N, SelectionDAG &DAG) const {
18489
18488
18490
18489
// On Thumb1, the DAG above may be further combined if z is a power of 2
18491
18490
// (z == 2 ^ K).
18492
- // CMOV (SUBS x, y), z, !=, (SUBS x, y):1 ->
18491
+ // CMOV (SUBC x, y), z, !=, (SUBC x, y):1 ->
18493
18492
// t1 = (USUBO (SUB x, y), 1)
18494
18493
// t2 = (USUBO_CARRY (SUB x, y), t1:0, t1:1)
18495
18494
// Result = if K != 0 then (SHL t2:0, K) else t2:0
18496
18495
//
18497
18496
// This also handles the special case of comparing against zero; it's
18498
- // essentially, the same pattern, except there's no SUBS :
18497
+ // essentially, the same pattern, except there's no SUBC :
18499
18498
// CMOV x, z, !=, (CMPZ x, 0) ->
18500
18499
// t1 = (USUBO x, 1)
18501
18500
// t2 = (USUBO_CARRY x, t1:0, t1:1)
18502
18501
// Result = if K != 0 then (SHL t2:0, K) else t2:0
18503
18502
const APInt *TrueConst;
18504
18503
if (Subtarget->isThumb1Only() && CC == ARMCC::NE &&
18505
- ((FalseVal.getOpcode() == ARMISD::SUBS &&
18506
- FalseVal.getOperand(0) == LHS && FalseVal.getOperand( 1) == RHS) ||
18504
+ ((FalseVal.getOpcode() == ARMISD::SUBC && FalseVal.getOperand(0) == LHS &&
18505
+ FalseVal.getOperand(1) == RHS) ||
18507
18506
(FalseVal == LHS && isNullConstant(RHS))) &&
18508
18507
(TrueConst = isPowerOf2Constant(TrueVal))) {
18509
18508
SDVTList VTs = DAG.getVTList(VT, MVT::i32);
0 commit comments