[PATCH] D65298: [DivRemPairs] Handling for expanded-form rem - recomposition (PR42673)

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 26 05:27:34 PDT 2019


lebedev.ri added a comment.

In D65298#1602367 <https://reviews.llvm.org/D65298#1602367>, @spatel wrote:

> LGTM - but I'd prefer that someone with a better grasp of C++ / PointerIntPair also have a look to make sure I'm not missing any implementation subtleties.


Thank you. I personally don't think there's any subtleties there.

> One question: should we keep track of the dead multiply instructions and remove them in this pass (for example, using RecursivelyDeleteTriviallyDeadInstructions())?

I have thought about that. I kind-of don't see how to nicely fit that here.
The even bigger issue is that we can now rewrite that `((x / y) * y)` as `x - (x % y)`
thus replacing `mul` with `sub`, but this also doesn't exactly fit here..
So i'd personally prefer to leave it for further passes to deal with
(yes, i have seen comment in git log about running after instcombine,
so i guess that leaves dagcombine.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65298





More information about the llvm-commits mailing list