[llvm] [InstCombine] fold `(a == c && b != c) || (a != c && b == c))` to `(a == c) == (b != c)` (PR #94915)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 20 23:50:37 PDT 2024
================
@@ -3450,6 +3476,10 @@ 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)
----------------
nikic wrote:
```suggestion
// (A == c & B != d) | (A != c & B == d)) -> (A == c) ^ (B == d)
```
https://github.com/llvm/llvm-project/pull/94915
More information about the llvm-commits
mailing list