@@ -58110,14 +58110,13 @@ static SDValue combineAdd(SDNode *N, SelectionDAG &DAG,
58110
58110
}
58111
58111
}
58112
58112
58113
+ // If vectors of i1 are legal, turn (add (zext (vXi1 X)), Y) into
58114
+ // (sub Y, (sext (vXi1 X))).
58115
+ // FIXME: We have the (sub Y, (zext (vXi1 X))) -> (add (sext (vXi1 X)), Y) in
58116
+ // generic DAG combine without a legal type check, but adding this there
58117
+ // caused regressions.
58113
58118
if (VT.isVector()) {
58114
58119
SDValue X, Y;
58115
-
58116
- // If vectors of i1 are legal, turn (add (zext (vXi1 X)), Y) into
58117
- // (sub Y, (sext (vXi1 X))).
58118
- // FIXME: We have the (sub Y, (zext (vXi1 X))) -> (add (sext (vXi1 X)), Y)
58119
- // in generic DAG combine without a legal type check, but adding this there
58120
- // caused regressions.
58121
58120
EVT BoolVT = EVT::getVectorVT(*DAG.getContext(), MVT::i1,
58122
58121
VT.getVectorElementCount());
58123
58122
if (DAG.getTargetLoweringInfo().isTypeLegal(BoolVT) &&
@@ -58126,15 +58125,6 @@ static SDValue combineAdd(SDNode *N, SelectionDAG &DAG,
58126
58125
SDValue SExt = DAG.getNode(ISD::SIGN_EXTEND, DL, VT, X);
58127
58126
return DAG.getNode(ISD::SUB, DL, VT, Y, SExt);
58128
58127
}
58129
-
58130
- // Fold (add X, (srl Y, 7)) -> (sub X, (ashr Y, 7)) to undo instcombine
58131
- // canonicalisation as we don't have good vXi8 shifts.
58132
- if (VT.getScalarType() == MVT::i8 &&
58133
- sd_match(N, m_Add(m_Value(X), m_Srl(m_Value(Y), m_SpecificInt(7))))) {
58134
- SDValue AShr = DAG.getNode(ISD::SRA, DL, VT, Y,
58135
- DAG.getShiftAmountConstant(7, VT, DL));
58136
- return DAG.getNode(ISD::SUB, DL, VT, X, AShr);
58137
- }
58138
58128
}
58139
58129
58140
58130
// Peephole for 512-bit VPDPBSSD on non-VLX targets.
0 commit comments