[PATCH] D16978: [InstCombine] Try harder to simplify ~(X & Y) -> ~X | ~Y and ~(X | Y) -> ~X & ~Y when X and Y have more than one uses.

Balaram Makam via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 14 14:28:32 PDT 2016


bmakam marked an inline comment as done.

================
Comment at: lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:1350
@@ +1349,3 @@
+  // - Constant) - A` if we are willing to invert some of the uses.
+  if (BinaryOperator *BO = dyn_cast<BinaryOperator>(V)) {
+    // Must be an 'add' or a 'sub'.
----------------
IIRC, instcombine is still early to assume that that constants are always canonicalized to the RHS.


http://reviews.llvm.org/D16978





More information about the llvm-commits mailing list