[PATCH] D55961: [InstCombine] canonicalize MUL with NEG operand

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 20 15:35:56 PST 2018


spatel added a comment.

Thank you for making the patch.

1. Please always upload your patch with full context:

https://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-web-interface

2. I don't think propagation of 'nsw' is safe in this transform:

https://rise4fun.com/Alive/wQc

3. We need to check "m_OneUse" on the negated operand, or this transform will create an extra instruction. We should have 2 more tests with that pattern (and they should show that the transform does not occur). You might want to look at the code and tests for the similar transforms that we do for "fmul" later in this file.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55961/new/

https://reviews.llvm.org/D55961





More information about the llvm-commits mailing list