[PATCH] D133695: [InstCombine] Optimize multiplication where both operands are negated
Sanjay Patel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 13 08:31:19 PDT 2022
spatel added inline comments.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp:1833
+ case Intrinsic::matrix_multiply: {
+ // remove negation operation when both operands are negated in matrix
+ // multiplication -A * -B = A * B
----------------
fhahn wrote:
> nit: comment should be full sentences: capitalize first letter, end with period.
IMO, the words are just noise. The formula is clear enough.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp:1837
+ Value *Op1 = II->getArgOperand(1);
+ Value *Op0NotNeg, *Op1NotNeg;
+ if (match(Op0, m_FNeg(m_Value(Op0NotNeg))) &&
----------------
Again - it's easier to read when the code matches the comments:
Value *A, *B;
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D133695/new/
https://reviews.llvm.org/D133695
More information about the llvm-commits
mailing list