[llvm] [InstCombine] Simplify a complex OR to XOR (PR #75129)

Fujun Han via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 23:29:50 PST 2023


Peter9606 wrote:

> I think (and (add x, 32), 48) can be replaced with (and (xor x, 32), 48). Is that optimization alone enough to trigger the rest?

Just did a quick verify, your sugguestion works. At least for the case pointed by @bcl5980  in [comment](https://github.com/llvm/llvm-project/pull/75129#issuecomment-1852209646), it can be simplified to XOR now.

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


More information about the llvm-commits mailing list