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

    <tr>
        <th>Summary</th>
        <td>
            [mlir][spirv] Add patterns to convert `spirv.*MulExtended` to `spirv.MulI`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            enhancement,
            mlir:spirv
      </td>
    </tr>

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

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

<pre>
    When targeting SPIR-V for WebGPU, we can't rely on WGSL's support for extended multiplication: https://github.com/gpuweb/gpuweb/issues/1565.

To work around this limitation, we should provide patterns to rewrite `spirv.*MulExtended` in terms of regular multiplication. We need both the **S**igned and **U**nsigned variants, because the former is used in `TosaToArith` while the latter in wide integer emulation.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8Uk1vqzgU_TVmc9WImBiaBQvaTKtKU6matpO1wTfgqbHR9XUy_fdPQKT2vUU3HPD94Byfo2O0vUeshboTUn6kQZOQUqhDphMPgerlKGuD-ayPA3pgTT2y9T28vjz9c_MvnALBEdvHl3ch7-GC0GkvZMVA6D4heDg-vv4tZBUhpmkKxMsE_s_oDRoYk2M7OdtptsGLooGBeYqiaIR8EPKhtzykdtOFcf6Y0gXb7y82xoRRyIetKtVG5AeRN-vzLcAl0AdoCskb4MFGcHa0vP5o5RqHkJyBicLZGoRJMyP5CByA8EKWEUSZx8nSeSNk85zcX1fioszBemCkMUI4AWGfnKY_9GzgiOARDbSBB-ABQchGyOZ1hfnyDWhvrsfvK_i4Fs6arPYcZ7YtdjpFXHacAo1IYCOkiGbmIcr8LUT9FhqyPMzkLoN1a7dbVM1dl1mk9Yw9EuCY3EoyM3Vh9sVeZ1hvy2or5b4oZDbUt7neY7mr1G1bKn3CXO0qnWtTKFW0UlWZrWUu5VZuSyln3OT7qui2t1ptsThhKcUux1Fbt3HuPG4C9dniWK32qiwyp1t08Ro-9IP2HY7oeY6gvBdSjs6SKJrFgGsuqZ5X3bSpj2KXOxs5fi1ny24J8zKoDkLdrbPqAI0xvxncBX9G4p8M5vBVfU7uSZR5lsjVP0R0pnKFm4nCf9jx95guun8FAAD__zq7Ie8">