[PATCH] D113861: [InstSimplify] Fold A|B | (A^B) --> A|B

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 15 00:29:16 PST 2021


foad added a comment.

This needs some lit tests.



================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:2270
+  // (B | A) | (A ^ B) --> B | A
+  if (match(Op1, m_Xor(m_Value(A), m_Value(B))) &&
+      match(Op0, m_c_Or(m_Specific(A), m_Specific(B))))
----------------
Just curious: don't we have matchers that will automatically match both the swapped and non-swapped forms of a commutative op?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113861/new/

https://reviews.llvm.org/D113861



More information about the llvm-commits mailing list