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

    <tr>
        <th>Summary</th>
        <td>
            Fold `(or disjoint (select C, X, 0), Y)` -> `(select C, X, Y)`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          s-barannikov
      </td>
    </tr>
</table>

<pre>
    https://gcc.godbolt.org/z/9vG3fEv8M

In this example (taken from compiler-rt), `select` could be folded with `or`: https://alive2.llvm.org/ce/z/NqzEaM

The optimization doesn't seem to happen even if `or` is `disjoint` (has it been lost along the way or never inferred?).

</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxkkkGTlDAQhX9Nc-maqdAEBg4cxnWxPOjJgx4DaYbshgSTDOvOr7cYcS31QlOV18nX77WK0VwccwvlOyjfZ-qaJh_aeOhVUM6ZZ79mvdev7ZTSEqE4A3VA3WUYjheve2_T0YcLUHcD6pr1QzE-rvUnEGcQ548O02Qi8g81L5YRqE7qmR2Owc84-HkxlsMhJKAG6AGhEpEtDwkqgYO_Wo094-itZo0vJk2bwgeoBBRn_BtIWbMyHa1d5x1o4J3q8_fbo9qRvkyMfklmNjeVjHeoPUcHdEoYmWdMHie1LOyQV3Zoxrcn0cTtX5v45I27IwLVk4poEvbMDq2PCZX17oJpYnxRr-gDOl45oHEjh8Aaig6oOYI4Z7otdFM0KuM2P8lSNqWom2xqh4pLUVCt6lNTUzNWYhyYmpFLlff1eMpMS4JKIUnmuZSyOUqWRS5FoeuxHAfZgBQ8K2Pf3MhMjFdu8-KUV3lmVc823gMncvyC91Mg2vIP7dZ06K-XCFJYE1P8c00yyXLbeas3K4BqH_C3IZsbv9LDhy3Mr9tH7Ml-22ol8ADF4976n3bXZNdg_102k6Zrfxz8DNRtMHs5LME_betC3X2ECNTtM64t_QwAAP__FXLhPw">