[PATCH] D148210: [InstCombine] icmp(MulC * X * Y, C) --> icmp(X * Y, C)

Jun Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 13 03:50:35 PDT 2023


junaire added a comment.

In D148210#4264628 <https://reviews.llvm.org/D148210#4264628>, @nikic wrote:

> As I understand it, this is a reassociation problem. Once you reassociate the multiply from `(X * C) * Y` to `(X * Y) * C` this will automatically fold via the existing logic in foldICmpMulConstant(). I don't really want this logic to be duplicated.
>
> It looks like `reassociate` currently produces this form with the constant on the inner multiply, but I'm not sure whether that's something that can be changed or not.

Thanks, that makes sense and solve my confusion when I wrote this. Should I try to fix the missing optimization by looking into the reassociate issue or the patch doesn't make sense at all?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148210



More information about the llvm-commits mailing list