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

    <tr>
        <th>Summary</th>
        <td>
            [InstCombine] ninf should not be propagated
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            miscompilation,
            llvm:instcombine,
            floating-point,
            generated by fuzzer
      </td>
    </tr>

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

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

<pre>
    Reproducer: https://alive2.llvm.org/ce/z/GnztNF
```
; bin/opt -passes=instcombine test.ll -S
define half @src(float %x) {
  %abs = call ninf float @llvm.fabs(float %x)
  %trunc = fptrunc float %abs to half
  ret half %trunc
}
```
```

----------------------------------------
define half @src(float %x) {
#0:
  %abs = fabs ninf float %x
  %trunc = fptrunc float %abs to half
  ret half %trunc
}
=>
define half @src(float %x) nofree willreturn memory(none) {
#0:
  %#1 = fptrunc float %x to half
  %trunc = fabs ninf half %#1
  ret half %trunc
}
Transformation doesn't verify!

ERROR: Target is more poisonous than source

Example:
float %x = #x50802003 (17196652544)

Source:
float %abs = #x50802003 (17196652544)
half %trunc = #x7c00 (+oo)

Target:
half %#1 = #x7c00 (+oo)
half %trunc = poison
Source value: #x7c00 (+oo)
Target value: poison

Summary:
  0 correct transformations
  1 incorrect transformations
  0 failed-to-prove transformations
  0 Alive2 errors
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJysVV2v4yYQ_TXjF5QID3E-Hvzgu1lXfWmlu_sHsD1OqDBYgLNJfn2F7esmt727W2mjSCEw53DODAzSe3UyRDlkL4DYhPp6v30DRMiOiRzC2bp8nkwq29zyV-qdbYaaHIiCnUPoPYgCsAQspVYXwrXWl25t3QmwrAmwvAOWv5l7-KMEXsCWz19egHhhlTKApe0DW_XSe_Igjsr4UNuuUoZYIB_WWrPVF-BFQ22cO0vdMthw72rAfautDAwwuwIeGOxegBcs_peVZyCOrJZaM6NMy-bQDR8ltrLy7_Fv2OAGU4_otp_GS1ikDXYUMUY7CrOiGRad7Y7vvT6OebH6yc__MQ0oeKzFO_vR5pP9CPqlNsURxOefU2ps64jYN6W1ozA4wzrqrLsB7o019KEZQJH-t87rk8pnT4vzN-GR5gduvjppfGtdJ4OyhjWWvAHcBXYhp9obYDpV8PPr65-v8Q58le5EgSnPOuuI9VZ5a-zgWThLw7wdXE0z5Cq7XtNk68FA1Aoorhnfc-RcMMB9uksP222G2WYzHUvgxZeJ6xn-VuYfEjzZXSC7mvMYDvhi7bLT5Gna6TF334P9m39KxSKcXaQeovyPGOZMLmELPlIMXSfd7e1IcFZb56gOLDzVy4-rKVPme-uctVJpalbBrnpnL_RBVDE2NEbOWecfL3HS5KI5iINMKE93mwOmqTjsknNe4U6kh1rI7bblhLyVMuO4rbJKUl01daJy5JjxLd-myEUq1pwoTTdYV_tWiixLYcOpk0ovbTRR3g-UpxuRIiZaVqT93K475Wvb9UqPqmPXxk-AGJEgioc2uiyNx0aZ06q3yoRl-kSGnAzUsOrG2uF-Jze_AS6PbKtqOPnYN5UP_h9lQQU9Ph2_Gx8-zVtlx-nO-bMddMOMDawi1jvby1PcIhmczp8fjpMK56Fa17YDLEf1008szl9UB8ByTIIHLOc8XHL8OwAA__-GKQIM">