<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/58046>58046</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [InstSimplify] FP-related miscompile
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            miscompilation
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          nikic
      </td>
    </tr>
</table>

<pre>
    From https://github.com/rust-lang/rust/issues/102402:

```
define i1 @src(i64 %0) {
  %i2 = uitofp i64 %0 to float
  %i3 = fpext float %i2 to double
  %i4 = fmul double -0.000000e+00, %i3
  %i5 = fdiv double 1.000000e+00, %i4
  %i6 = fcmp oeq double %i5, 0xFFF0000000000000
  ret i1 %i6
}
; RUN: opt -S -instsimplify
define i1 @src(i64 %0) {
  ret i1 false
}
```

Counter-proof: https://alive2.llvm.org/ce/z/6Rx_Cb
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVUsuO2yAU_Rq8QY4w2E5YeNEkstRNVc2o6wqbS0KLjQs4yvTri1_TpKoq1cK87jn3cbiNlW9V7WyHryEMHrEPiNZxXHS4js2utV08uNGH1Ij-su7jor0fwcdNRmhO6MQjZ0S2uSTrmI8SlO4B6wyjnHjXInrQZY4RLQiiHKP9ccHh6UpTjNgZjzpYNeANh4PFylgRHpFsRqoB7mExrvyIlXZsDDyC8wXcjWY14pTsyPwBokcSUzktXh9ZxcKS-raxsr-S8kdSuZDabsAWfmzE2d2EJ_e6rsnjt5EdhFmlyceq5P68btgRv3z5FIXGdgg4fcWp7n3wuhuMVm__K_QaSQnj4c9Iz4-3zCc79gFcOjhr1ZTEc7sIo29Ad8bcup11U5-0UZ_6Z_zLl_vXU5NAlZVlznhGWJbIiknOuEiCDgYqVBw_xlpet1qKM64_pw6MCCBxp31sw0EbSEZnqn_06RR-XaZEv0H71KrFgeRlcq0aSqkqFBMc9gqAt5LtiWhbyduSc8kSIxowfkoLUfoeXgRt-3gR00t0RQmlhNNDdihiRbtSlCRXB5FJUpRciKg_dEKbd0kSV815NePFR6PR8e1-G4X3-tLDLMXkX4zhal3V6--6TeYCqjn7Xxd8DQs">