[PATCH] D55961: [InstCombine] canonicalize MUL with NEG operand
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Dec 29 09:07:44 PST 2018
lebedev.ri added inline comments.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp:247
+ // -X * Y --> -(X * Y) || X * -Y --> -(X * Y)
+ if (match(&I, m_c_Mul(m_OneUse(m_Neg(m_Value(X))), m_Value(Y))))
----------------
That `||` looks confusing. Maybe just keep that as two lines?
================
Comment at: llvm/test/Transforms/InstCombine/operand-complexity.ll:4
; 'Negate' is considered less complex than a normal binop, so the mul should have the binop as the first operand.
----------------
I guess this test no longer serves it's purpose.
Not sure what to do here.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55961/new/
https://reviews.llvm.org/D55961
More information about the llvm-commits
mailing list