[PATCH] Added InstCombine Transform for ((B | C) & A) | B -> B | (A & C)

David Majnemer david.majnemer at gmail.com
Tue Aug 12 09:18:14 PDT 2014


While this seems to handle `((B | C) & A) | B`, it would be nice if you also handled `((B | C) & A) | C`

================
Comment at: lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:2129
@@ +2128,3 @@
+  if (match(Op0, m_And(m_Or(m_Value(B), m_Value(C)), m_Value(A))))
+    if (match(Op1, m_Specific(B)))
+      return BinaryOperator::CreateOr(B, Builder->CreateAnd(A, C));
----------------
This is a longwinded way of saying `Op1 == B`.

http://reviews.llvm.org/D4865






More information about the llvm-commits mailing list