[llvm] [InstCombine] fold `(a == c && b != c) || (a != c && b == c))` to `(a == c) == (b != c)` (PR #94915)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 19 20:35:24 PDT 2024
================
@@ -3450,6 +3467,10 @@ Instruction *InstCombinerImpl::visitOr(BinaryOperator &I) {
if (Instruction *X = foldComplexAndOrPatterns(I, Builder))
return X;
+ // (A == 0 & B != 0) | (A != 0 & B == 0)) -> (A == 0) != (B == 0)
+ if (Value *V = foldAorBZero(I, Builder))
----------------
goldsteinn wrote:
This comment no longer captures the generalization of the impl.
https://github.com/llvm/llvm-project/pull/94915
More information about the llvm-commits
mailing list