[PATCH] D14045: [SimplifyLibCalls] Add a new transform: pow(exp(x), y) -> exp(x*y)

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 29 11:34:32 PDT 2015


davide added a comment.

For completeness, this is the code we emit with the patch (only under fast-math):

00000000004007b0 <mypow>:

  4007b0:       f2 0f 59 c1             mulsd  %xmm1,%xmm0
  4007b4:       e9 87 fd ff ff          jmpq   400540 <exp2 at plt>
  4007b9:       0f 1f 80 00 00 00 00    nopl   0x0(%rax)

and this was the code we emit without:

00000000004007f0 <mypow>:

  4007f0:       50                      push   %rax
  4007f1:       f2 0f 11 0c 24          movsd  %xmm1,(%rsp)
  4007f6:       e8 75 fd ff ff          callq  400570 <exp2 at plt>
  4007fb:       f2 0f 10 0c 24          movsd  (%rsp),%xmm1
  400800:       58                      pop    %rax
  400801:       e9 7a fd ff ff          jmpq   400580 <pow at plt>
  400806:       66 2e 0f 1f 84 00 00    nopw   %cs:0x0(%rax,%rax,1)
  40080d:       00 00 00


http://reviews.llvm.org/D14045





More information about the llvm-commits mailing list