[PATCH] D68408: [InstCombine] Negator - sink sinkable negations

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 4 05:02:20 PST 2019


lebedev.ri added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/sub-of-negatible.ll:159
 ; Subtraction can be negated if the first operand can be negated
-; x - (y - z) -> x - y + z -> x + (-y) + z
-define i8 @t9(i8 %x, i8 %y, i8 %z) {
+; x - (y - z) -> x - y + z -> x + (z - y)
+define i8 @t9(i8 %x, i8 %y) {
----------------
spatel wrote:
> I didn't follow the diffs here - was one of these tests redundant? The code comment didn't match before, but it still doesn't?
The test was too complicated, was checking more than the minimal pattern - subtraction can be freely negated by swapping its operands.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68408





More information about the llvm-commits mailing list