<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/131283>131283</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[MLIR] crashes with "only integers and floats have a bitwidth"
</td>
</tr>
<tr>
<th>Labels</th>
<td>
mlir
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
thaddywu
</td>
</tr>
</table>
<pre>
To reproduce: https://godbolt.org/z/T3PfGcdvT
This bug appears when turning any of such optimizations:
`mlir-opt --test-vector-linearize` or
`mlir-opt --arith-emulate-wide-int` or
`mlir-opt --async-to-async-runtime` or
`mlir-opt --expand-realloc`
Code snippet:
```
"builtin.module"() ({
"spirv.func"() <{
function_control = #spirv.function_control<None>,
function_type = (!spirv.coopmatrix<2x2xi32, Subgroup, MatrixA>, !spirv.coopmatrix<2x2xi32, Subgroup, MatrixB>) -> (),
sym_name = ""
}>({
^bb0(%arg0: !spirv.coopmatrix<2x2xi32, Subgroup, MatrixA>, %arg1: !spirv.coopmatrix<2x2xi32, Subgroup, MatrixB>):
%0 = "spirv.ISub"(%arg0, %arg0) : (!spirv.coopmatrix<2x2xi32, Subgroup, MatrixA>, !spirv.coopmatrix<2x2xi32, Subgroup, MatrixA>) -> !spirv.coopmatrix<2x2xi32, Subgroup, MatrixA>
"spirv.Return"() : () -> ()
}) : () -> ()
}) : () -> ()
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy8VE2L4zgQ_TXli3CQS7HbPvjgTjrLwM6yzPR9kG3F1iJLRh9Jp3_9IseZ9MzSu9ALAwIJqt5TvXpScefkoIWoIX-EfJ_w4Edjaz_yvr-cQ9Ka_lI_G2LFbE0fOgGsIaP3swPWAB4AD4PpW6P8xtgB8PAKeHhmfx5_6_rTM9DmeZSOtGEgfJ4Ft46cR6GJD1ZLPRCuL8QciQvdSMzs5SRfuZdGL-y0gYJOStrUzJ6kqRfOpyfReWNTJbXgVr4KKCgx9h-53Eo_pmIKinuRnmUvUqn9e8nuorvUm_Vgg_Zyeo9ZvMxc96kVXCnTQUFjBm12phfEaTnPwn8vfl20AcQ2SOWl3kymD0oAImAJWJG4PTwCbQgBRDdLe9ocg-7eZLDdLYOQGIod-tYZ7a1RBNieALI78G0U2O4PowWwJ8Ddzwz-MosVXgJmV4bOmHni3soXYDt8wRfJEHBHvoZ2sCbM8fx5iTdXVvIB6OMCrUgK7Ol6e3Wvz12mb5pPt9IwrqU7D_sFdm9X_tS2dIHn3A40Ps3_pSOyZB9kWSVdrY8yAHN6k3Al-_Q1tDdXrwV_v5VefW5-vRXNj1Z8DH9TvAr9IuL_fvuAV2E_On4z9d8y_jN--2RJX7O-YhVPRJ09bLOKYVGUyViX4oHyojoWRdm1rKBH1mKZM-yx7FiRiUTWSDGnLNvSIstoudlWXVYyXm37tmLl8QhbKiYu1Uap0xTHXCKdC6LOWIYlSxRvhXLLAEWMgyIKz_eJrWN-2obBwZYq6by7M3jp1TJ0P__-6Qvke9JZ7kbhyFn6MXbSaHUhUnsxCOsI1z05KsO9IyM_CcJJK_1Z9n4ExCRYVf80k6UfQ7vpzAR4iJeuWzpb85foPOBh0eAAD6uMU41_BwAA__87J8-p">