[llvm-commits] Fix Bug 13574: Add more double float shrinking optimizations
Stephen Canon
scanon at apple.com
Wed Aug 15 11:53:51 PDT 2012
Do I understand correctly that this optimization would transform cos((double)floatval) --> (double)cosf(floatval)? That's not a acceptable transformation, numerically.
One should also consider that there are a number of platforms supported by LLVM (not naming names) on which the float variants of libm functions are significantly *slower* than the double-precision variants.
- Steve
On Aug 15, 2012, at 2:33 PM, Weiming Zhao <weimingz at codeaurora.org> wrote:
> Hi,
>
> This patch fixes http://llvm.org/bugs/show_bug.cgi?id=13574
>
> Current LLVM only supports 5 double->float shrinking optimizations (floor->floorf, ceil->ceilf,round->roundf, rint->rintf() and nearbyint->nearbyintf).
>
> This patch adds more math functions, for example, pow->powf, sin->sinf, cos->cosf, etc.
>
> In this patch:
> 1. Since cos(), pow() and exp2() already have their own optimizers: CosPot, PowOpt and Exp2Opt, respectively, I let them inherit from UnaryDoubleFPOpt and in their CallOptimizer(), I let them to call the base class’s CallOptimizer() first.
> For this change, I have to hoist the definition of UnaryDoubleFPOpt ahead of CosOpt.
>
> 2. Since some functions are not available on Windows, I updated TargetLibraryInfo to mark them as unavailable.
>
> 3. A unit test case is updated to test this patch.
>
> Please help to review them.
>
> Thanks,
> Weiming
> <0001-Bug-13574-More-double-float-shrinking-optimizations-f.patch>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120815/ea682ff8/attachment.html>
More information about the llvm-commits
mailing list