[PATCH] D41353: [InstCombine] Adjusting bswap pattern to the new masked shl canonization

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 19 00:33:50 PST 2017


hfinkel added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:1432
 
-  // (A & B) | (C & D)                              -> bswap if possible.
-  bool OrOfAnds = match(Op0, m_And(m_Value(), m_Value())) &&
-                  match(Op1, m_And(m_Value(), m_Value()));
+  // (A << B) | (C & D)                              -> bswap if possible.
+  bool OrOfShiftAndAnd = (match(Op0, m_And(m_Value(), m_Value())) &&
----------------
A comment here explaining why (A & B) | (C & D)  will be canonicalized into (A << B) | (C & D) in all relevant cases would be useful.


Repository:
  rL LLVM

https://reviews.llvm.org/D41353





More information about the llvm-commits mailing list