[PATCH] D24419: [InstCombine] use commutative matchers for patterns with commutative operators

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 13 14:01:19 PDT 2016


efriedma added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:2350
+  if (match(Op1, m_c_Xor(m_Not(m_Value(A)), m_Value(B))) &&
+      match(Op0, m_c_And(m_Specific(A), m_Specific(B))))
     return BinaryOperator::CreateXor(Builder->CreateNot(A), B);
----------------
This isn't actually equivalent to four separate checks in the case where both operands of the xor are "not" operations.  I guess that doesn't really matter much in practice for this particular case, but we need a better approach in general.


https://reviews.llvm.org/D24419





More information about the llvm-commits mailing list