[llvm] [InstCombine] Clean up bitwise folds without one-use check (PR #80587)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 4 00:45:42 PST 2024


================
@@ -3565,22 +3565,6 @@ Instruction *InstCombinerImpl::visitOr(BinaryOperator &I) {
     if (match(Op1, m_Xor(m_Specific(B), m_Specific(A))))
       return BinaryOperator::CreateOr(Op1, C);
 
-  // ((A & B) ^ C) | B -> C | B
-  if (match(Op0, m_c_Xor(m_c_And(m_Value(A), m_Specific(Op1)), m_Value(C))))
-    return BinaryOperator::CreateOr(C, Op1);
-
-  // B | ((A & B) ^ C) -> B | C
-  if (match(Op1, m_c_Xor(m_c_And(m_Value(A), m_Specific(Op0)), m_Value(C))))
-    return BinaryOperator::CreateOr(Op0, C);
----------------
nikic wrote:

Aren't these two okay for multi-use?

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


More information about the llvm-commits mailing list