@@ -1715,7 +1715,6 @@ const char *ARMTargetLowering::getTargetNodeName(unsigned Opcode) const {
1715
1715
MAKE_CASE(ARMISD::BCC_i64)
1716
1716
MAKE_CASE(ARMISD::FMSTAT)
1717
1717
MAKE_CASE(ARMISD::CMOV)
1718
- MAKE_CASE(ARMISD::SUBS)
1719
1718
MAKE_CASE(ARMISD::SSAT)
1720
1719
MAKE_CASE(ARMISD::USAT)
1721
1720
MAKE_CASE(ARMISD::ASRL)
@@ -18475,9 +18474,9 @@ ARMTargetLowering::PerformCMOVCombine(SDNode *N, SelectionDAG &DAG) const {
18475
18474
} else if (CC == ARMCC::NE && !isNullConstant(RHS) &&
18476
18475
(!Subtarget->isThumb1Only() || isPowerOf2Constant(TrueVal))) {
18477
18476
// 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
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, TrueVal, ARMcc,
@@ -18489,9 +18488,9 @@ ARMTargetLowering::PerformCMOVCombine(SDNode *N, SelectionDAG &DAG) const {
18489
18488
(!Subtarget->isThumb1Only() || isPowerOf2Constant(FalseVal))) {
18490
18489
// This seems pointless but will allow us to combine it further below
18491
18490
// 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
18493
18492
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);
18495
18494
SDValue CPSRGlue = DAG.getCopyToReg(DAG.getEntryNode(), dl, ARM::CPSR,
18496
18495
Sub.getValue(1), SDValue());
18497
18496
Res = DAG.getNode(ARMISD::CMOV, dl, VT, Sub, FalseVal,
@@ -18503,21 +18502,21 @@ ARMTargetLowering::PerformCMOVCombine(SDNode *N, SelectionDAG &DAG) const {
18503
18502
18504
18503
// On Thumb1, the DAG above may be further combined if z is a power of 2
18505
18504
// (z == 2 ^ K).
18506
- // CMOV (SUBS x, y), z, !=, (SUBS x, y):1 ->
18505
+ // CMOV (SUBC x, y), z, !=, (SUBC x, y):1 ->
18507
18506
// t1 = (USUBO (SUB x, y), 1)
18508
18507
// t2 = (USUBO_CARRY (SUB x, y), t1:0, t1:1)
18509
18508
// Result = if K != 0 then (SHL t2:0, K) else t2:0
18510
18509
//
18511
18510
// 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 :
18513
18512
// CMOV x, z, !=, (CMPZ x, 0) ->
18514
18513
// t1 = (USUBO x, 1)
18515
18514
// t2 = (USUBO_CARRY x, t1:0, t1:1)
18516
18515
// Result = if K != 0 then (SHL t2:0, K) else t2:0
18517
18516
const APInt *TrueConst;
18518
18517
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) ||
18521
18520
(FalseVal == LHS && isNullConstant(RHS))) &&
18522
18521
(TrueConst = isPowerOf2Constant(TrueVal))) {
18523
18522
SDVTList VTs = DAG.getVTList(VT, MVT::i32);
0 commit comments