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

    <tr>
        <th>Summary</th>
        <td>
            clang cannot simplify `(a gt/lt b) != (a le/ge b)` where be is a specific constant
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          k-arrows
      </td>
    </tr>
</table>

<pre>
    Example:
https://godbolt.org/z/7PMr8vc98
```cpp
bool foo(int a)
{
   return (a > 5) != (a <= 5);
}

bool bar(int a)
{
   return (a < 5) != (a >= 5);
}
```


When checking this simplification with alive2, is it okay to try to represent an integer that is 1 greater than or 1 less than a certain integer using `add` or `sub` as follows?
https://alive2.llvm.org/ce/z/iddeDw
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU8Fu4zgM_Rr5QjSQpcSxDz60TXNbYG97pmTG1laRDIlOtvv1A8XJdFAUAwxgWCT1pEfqkZizGwNRL3YvYneocOEppv79CVOK11yZOHz0b__hefYk9LOQByGfJ-Y5F08dhTqOcTDR8yamUajj_0Id93__ldqL7doVLhq5fnae14iJ0cMpRqFaFxhQqO4O3b-sBgAk4iUFEKpFEPoNdkJ1IFQt9OERfC12iQv98rjgcDc-iQymPyB6_Y7o7TdEj-p-5V3__0wUwE5k310YgSeXIbvz7N3JWWQXA1wdT4DeXUgJ9Qoug2OI7_gBHIHTbUk0J8pU0g_gAtNICXhCLvAaxkTIayRATFCDp5xXF8FSYnSf55ZcUhGNxGEQjSwHRCPzYoqDGU7R-3jNQh-_k3rNdOP95XyX29JdczcMdLhWQ6-HTndYUV83Xdtu5W7fVFOva9NsrWrbWtO2xa1u9qo5mQ6l2Su17SrXK6l0Xcu6VrLTzcbIlnZU77pGK9NoFFtJZ3T-J3vlcl6o38tOtZVHQz7fulgp6zGMQqnS0Kkv-CezjFlspXeZ8-cN7NhTf4ODxRAiPwT6KM9yE39koY6ewXztCl9KH-m2UV7vOlEiMFRkQcgz2aIz2BgyY-BqSb7_MjmOp8VsbDwXCn95LE9ziv-SLcS3GnOZqVLmjwAAAP__oygViA">