[llvm] [InstCombine] fold `(a == c && b != c) || (a != c && b == c))` to `(a == c) == (b != c)` (PR #94915)
Zain Jaffal via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 21 16:22:53 PDT 2024
================
@@ -3476,7 +3469,7 @@ Instruction *InstCombinerImpl::visitOr(BinaryOperator &I) {
if (Instruction *X = foldComplexAndOrPatterns(I, Builder))
return X;
- // (A == c & B != d) | (A != c & B == d)) -> (A == c) | (B == d)
+ // (A == c & B != d) | (A != c & B == d)) -> (A == c) ^ (B == d)
----------------
zjaffal wrote:
to be able to do that we need to generalise `isKnownInversion` to handle the case of a and ~a being inversions of each other. I will change that once we land this
https://github.com/llvm/llvm-project/pull/94915
More information about the llvm-commits
mailing list