[PATCH] D102574: [InstCombine] Missed optimization for pow(x, y) * pow(x, z) with fast-math

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 17 06:02:22 PDT 2021


spatel added a comment.

In D102574#2763294 <https://reviews.llvm.org/D102574#2763294>, @vdsered wrote:

> I have noticed that there are two similiar transformations below exp2(X) * exp2(Y) -> exp2(X + Y) and exp(X) * exp(Y) -> exp(X + Y) that are done when each operand of multiplication has exactly one use which is n't true if, for example, there is exp2(X) * exp2(X) where exp2(X) is the same instruction, so it can be improved a little. I'm going to update the patch

I recommend that you make that use-check logic into a helper function as a preliminary step, so it can be be accessed from other places. For example, we miss this transform too because the use check is too restrictive:
https://alive2.llvm.org/ce/z/27ryac


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

https://reviews.llvm.org/D102574



More information about the llvm-commits mailing list