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

    <tr>
        <th>Summary</th>
        <td>
            [InstCombine] `samesign` flag should be dropped
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            miscompilation
      </td>
    </tr>

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

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

<pre>
    Reproducer:
```
define i1 @src(i64 %x, i64 %y, i1 %cond) {
  %cmp1 = icmp ult i64 %x, %y
 %cmp2 = icmp samesign uge i64 %x, %y
  %sel = select i1 %cond, i1 %cmp1, i1 %cmp2
  ret i1 %sel
}

define i1 @tgt(i64 %x, i64 %y, i1 %cond) {
  %cmp2 = icmp samesign uge i64 %x, %y
  %sel = xor i1 %cond, %cmp2
  ret i1 %sel
}
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykUk2PmzAU_DWPi7WR_fgIHHzY3ShSr_0Hxn4BVzZGttlu-usrCOk2rXpoKyExRm-GN-NRKdlhIpJQv0B9KtSSxxClyfr92_Vr0QdzlZ9pjsEsmiKUz8BPwJ-h4fuzHQ1d7ETMCgYVT1EDtrapGGD9DvjKdnzdsFihDpMB7BgcX24KbPvqZ8GgPDGr_cwWl9nPKpvCbfg2ix-zSXlajbBloD-RVpzIbaREjnR-WObHan4WDye88yPdGYncnsPxtIPfc8hD_vcc_sPbe4i_GPsbH48XWxhZmq7sVEFSHLHturIVWIyyq471UZPQXc-F0NQj102PulPm0rSiLqxEjpXgohbIyxIPVF-MMKpsq6oVvFJQcfLKuoNzb_4Q4lDYlBaSQmBZ88KpnlzaaonobdLBz9apbMMEiGtVo1yZT_0yJKi4symnD61ss9tK_WlK-TX43k4E9YlBw-95QsPZxamBpTEszrCemIlhnskUS3RyzHlOa-HxDHgebB6X_qCDBzyvf9lfT3MMX0hnwPO2fgI87w7eJH4PAAD__zXH8t0">