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

    <tr>
        <th>Summary</th>
        <td>
            Wrong `xor` --> `or disjoint` due to undef inputs
        </td>
    </tr>

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

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

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

<pre>
    https://alive2.llvm.org/ce/z/XMy5BD

```ll
define i32 @fun0(i32 %val0, i32 %val1, i32 %val2) {
  %val4 = and i32 %val2, %val0
  %val5 = xor i32 %val2, -1
  %val6 = and i32 %val5, %val1
 %val7 = xor i32 %val4, %val6
  ret i32 %val7
}
```



```
----------------------------------------
define i32 @fun0(i32 %val0, i32 %val1, i32 %val2) {
#0:
  %val4 = and i32 %val2, %val0
  %val5 = xor i32 %val2, 4294967295
  %val6 = and i32 %val5, %val1
  %val7 = xor i32 %val4, %val6
  ret i32 %val7
}
=>
define i32 @fun0(i32 %val0, i32 %val1, i32 %val2) {
#0:
  %val4 = and i32 %val2, %val0
  %val5 = xor i32 %val2, 4294967295
  %val6 = and i32 %val5, %val1
  %val7 = or disjoint i32 %val4, %val6
  ret i32 %val7
}
Transformation doesn't verify!

ERROR: Target is more poisonous than source

Example:
i32 %val0 = undef
i32 %val1 = undef
i32 %val2 = undef

Source:
i32 %val4 = #x00000000 (0)      [based on undef value]
i32 %val5 = #xffffffff (4294967295, -1) [based on undef value]
i32 %val6 = #x00000000 (0)      [based on undef value]
i32 %val7 = #x00000000 (0)

Target:
i32 %val4 = #x0000000f (15)
i32 %val5 = #xffffffff (4294967295, -1)
i32 %val6 = #x0000000f (15)
i32 %val7 = poison
Source value: #x00000000 (0)
Target value: poison

Summary:
  0 correct transformations
  1 incorrect transformations
  0 failed-to-prove transformations
  0 Alive2 errors
```



</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkVk2P6yYU_TXXG5QIXwy2F14kL-NdVWn6pHZLYpwwsiECnCb99ZU_JnHSmTevr9PVQ5GjC4cD95xrg_Re741SBfA18E0ku3Cwrtha89IZFW1tdSkOIRw9sBVgCVjKRp8ULpvm1C6t2wOWOwVY_gVY_vHLha83QDdAV9NT0PHXNGNHpWptFNEMCSS07gwFzIYI-Uk2FPALuYXxfYiAOYF0PVKRqTchwDZEmuoe-eVKeYfmA_ps3SN6Ed8DxRu0_Eb7ih6j9A3W5AYWr9ROhRkinURKNw9q3Un4lpxjuPjO9unSAzLaF8T_4UOCeZKLFHP-Q358riFsA-zpp5XPOlJp_2K1Cf9Jxq9OGl9b18qgrSGVVd4ApoGclNP1BTCeF_nT8_Ovz8BW5Kt0-57Xk9Y6RY5We2ts50k4SEO87dxO3U08y_bYqKuyM3OGdDpTqfpxKH5_CB-Hxudv48L_XGV0EJCd6dQIYEYBc6A58PVWelURa0ZKcpJNp4BvHmn4laaeWk8z83X8WP1LVvE5m0u_QXOTaHTueyQacov5df4PyfBBpu-vMWYzFtbc3Cl9tvpGplN1XpFzlomra1vpLrM3nZKddU7tAgl3r4R_BcREmw8glNRSN6paBLs4OntS7wNXw1FNlHPW-Q-PmKgqWJWzXEaqiNM4T1Iaizg6FEJmgiHjacLqpK4op7FIRJbGsagk5zTSBVJMqMCUCiZovEwyWedpVidZnG1VlUNCVSt1c701RNr7ThW5yHgaNXKrGj_cQBCN-pMMg4DYX0hc0c9ZbLu9h4Q22gd_Ywk6NKr43VmzJyDo2ToQlCwWwJ76ePb96vurTpFgpwLX5tgFH3Wuebjf7HU4dNvlzraAZb_S9NeL_aJ2AbAc9ucBy3H_pwL_DgAA__9on3fq">