@@ -56568,14 +56568,11 @@ static SDValue matchPMADDWD(SelectionDAG &DAG, SDNode *N,
56568
56568
Op0H = Op0->getOperand(i + 1), Op1H = Op1->getOperand(i + 1);
56569
56569
// TODO: Be more tolerant to undefs.
56570
56570
APInt Idx0L, Idx0H, Idx1L, Idx1H;
56571
- if (!sd_match(Op0L, m_BinOp(ISD::EXTRACT_VECTOR_ELT, m_Value(),
56572
- m_ConstInt(Idx0L))) ||
56573
- !sd_match(Op0H, m_BinOp(ISD::EXTRACT_VECTOR_ELT, m_Value(),
56574
- m_ConstInt(Idx0H))) ||
56575
- !sd_match(Op1L, m_BinOp(ISD::EXTRACT_VECTOR_ELT, m_Value(),
56576
- m_ConstInt(Idx1L))) ||
56577
- !sd_match(Op1H, m_BinOp(ISD::EXTRACT_VECTOR_ELT, m_Value(),
56578
- m_ConstInt(Idx1H))))
56571
+ SDValue Vec0L, Vec0H, Vec1L, Vec1H;
56572
+ if (!sd_match(Op0L, m_ExtractElt(m_Value(Vec0L), m_ConstInt(Idx0L))) ||
56573
+ !sd_match(Op0H, m_ExtractElt(m_Value(Vec0H), m_ConstInt(Idx0H))) ||
56574
+ !sd_match(Op1L, m_ExtractElt(m_Value(Vec1L), m_ConstInt(Idx1L))) ||
56575
+ !sd_match(Op1H, m_ExtractElt(m_Value(Vec1H), m_ConstInt(Idx1H))))
56579
56576
return SDValue();
56580
56577
// Commutativity of mul allows factors of a product to reorder.
56581
56578
if (Idx0L.getZExtValue() > Idx1L.getZExtValue())
@@ -56594,14 +56591,13 @@ static SDValue matchPMADDWD(SelectionDAG &DAG, SDNode *N,
56594
56591
// First time an extract_elt's source vector is visited. Must be a MUL
56595
56592
// with 2X number of vector elements than the BUILD_VECTOR.
56596
56593
// Both extracts must be from same MUL.
56597
- Mul = Op0L->getOperand(0) ;
56598
- if (Mul-> getOpcode() != ISD::MUL ||
56594
+ Mul = Vec0L ;
56595
+ if (Mul. getOpcode() != ISD::MUL ||
56599
56596
Mul.getValueType().getVectorNumElements() != 2 * e)
56600
56597
return SDValue();
56601
56598
}
56602
56599
// Check that the extract is from the same MUL previously seen.
56603
- if (Mul != Op0L->getOperand(0) || Mul != Op1L->getOperand(0) ||
56604
- Mul != Op0H->getOperand(0) || Mul != Op1H->getOperand(0))
56600
+ if (Mul != Vec0L || Mul != Vec1L || Mul != Vec0H || Mul != Vec1H)
56605
56601
return SDValue();
56606
56602
}
56607
56603
@@ -56681,14 +56677,10 @@ static SDValue matchPMADDWD_2(SelectionDAG &DAG, SDNode *N,
56681
56677
// TODO: Be more tolerant to undefs.
56682
56678
SDValue N00In, N01In, N10In, N11In;
56683
56679
APInt IdxN00, IdxN01, IdxN10, IdxN11;
56684
- if (!sd_match(N00Elt, m_BinOp(ISD::EXTRACT_VECTOR_ELT, m_Value(N00In),
56685
- m_ConstInt(IdxN00))) ||
56686
- !sd_match(N01Elt, m_BinOp(ISD::EXTRACT_VECTOR_ELT, m_Value(N01In),
56687
- m_ConstInt(IdxN01))) ||
56688
- !sd_match(N10Elt, m_BinOp(ISD::EXTRACT_VECTOR_ELT, m_Value(N10In),
56689
- m_ConstInt(IdxN10))) ||
56690
- !sd_match(N11Elt, m_BinOp(ISD::EXTRACT_VECTOR_ELT, m_Value(N11In),
56691
- m_ConstInt(IdxN11))))
56680
+ if (!sd_match(N00Elt, m_ExtractElt(m_Value(N00In), m_ConstInt(IdxN00))) ||
56681
+ !sd_match(N01Elt, m_ExtractElt(m_Value(N01In), m_ConstInt(IdxN01))) ||
56682
+ !sd_match(N10Elt, m_ExtractElt(m_Value(N10In), m_ConstInt(IdxN10))) ||
56683
+ !sd_match(N11Elt, m_ExtractElt(m_Value(N11In), m_ConstInt(IdxN11))))
56692
56684
return SDValue();
56693
56685
// Add is commutative so indices can be reordered.
56694
56686
if (IdxN00.getZExtValue() > IdxN10.getZExtValue()) {
0 commit comments