<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/56795>56795</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Conditional constant propagation suboptimal case
</td>
</tr>
<tr>
<th>Labels</th>
<td>
llvm:optimizations,
missed-optimization
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
bcl5980
</td>
</tr>
</table>
<pre>
https://godbolt.org/z/rabrEMrva
```
unsigned f(unsigned x, unsigned y) {
return (x == y) ? x * (x - y) : 0;
}
```
can return 0 direct.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxtUcFSwyAQ_Rq4MM0gSAgHDqnVmx8BgaY4NHSAOOrXu8FWHcfMJvD2ZR9vF5vcuz7VeimIj4g9QczJ2RRrl_IM6APebGx-fM6vBtEDouP129NrNLguJcyLd-SI2PAN3hB7IN_oHTFFkNx_VRB4sq9rXgiUvBHEDxDXn_gTgQwbv6jdLTsSivi1HsnDv04ms9x0KXEh-6l22Ou7Xig6MNlz7DR3iiuDa6jR64e0uFBDWkwkU1pKNUsll5wuZjZbmpTVpksN5403xeM1x78zC_W02m5KZwAxvt6WHci8gAGAoZTVF9iIXiqBT9r4SfTCKmm9G4Q4DpLannt-pFJ6oSyOxvpYNBJ7xFgT5WPzET6aLxBj23xhOYO6d7vf7EaKAw6aUcaoZND8nWKs6909h1lI5Y9mspNC99SfTYjddsJ26TjrZt2ucwEyhlLLD2lKu0zfbIG-WespZW2nKNRAcetStxY_AVuEt1c">