<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/88732>88732</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[mlir][arith] Canonicalization causes miscompilation on mulsi_extended
</td>
</tr>
<tr>
<th>Labels</th>
<td>
mlir
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
pingshiyu
</td>
</tr>
</table>
<pre>
The code below computes `mulsi_extended (-1) * (-1) : i1`, which should yield an extended vector with value `1 : i2`, or the bitvector `01`. However, canonicalization seems to cause the code to miscompile and output the bitvector `11`.
Reproduction: https://godbolt.org/z/8MYqsr1xd
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxkksuOGy0QhZ-G3pRscXHfFr3wjNX6N_8myiariIayIaKbDhd7PE8f0bYyyWQDAhXn45wqGaO9LIgDqV9IfapkTsaHYbXLJRp7z9Xk9X34ahCU1wgTOn8D5ec1J4xAGjpnF-13fEu4aNRAeLdjhPdA-PGPgziCZaShhL_CzVhlIBqfnYa7RadBLvBb4Yoq-QA3mwxcpctYKOwhwZ8SPkAyCJNNz2rSUFr09_Cfv-EVQ6lScvGLVdLZd5msXyAizhGSByVzxE1ic5U8zDYWV9YhyEWDz2nN6V8I2yCEngg9PtYvuAavsyqA8keT0hqJOBI-Ej5evJ68S3sfLoSP74SP3f_ffsbA3nSlB6F70csKB9Yywbq24X1lBiao7jten1WraUubbhKtOjcdCkkZo7SyA6f8QA-sZoK3tN_3um17dtZCSIHTWZIDxVlat3fuOhd2ZWPMOHRdK3jl5IQubg3nfHY2EM5L68NQyndTvkRyoM7GFD8Ekk1uG5LtQX0i9YsMNhlSn-D1c85bvPEj08etX-DvYalycMOnvGwyedorPxM-Fvhz263B_0CVCB83K7EkWdz8CgAA__9JauMQ">