[PATCH] D102698: [InstCombine] Relaxed constraints of uses for exp(X) * exp(Y) -> exp(X + Y) and exp2(X) * exp2(Y) -> exp2(X + Y)

Daniil Seredkin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 18 09:51:35 PDT 2021


vdsered created this revision.
vdsered added a reviewer: spatel.
vdsered added a project: LLVM.
Herald added a subscriber: hiraditya.
vdsered requested review of this revision.
Herald added a subscriber: llvm-commits.

InstCombine didn't perform the transformations when fmul's operands were the same instruction because it required to have one use for each of them which is false in the case. This patch fixes this + adds tests for them and introduces a new function isRelaxedUseConstraintMet to check these cases in a single place.

This patch is a result of discussion in https://reviews.llvm.org/D102574.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D102698

Files:
  llvm/include/llvm/Transforms/Utils/Local.h
  llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
  llvm/lib/Transforms/Utils/Local.cpp
  llvm/test/Transforms/InstCombine/fmul-exp.ll
  llvm/test/Transforms/InstCombine/fmul-exp2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102698.346197.patch
Type: text/x-patch
Size: 4570 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210518/b9518ea8/attachment.bin>


More information about the llvm-commits mailing list