[PATCH] D45842: [Reassociate] swap binop operands to increase factoring potential

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 26 12:08:40 PDT 2018


spatel added inline comments.


================
Comment at: lib/Transforms/Scalar/Reassociate.cpp:2121
+  if (!B.isAssociative() || !B.isCommutative() ||
+      !match(B.getOperand(0), m_BinOp(B0)) ||
+      !match(B.getOperand(1), m_BinOp(B1)))
----------------
lebedev.ri wrote:
> I'd think this could be 
> ```
>   if (!B.isAssociative() || !B.isCommutative() ||
>       !match(&B, m_BinOp(m_BinOp(B0), m_BinOp(B1))))
>     return;
> ```
Sure - I can change that if the general functionality of the patch is approved.


https://reviews.llvm.org/D45842





More information about the llvm-commits mailing list