<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/71533>71533</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[InstCombine] Missed optimization for select a%2, (a/2*2)*(a/2*2), 0
</td>
</tr>
<tr>
<th>Labels</th>
<td>
llvm:instcombine,
missed-optimization
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
XChy
</td>
</tr>
</table>
<pre>
When I played with InstCombine, I generated something missed-optimized.
No real-world motivation, but it seems to be easy to implement.
[Missed example](https://godbolt.org/z/YjTeTz94x).
[Proof](https://alive2.llvm.org/ce/z/pQZHkw).
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxskk2PmzAQhn_NcBklIgMO8YFDNhHqHlq10kr9uBkYwFuDER52N_n1FTTtbj9OIH88r_0-NiHYdmDOQd2BOkdmls5P-ZdTd4lKX1_yzx0PeI-jMxeu8dlKh_dDkJPvSzsw0AnvseWBJyNcY_A9S2eHFnsbAtcbP4rt7ZXrLcRniI8fPE5s3ObZT67G3ot9MmL9sIDKWdAKBuY-oHgsGdmEy_Jr-9Fxz4PcMKDu3q8ByC9mmQN1Bjp0ImOA5AhUABWtr0vvZOunFqi4AhVfHx_44arTFyD9Svo4ed_8D2CcfWLaOvfU3yAV30jjp2_vvj8vmKjOk1on2kSc7_ZaJ3tSWkddHjdJw5WmJouJG9JZWtdcZUmVktYVp5HNKaZkt4uzXRJrFW8zReW-OjAf9kppU0Eac2-s-32CyIYwc57tVJJEzpTswiqOaFkBydEOQapfagjoBER_mri1TYvsKV-2bcq5DZDGzgYJr1Fixa3P4q1udcZb729x2PgJAzuuBA2QWoIR6GCACgI6EpAGOv4zcsI4mieX_6XNSjeX28r3QMV6r5-fzTj5R64EqFhrCEDF2sSPAAAA__8L89-l">