[llvm] [InstCombine] Add combines for `(icmp eq/ne (and X, P2), (and X, -P2))` (PR #94867)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 8 12:57:43 PDT 2024
https://github.com/nikic commented:
> If P2 is not constant, then we only perform the fold if the and
ops are multi-use. This, however, saves an instruction compared to the
xor + and variant.
Unless this also came up in the diffs, please remove it from this PR.
-----
A possible alternative way to handle the motivating cases would be to allow the fold if X and Y are constants and only one of the ands is one-use. This is better in some ways (handles *any* constants) and worse in others (does not handle both ands being multi-use).
https://github.com/llvm/llvm-project/pull/94867
More information about the llvm-commits
mailing list