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

    <tr>
        <th>Summary</th>
        <td>
            [DAG] SimplifySetCC - failure to simplify icmp(not(x),not(y)) -> icmp(y, x) patterns
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            llvm:codegen,
            missed-optimization
      </td>
    </tr>

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

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

<pre>
    https://godbolt.org/z/E4rjf9se4

This is handled in instcombine, but under certain circumstances they can appear in the DAG as well (noticed while trying to improve ABD expansion on x86).

We do get the EQ/NE cases indirectly via the fold: (X+Y) == (X+Z) --> Y == Z
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxcUsFu6zYQ_JrVZWFDWkm2dNDBsax3KFCgTYH25UaJa2sDihRIKonz9YXkBC3ehcTuDjnkzKgQ5GaZGyifoGwTtcTR-ebP355lcjbpnb43Y4xzgPwE1AF1N6d7Z-Le-RtQ9wnUXQr_eq0DF5C2kJ4e61-jBJSAo7LasEaxKDbEwU29WAY6Y79EXKxmjwP7qMTiIH5YphCVHThgHPmOg7Ko5pmVX2-II2N7-oEq4Dsbg0CVdVEG1vg-imGM_i72htGhTLN3b4ynpxb5Y1Y2iLPoLH5UB6B6__-3_s2oHd44bgSXP4C63y84qMABxWrxPERzxzdRG-DqjIb8tLL_A_T0E6hGyFvI2-_Wy9ra7SC_4M_v0Uuim1zXea0SbrLD8Xg8lFVJydj0lB-HI2s-ZGXaVzrPi2w4lBVfU10RqUQaSilP85SyIi0y2hd0qNQxI77WVd7XNRQpT0rM3pi3aXUmkRAWbg5ZRmliVM8mbA4TrQjIT4PTfGMLREBnIJokBNY7N0eZ5FNFcdusbBPfrEd2_XILUKRGQgz_0USJZstOe_oBZYvPMs1Grvdnjucz7vCqxCyeV0PC1whlmOaHcUDVB1ANdH4U962ocRPuC3Zfo7KicFYxsrchWbz5NZMSx6XfD24C6rYfPrbd7N0rDxGo2wQJQN2myb8BAAD__xZm7Qs">