[llvm] [X86] matchPMADDWD - add support for larger source types (PR #205391)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 24 03:54:35 PDT 2026


================
@@ -59617,12 +59617,12 @@ static SDValue matchPMADDWD(SelectionDAG &DAG, SDNode *N,
       return SDValue();
     if (!Mul) {
       // First time an extract_elt's source vector is visited. Must be a MUL
-      // with 2X number of vector elements than the BUILD_VECTOR.
+      // with at least 2X number of vector elements than the BUILD_VECTOR.
       // Both extracts must be from same MUL.
       Mul = Vec0L;
       if ((Mul.getOpcode() != ISD::MUL && Mul.getOpcode() != ISD::SHL &&
            Mul.getOpcode() != ISD::SIGN_EXTEND) ||
-          Mul.getValueType().getVectorNumElements() != 2 * e)
+          Mul.getValueType().getVectorNumElements() < (2 * e))
----------------
RKSimon wrote:

This is probably as far as matchPMADDWD should go - other improvements can wait until we can do something better with HADD patterns.

(This patch was to help with regressions with the ISD::VEC_REDUCE_ADD support btw).

https://github.com/llvm/llvm-project/pull/205391


More information about the llvm-commits mailing list