[llvm-commits] Fix Bug 13574: Add more double float shrinking optimizations

Weiming Zhao weimingz at codeaurora.org
Thu Aug 16 10:33:43 PDT 2012


Hi Chad & Stephen,

 

Attached is updated patch, which includes:

1.       Complete test cases, which tests both wanted and unwanted
transformations

2.       The transformation is guarded by a flag

3.       More strict constraint: both the input and output are limited to
float

 

Any comments and suggestions are welcome.

 

Thanks,

Weiming

 

From: Chad Rosier [mailto:mcrosier at apple.com] 
Sent: Wednesday, August 15, 2012 1:24 PM
To: Weiming Zhao
Cc: llvm-commits at cs.uiuc.edu
Subject: Re: [llvm-commits] Fix Bug 13574: Add more double float shrinking
optimizations

 

Thanks, Weiming.  Once complete I'll give the patch a full review.

 

 Chad

 

On Aug 15, 2012, at 1:13 PM, Weiming Zhao wrote:





No problem.  I can add one test case per function.

 

Weiming

 

From: Chad Rosier [mailto:mcrosier at apple.com] 
Sent: Wednesday, August 15, 2012 11:42 AM
To: Weiming Zhao
Cc: llvm-commits at cs.uiuc.edu
Subject: Re: [llvm-commits] Fix Bug 13574: Add more double float shrinking
optimizations

 

 

On Aug 15, 2012, at 11:33 AM, Weiming Zhao 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.

 

At the very least you should have one test case per library function that
you've added.

 

 Chad






 

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/20120816/87bbc7f8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Bug-13574-More-double-float-shrinking-optimizations-f.patch
Type: application/octet-stream
Size: 27355 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120816/87bbc7f8/attachment.obj>


More information about the llvm-commits mailing list