[llvm] [InstSimplify] Simplify select if it combinated `and/or/xor` (PR #73362)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 26 11:32:23 PST 2024


nikic wrote:

A lot of these patterns look non-minimal to me.

For example, `(X | Y) == 0 ? (X & Y) : (X ^ Y)` to `X ^ Y` can instead be viewed as the combination of:

`(X | Y) == 0 ? (X & Y) : Z` to `(X | Y) == 0 ? 0 : Z` (https://alive2.llvm.org/ce/z/2ZJziy)

`(X | Y) == 0 ? 0 : (X ^ Y)` to `X ^ Y` (https://alive2.llvm.org/ce/z/_smtCP)

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


More information about the llvm-commits mailing list