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

    <tr>
        <th>Summary</th>
        <td>
            Attributor does not propagate nofpclass uses to defs
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            ipo,
            missed-optimization,
            floating-point
      </td>
    </tr>

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

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

<pre>
    
```
declare float @llvm.arithmetic.fence.f32(float)
declare float @extern(float)

; arg missing nofpclass
define nofpclass(nan) float @return_implies_arg(float %arg) {
  ret float %arg
}

; return should get marked nofpclass(inf nan)
define internal float @callsite_implies_return() {
  %value = call float @extern(float 1.0)
 ret float %value
}

; arg should get nofpclass(inf nan)
define float @nofpclass_callsite_arg_implies_arg(float %arg) {
  %call = call float @extern(float nofpclass(inf nan) %arg)
  ret float %call
}

define float @nofpclass_earlier_call_implies_later_call_arg(float %arg) {
  %call0 = call float @extern(float nofpclass(inf nan) %arg)
  %call1 = call float @extern(float %arg) ; nofpclass should be implied here
  %add = fadd float %call0, %call1
  ret float %add
}

define float @nnan_ninf_implies_arg_return(float %arg) {
  %call = call nnan ninf float @extern(float %arg)
  ret float %call
}

define float @callsite_returns_nofpclass_nan() {
  %call = call nofpclass(inf nan) float @callsite_implies_return()
  ret float %call
}


define float @nnan_implies_arg_return(float %arg) {
  %call = call nnan float @extern(float %arg)
  ret float %call
}

define float @ninf_implies_arg_return(float %arg) {
  %call = call ninf float @extern(float %arg)
  ret float %call
}

```

return_implies_arg and callsite_implies_return are the missed interesting cases. nofpclass_earlier_call_implies_later_call_arg is missed but seems less useful

Cases that use flags on intrinsics seem to work, possibly by accident
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0Vu1uqzgQfRrzZ9TIMSGFH_xoG-U1IoMH8F5jI4-5u92nXxka8nGTbarbK1U0-OPMOWfGjCWRbi1iybJXlu0SOYbO-VJ6QtsnlVPvJeM7xl_Yln_8Ta8KayM9QmOcDMA23Jif_Up6Hboeg65XDdoaV00qmMinRUwUd7biPwG9_WXdxzN9Belb6DWRti1Y1wy1kURHsEZbPBsVuZWWieIE7zGM3h50PxiNdJC-PYYCJrLptQD2_DoDAngMcDE983jeXdOagYE6NxoFLQbopf-B6oKNtg3MjC4Iaxs1S3OiWUtjSAdciM7wTORX_JjIfkozIrB0B3HXPSdhveJL3EtZE8BdYdHvM1UPyFkYLGsPix7p28fNZyKbJH2q7TapE-jNbEbEm6rvy0DpjUY_yVlkGBmOQ48q4t8n6QNx_TniGaH09YR_TG6FMCtS0KHHM3yp1ITexB8X9nEm3hYGt4-MUo95bKU9WG2b8-o4Vf1XiiRCQYT63Infq4ulqGeadDgVypStG2f1iuntHD_2Ffga9_9x_XsM_8Nef1Np_IGquOqF8_PXNgPSKriTUIgdMHQ49TVUcz9ACrHF1ZKQVvClbxBoOkJVYwBC7AkMEsFI2IzmnOlbxIfQyRAnoTGyJXA2cvDakq5p2g_Bwd_O_4gHfnBEujLvUL2DrGut0IZElakq0kImWK63RSo2Yl2kSVcKsZHVtiiea5UWRZ3nyHkhuKy3VcNTFIkuBRcpz0W-fuYpz1eF5Nu8SDcZL-pivV7HTPVSm9V0q3C-TTTRiOU245s8MbJCQ9ONRQg9OCYEE29MiNmAJzcE3et_ZdDOLnNTVrVtnwanbYjD2S7xZQzwVI0txSuMpkCnkEEHg-VLCF5XY3AelEMC6wIM3g2yleHs3hGdpOiYwoaS0ZuyC2Eglr4wsWdi3-rQjdWqdj0T-xji49_T4N1fWAcm9pNEYmI_qfwvAAD__299BTY">