[PATCH] D41608: [WIP][InstCombine] Missed optimization in math expression: aggressive optimization with pow

Dmitry Venikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 7 09:53:34 PST 2018


Quolyk updated this revision to Diff 128876.
Quolyk added a comment.

pow(a, x) * a * a * a * a   emits to

  define double @pow_ab_x_aaaa_fast(double %a, double %x) {
    %1 = call fast double @llvm.pow.f64(double %a, double %x)
    %2 = fmul fast double %a, %a
    %3 = fmul fast double %2, %2
    %mul4 = fmul fast double %3, %1
    ret double %mul4
  }

I don't see obvious ways to fold these instructions. I Would appreciate if somebody could help me with this.


https://reviews.llvm.org/D41608

Files:
  lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
  test/Transforms/InstCombine/fdiv-pow.ll
  test/Transforms/InstCombine/fmul-pow.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41608.128876.patch
Type: text/x-patch
Size: 9765 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180107/54b50d3f/attachment.bin>


More information about the llvm-commits mailing list