<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/97271>97271</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [X86] VNNI intrinsics argument types don't match the actual computation
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            backend:X86
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          RKSimon
      </td>
    </tr>
</table>

<pre>
    For example: `__m128i _mm_dpbusd_avx_epi32 (__m128i src, __m128i a, __m128i b)`

This takes 1 x <4 x i32> "src" and 2 x <16 x i8> "a * b" multiplication inputs but the clang/llvm intrinsics are defined as:

```
TARGET_BUILTIN(__builtin_ia32_vpdpbusd128, "V4iV4iV4iV4i", "ncV:128:", "avx512vl,avx512vnni|avxvnni")

  def int_x86_avx512_vpdpbusd_128 :
 ClangBuiltin<"__builtin_ia32_vpdpbusd128">,
 DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty,
 llvm_v4i32_ty], [IntrNoMem]>;
```

which means we require hardcoded mappings of the src/dst types for any combines that involve them.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8U12PqzYQ_TXDy-hGMCYBHnggyaZatd2H2-2qb8jGTnCvMRQbbvLvK0Oyd7tqK1nGni_OOZ7hzumLVaqE7R62x4hPvu3H8uvPv-mut5Ho5a089SOqK-8Go4BVCLu4rruEco1119VyEJOTNZ-vtRo0IwTKH343NkAHfFz5x4sAKmAXQ3yEuFr311Y79PybcpjgFYEdUryiZgTsCYFoKUfIrURa_ckuBOR3P0egKhQm7Cbj9WB0w73uLWo7TN6hmDz6VmFjuL0AnYyZO9TWj9o63Tjko0KpztoqidwBqz6iC2DXtYKtvv709Frvf3_-5fX5ZSEtJm28trXmjOp5WJVJKA-0gegt1e8LiO5W27wBq0IUq35Y-XzdJjQboMP9aK2GLFyWUwgsPqLDADxwqa_5rl5z3jHUCeX4TgcPgf5-BQvsAET_hz2oD3S45x7VmU_GV96P7vmhXCiy3Qc16znVjGp_g-1xofLZTAf8bLhX_o_08JOX_lfVBRN7Arb_1-dY9--tblrsFLcOvysc1V-THhW2fJRNL5XEjg-DtheH_XnphKWlTtJ59LdBOTz3I3J7w6bvhLbKoW-5R23n3swqZHSbSJZMFqzgkSqTLClyyigtorY8C5k0QiQkZSpkwdJUcMYFF0olWU5ZpEuKKY2zOImLNKNikzSSaCcoYzIjVmSQxqrj2myCFpt-vETauUmVRUZZEhkulHHLpBIJ3nxTVgKr_sh34ZG2x2gsQ94XMV0cpLHRzrsflbz2ZhnzEL894tvLy_M_e_8ydco-hJC9Bco8dtw37SIVb_zETVBmmPwyVtE0mrL1flhGhU5Ap4v27SQ2Td_dx-v--TKM_Z-q8UCnhZIDOq2s5pL-DgAA__8qcmRp">