[llvm] [InstCombine] Fold Xor with or disjoint (PR #105992)

via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 26 08:20:40 PDT 2024


XChy wrote:

It's my fault for not providing generalized proof of the issue, but I don't think your pattern here is correct.
IIUC, you try to fold `(A | B) ^ C` into `(A ^ C) | B` iff `A ^ C` can be simplified, but it's wrong:
https://alive2.llvm.org/ce/z/s7VV8u
The correct pattern should be `(A | B) ^ C --> (A ^ C) ^ B`: https://alive2.llvm.org/ce/z/u2vco3 
The key is to treat `or disjoint` as `xor`.

https://github.com/llvm/llvm-project/pull/105992


More information about the llvm-commits mailing list