[PATCH] D154678: [InstCombine] Fold IEEE `fmul`/`fdiv` by Pow2 to `add`/`sub` of exp

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 10 10:57:45 PDT 2023


arsenm added a comment.

In D154678#4481841 <https://reviews.llvm.org/D154678#4481841>, @goldstein.w.n wrote:

>> Can we unconditionally turn fdiv into fmul if the divisor is known to be an exact power of 2?
>
> Not sure, best I can come up with just take reciprical.

Seems to work for power of 2 known <= max_exp. Much better to do that rather than try to handle both


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154678



More information about the llvm-commits mailing list