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

    <tr>
        <th>Summary</th>
        <td>
            [InstSimplify] Missed optimization: `X != Y` implies `X | Y != 0`
        </td>
    </tr>

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

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

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

<pre>
    Proof: https://alive2.llvm.org/ce/z/cJ75Ya
```
define i1 @src(i8 %x, i8 %y) {
entry:
  %cond = icmp ne i8 %x, %y
  br i1 %cond, label %if.then, label %if.else

if.then:
  %or = or i8 %x, %y
  %cmp = icmp eq i8 %or, 0
  ret i1 %cmp

if.else:
  ret i1 false
}

define i1 @tgt(i8 %x, i8 %y) {
entry:
  %cond = icmp ne i8 %x, %y
  br i1 %cond, label %if.then, label %if.else

if.then:
  ret i1 false

if.else:
  ret i1 false
}
```
See also https://github.com/dtcxzyw/llvm-tools/issues/32 and https://discourse.llvm.org/t/tuning-up-constraint-elimination/83213/5?u=dtcxzyw.


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzUVE2L2zAQ_TXji0iQR_48-JDdYGihUNhL9yjbcqIiS64kbzf764u0zuaDtofeConRxxu9NzOP4c7JgxaigfwBEAffv76dfgIi5PuEL_5obLMeJp0ZTs1Xa8wIbEeO3s8O2A6wBWy5ki8Ct0q9TFtjD4BtLwDbt7D4XObPHOge6A4Kuv7idhCj1ILIlEBGne0BK1kRwPwV8JG8L0-ANYHy4T1CaG9PgTXuSAD0Rg8E2J7IfppJeO7yRIxfoZ2NRO8B4VLxTqhwIMetPwp9fyaUE6vs-D3DbtiNjdzG_ok2EE7zRaD4sSKNDVB6xlnhz_qm-Y42KrnQrtCRXwSW--uQm7r6g__f6vqbBP-hFLdeexKCcOXMnXEP0h-XbtubCbD9sH8bjLzxxigH2ErnFhEWDAnXw90Lg3S9WawT1-734b9oqQ-bZd70RjtvudR-I5ScpOZeGg3YVgxTBtjmwNoF2H4VsL1OOhkaNtSs5olo0pIhK7OyLpJjg2VKaV9kVVZjJvJSVGwoChzysS5zmhaJbJBilqbI0jxlabHNqjrrep6PdVd2VU4ho2LiUn0oT2KqTZqWGSuS2DS3joZJOieGjZm9nOTbmgACPgJiCAe285ZrNxo7uXWA2CbWsVsODjKqpPPuQuWlV3HufNLOP8lpVnI8Qb4nXyITuWFiOwIF_UYA02DJZygoiSHCrRflI3k-X4euJ4tVzV96HTWvjZ6t-S56f93qtQQvDf4KAAD__0ifeWU">