<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/123021>123021</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Failed to eliminate unreachable code
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
CrazyboyQCD
</td>
</tr>
</table>
<pre>
C: https://godbolt.org/z/8Y5eTreoE
Rust: https://godbolt.org/z/vqv7MsnPK
Under condition `x <= y` there should be no codegen for the `else` branch.
```c
void f1(float x, float y, float* z) {
if (x <= y) return;
if (x > y)
*z = 0.0;
else
*z = x - y;
}
```
```c
void f2(float x, float y, float* z) {
if (x > y) *z = 0.0;
}
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUkkFvnD4QxT_NcBllZYYFlgMHshsuf_2ltmoPPdp4WFx57dQ227CfvoJETRTl0CIkLN57499IT8Zozo65hfIeylMm5zT50B6DvC3KL5-Pp0x5vbRHKDqcUnqMUHRAPVB_9lp5m3Y-nIH6G1B_-F7y18D-AUT3ZY7pbzLXn9f6_-g-_Qei--Y0Bxy80yYZ7xAq8YRQHKE44QKVwDRxYIyTn61Gxeg8Dl7zmR2OPqzymmEbeXWrIN0w7UB0UInndwDRXb3ROOZAh9F6mfAJ6IjPx-XPEajDG1CDUN-D6NCMCHR4Q0MNBk5zcFBsBsQ3nofN8PJ7fYC6G65BsROvgQ1UdK_qE97h8qxDfXoL_vES9G9LfMD4Adm7mzPdFropGplxm9dF1VAlapFNLR-ULEfdqEqzrnLNVJBmocqqobLcU2ZaElSKPC9FTXUpdvW-KMaqlHKs60qPNewFX6SxO2uvl7UTmYlx5janQlCeWanYxq2ZRI5_4aYC0VrU0K6hOzWfI-yFNTHF1zHJJMttL41ljckjW3MxTibG2QWWwySV5a062Rxs-66jJk2z2g3-AtSvI18-d4_B_-AhAfUbSATqX0ivLf0OAAD__0-i81o">