@@ -15338,40 +15338,6 @@ static SDValue performIntrinsicCombine(SDNode *N,
15338
15338
return SDValue();
15339
15339
}
15340
15340
15341
- static bool isCheapToExtend(const SDValue &N) {
15342
- unsigned OC = N->getOpcode();
15343
- return OC == ISD::LOAD || OC == ISD::MLOAD ||
15344
- ISD::isConstantSplatVectorAllZeros(N.getNode());
15345
- }
15346
-
15347
- static SDValue
15348
- performSignExtendSetCCCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI,
15349
- SelectionDAG &DAG) {
15350
- // If we have (sext (setcc A B)) and A and B are cheap to extend,
15351
- // we can move the sext into the arguments and have the same result. For
15352
- // example, if A and B are both loads, we can make those extending loads and
15353
- // avoid an extra instruction. This pattern appears often in VLS code
15354
- // generation where the inputs to the setcc have a different size to the
15355
- // instruction that wants to use the result of the setcc.
15356
- assert(N->getOpcode() == ISD::SIGN_EXTEND &&
15357
- N->getOperand(0)->getOpcode() == ISD::SETCC);
15358
- const SDValue SetCC = N->getOperand(0);
15359
-
15360
- if (isCheapToExtend(SetCC.getOperand(0)) &&
15361
- isCheapToExtend(SetCC.getOperand(1))) {
15362
- const SDValue Ext1 = DAG.getNode(ISD::SIGN_EXTEND, SDLoc(N),
15363
- N->getValueType(0), SetCC.getOperand(0));
15364
- const SDValue Ext2 = DAG.getNode(ISD::SIGN_EXTEND, SDLoc(N),
15365
- N->getValueType(0), SetCC.getOperand(1));
15366
-
15367
- return DAG.getSetCC(
15368
- SDLoc(SetCC), N->getValueType(0), Ext1, Ext2,
15369
- cast<CondCodeSDNode>(SetCC->getOperand(2).getNode())->get());
15370
- }
15371
-
15372
- return SDValue();
15373
- }
15374
-
15375
15341
static SDValue performExtendCombine(SDNode *N,
15376
15342
TargetLowering::DAGCombinerInfo &DCI,
15377
15343
SelectionDAG &DAG) {
@@ -15390,11 +15356,6 @@ static SDValue performExtendCombine(SDNode *N,
15390
15356
15391
15357
return DAG.getNode(ISD::ZERO_EXTEND, SDLoc(N), N->getValueType(0), NewABD);
15392
15358
}
15393
-
15394
- if (N->getOpcode() == ISD::SIGN_EXTEND &&
15395
- N->getOperand(0)->getOpcode() == ISD::SETCC)
15396
- return performSignExtendSetCCCombine(N, DCI, DAG);
15397
-
15398
15359
return SDValue();
15399
15360
}
15400
15361
0 commit comments