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

    <tr>
        <th>Summary</th>
        <td>
            [InstCombine] Failure to recognise hidden xor
        </td>
    </tr>

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

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

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

<pre>
    https://alive2.llvm.org/ce/z/EFnf-a
```
define i1 @src(i1 %0, i1 %1) denormal-fp-math=ieee,ieee {
%2:
  %t5 = select i1 %0, i32 4, i32 1
  %t6 = select i1 %1, i32 4, i32 1
  %t7 = and i32 %t6, %t5
  %t8 = icmp eq i32 %t7, 0
  ret i1 %t8
}
=>
define i1 @tgt(i1 %0, i1 %1) denormal-fp-math=ieee,ieee {
%2:
  %foo = xor i1 %0, %1
  ret i1 %foo
}
Transformation seems to be correct!
```

Reported here: https://twitter.com/johnregehr/status/1568286233968656385
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy1U8Fu3CAQ_Rp8QbvCg8H2wYckm5Wq3tL-ALbHNpFttoDTNl9fIE67TaLeKmEYmJk3b56hNf3PZvL-4gi_IXAOQ836CeE4z0_L0dgxnHQYpufw3Z_X4aAIOxF2QyTbR9r2OOgVqc4pKZizHYEq2iAYgTv6YuYEatrjauyi5sNwOSzKT4SfNGKocBcXSsrbHR8ERE5pQ2O6FzQEU4czdp5eo3OgxauRX2fI9xn5vzPKlKHWPrkSRoxL5a_jqhSnu-VC8dvv2DLGstc4i69FfbU3VZ52g58Iv_9AOj_6_yDdYEzi-8PYa-ES8DuyIfgN269WrW6Itb02a9ATF0e9oS3SzlgbxCWQf3gtXuYHvBjrsacTWgzM6N83zn_X3qM9dmYJu0czrRZHnGzYOK_85oKRC1lBJYHzWlZSSF6JDJtcSijDgYCsb3hf81plXvsZGyJuP63O35mlDeIScaJnpefNYuQdGJtx1Q7ppPugatQl2-z85iWM2k9bu9OK72FfDhdrHlPTZ-3chpGfKKWU2dSUsmc1EyovZMtL6DgXvBfYdcBFVwxFNqsWZxf5EYAEym90YNrtTAFe_gwsARv7g7l4vejnpHx0ilOmG2AArM4ZqxgTcCwCssK6HFTbt4Wqwz3CJbT7-xFntknE2210wTlr590fp3JOjysm0SK-2vxkbPPw-YtezJqlHpvU4C8fOS7-">