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

    <tr>
        <th>Summary</th>
        <td>
            [InstCombine] poison-generating attributes are not dropped when threading icmps over selects 
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            miscompilation,
            llvm:instcombine
      </td>
    </tr>

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

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

<pre>
    Reproducer: https://alive2.llvm.org/ce/z/rSUfvo
```
define i1 @src(i32 noundef %Value) {
entry:
  %cmp.not = icmp eq i32 %Value, 0
  %0 = call range(i32 1, 33) i32 @llvm.ctpop.i32(i32 %Value)
  %cmp1 = icmp ult i32 %0, 2
  %1 = select i1 %cmp.not, i1 false, i1 %cmp1
  ret i1 %1
}

define i1 @tgt(i32 noundef %Value) {
entry:
  %0 = call range(i32 1, 33) i32 @llvm.ctpop.i32(i32 %Value)
  %1 = icmp eq i32 %0, 1
  ret i1 %1
}
```
When `%Value == 0`, `@src` returns `false` but `@tgt` returns `poison`.
This miscompilation was triggered after https://github.com/llvm/llvm-project/pull/111284 was landed.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VMuO2yAU_Rq8QRPBJbGThReZRJa67XON4cahwuACznTm6ysc5pG2i7ZSpUgBfO7jnPuQMZrBIbZkc08AdFLfnx4fCADZHCs5p7MPbXmseq8f2_c4Ba9nhYGIPT2nNEUi9gQ6Ap205oKwsvYyrnwYCHQKCXRPBLrw4dPp4gk7ErYnNSu_5arxZBxSwylZsxgUga0RQJ2fncYTJbD5LO2MBHaUNPdXG3QpPOa4y41mkBqnlfOJEnGkRo0TxW80-3m1P1D2Bs8WpJLW0iDdgCUszzghcrTFes0WOipNfloZAQX2JqvbHPhrArNNzxmw7BXeIK-wiBZVWqi_EMhIw-lJ2ojlXDw_mwd8NilPpDmWw6-CpiH9o6D_QyD-u_Is4vwJu9u--XJGR_OtRMqus_cFAYfl07Whapa9zsHF_HhVtma0n1MBZZFuQZM30TtSs9U12MeziXQ0UflxMlYm4x19kJGmYIYBA2oqTwnDTwMxmHSe-5XyI4Euy1T-7qbgv6JKBLpptpZAxzmH7XpxaaXTqEvcSrdC78ROVtjyBrY1b9YcqnMra0DsN6A20Gghdo3QqARTu6YGgZpXpgUGa844Z0IwDitQdcMbRHZSTO7qLVkzHKWxL_NamRhnbDnnO7GurOzRxrIXbpnn9QAHArBQEnvjYlJ-7I3DsjlCu9Ds5yHmBjExxdcwySS7LJx3LqZDsdsc6VXzuwEdBpmMG6hMKZh-ThipDEjzeOvgpwk1fcjVT-eAUmdkbqlI_QVDGapIqznY9q_rsWgQrxXJMlxa-BEAAP__3Q6Ajg">