Skip to content

Commit d4a6bf4

Browse files
Revert "[AArch64][SVE][VLS] Move extends into arguments of comparisons"
This reverts commit db04d3e, which causes a buildbot failure.
1 parent 5a12024 commit d4a6bf4

File tree

2 files changed

+130
-105
lines changed

2 files changed

+130
-105
lines changed

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -15338,40 +15338,6 @@ static SDValue performIntrinsicCombine(SDNode *N,
1533815338
return SDValue();
1533915339
}
1534015340

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-
1537515341
static SDValue performExtendCombine(SDNode *N,
1537615342
TargetLowering::DAGCombinerInfo &DCI,
1537715343
SelectionDAG &DAG) {
@@ -15390,11 +15356,6 @@ static SDValue performExtendCombine(SDNode *N,
1539015356

1539115357
return DAG.getNode(ISD::ZERO_EXTEND, SDLoc(N), N->getValueType(0), NewABD);
1539215358
}
15393-
15394-
if (N->getOpcode() == ISD::SIGN_EXTEND &&
15395-
N->getOperand(0)->getOpcode() == ISD::SETCC)
15396-
return performSignExtendSetCCCombine(N, DCI, DAG);
15397-
1539815359
return SDValue();
1539915360
}
1540015361

0 commit comments

Comments
 (0)