[PATCH] D60395: [InstCombine] Canonicalize (-X s/ Y) to -(X s/ Y)

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 8 14:38:57 PDT 2019


spatel added a comment.

In D60395#1458421 <https://reviews.llvm.org/D60395#1458421>, @lebedev.ri wrote:

> Given that this doesn't fall into endless loop, i guess we don't do reverse transform.
>  I'm just wondering, this is the direction we should be doing it? @spatel


We already have these for mul:

  // -X * Y --> -(X * Y)
  // X * -Y --> -(X * Y)

...so that provides some precedent for the direction to move the negation.

Is there a sibling fold for srem?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D60395





More information about the llvm-commits mailing list