<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/85250>85250</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
missed fold, (x > 0) ? x : -x == 0 => x == 0
</td>
</tr>
<tr>
<th>Labels</th>
<td>
llvm:instcombine
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
zhengyang92
</td>
</tr>
</table>
<pre>
https://alive2.llvm.org/ce/z/NFEKjp
https://godbolt.org/z/7Ef9Kf4s3
```llvm
define i1 @src(float %0) {
entry:
%1 = fcmp oge float %0, 0.000000e+00
%2 = fneg float %0
%3 = select i1 %1, float %0, float %2
%4 = fcmp oeq float %3, 0.000000e+00
ret i1 %4
}
define i1 @tgt(float %0) {
entry:
%oeq = fcmp oeq float %0, 0.000000e+00
ret i1 %oeq
}
```
@jayfoad @regehr
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU82OozwQfJrmYk1k2vYABw7Jl3AZ6XsHwA04MjiDndFmnn5lyN_M7hwWIfmnq8rloqm9N_1EVILagdon9TkMbi4_B5r6Sz31BSaN05dyCOHkQWwBK8CqtuaDcGPtx7hxcw9YtQRYfQJW_1eHt-MJ-B749iupd7pxNlwJEZsduuKtk16scHjl6xt11y1NnZmImZSB5H5uAfPOujowQMUBCwbZbkXSFOZLPGuVQpUyEHvWteOJuZ7YM-0_xjd8eQhwx_mdgytnov4Zf6uKperJUhsWS6jSKPZV-r7CO1E-WaH3B0L8ZGWm2wHyKpLtr5M_Ywl9-IdYooG_u_kxmIcbR-_f_dy-2XUp-bG-dK7W0dlMPQ0ze3ae6FLoQhR1QmWapVwK_oppMpRth1xlRDLXWhU5FXleZNTpLhc81apLTIkcJRepTJXION-0mVYSpWx0IUVLEiSnsTb23paJ8f5MZa5Q8cTWDVm_tDni0mBiayYfWjc2ZiJAjO0_l7H00px7D5Jb44N_yAUTLJWj8Z4065zVMTDA_BcDcWBr7qJicbllL3HYx6T5Ojmwx05ynu23X6o3YTg3m9aNgNXibx1eTrM7UhsAq-U6HrBabvQ7AAD__1Q9Bw0">