[PATCH] D45842: [Reassociate] swap binop operands to increase factoring potential
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 26 11:30:09 PDT 2018
lebedev.ri 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)))
----------------
I'd think this could be
```
if (!B.isAssociative() || !B.isCommutative() ||
!match(&B, m_BinOp(m_BinOp(B0), m_BinOp(B1))))
return;
```
https://reviews.llvm.org/D45842
More information about the llvm-commits
mailing list