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

    <tr>
        <th>Summary</th>
        <td>
            [mlir][arith] Arith folder for maxnumf/minnumf has wrong NaN behaviour
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            mlir
      </td>
    </tr>

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

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

<pre>
    IEEE754-2019's maximumnumf and minimumnumf have NaN as their identity element. The folder was copied from the regular maximumf and minimumf and considers that infinities are the identities.

For instance
```
%1 = arith.maxnumf %nan, %something : f32
```
should fold to `%something` but
```
%1 = arith.maxnumf %-inf, %something : f32
```
should not be folded, as if `%something` is NaN, then `%-inf` should be returned.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycUk1vnDAQ_TXmMlpkbNiFA4dNN0i95NQ_YPAA0_ojss0m-feVCemHlEsrIeyxZt6bN_NUjLQ4xJ41D6y5FWpLqw-99y_4400ZVYxev_VfHx8fL019ErzqmLhEsOqV7GbdZmdQToMl9yte1R3hST2BipBWpACk0SVKb4AGLbpUwrcVYfZGY4AXFWHyz4Qa5uBtLoGAy2ZU-KD5i-M9mLyLpDFkCpWA3EyOEmEEFXDHOEgJY8n4jfHr-3_wAcjFpNyEx_uZH997KJoKmLyBCpTW0qrXXRUTjVOOiS_5Fr3FtJJbgMkrzFJ8ihRXvxm964TkIb__UcrOHMYt_WMPJ3Lz_zThfILxmLnOACoCzZ_1RDEvL6ekFd2RsdOeORxoY15R2oJDXRa6l7qTnSqwry6S123bibZY-268tFxW2FbtRdRat1qO9SxrcW6nWlRYUC-4qKuKV1UnBG9Lri6ST6OWtRybs1Ks5mgVmdKYuy19WAqKccO-quqmqwujRjRxd64Q1lBgQmQPhz7nn8ZtiazmhmKKvxESJbO7fS9obqx52IfMmhtc8-XDl7Pf_ZcHz8RgyR3mjvASvFt2h4-4qjv5LRRbMP2a0nNk8srEwMSwUFq3sZy8ZWLI9Mdxeg7-O06JiWFXE5kYDkH3XvwMAAD__6nZHUc">