[PATCH] Restore the sqrt -> llvm.sqrt mapping in fast-math mode

Hal Finkel hfinkel at anl.gov
Thu Sep 12 14:09:14 PDT 2013


With the patch this time ;)

 -Hal

----- Original Message -----
> On 09/12/2013 11:03 PM, Hal Finkel wrote:
> > Hello,
> >
> > Please review the attached patch which restores the libm sqrt* ->
> > @llvm.sqrt* mapping, but only in fast-math mode (specifically,
> > when the UnsafeFPMath or NoNaNsFPMath CodeGen options are
> > enabled). The @llvm.sqrt* intrinsics have slightly different
> > semantics from the libm call, specifically, they are undefined
> > when given a non-zero negative number (the libm calls will always
> > return NaN for any negative number).
> >
> > This mapping was removed in r100613, and replaced with a TODO, but
> > at that time the fast-math flags were not yet implemented. Now
> > that we have these, restoring this mapping is important because it
> > will enable autovectorization of sqrt calls in loops (at least in
> > fast-math mode).
> 
> Patch?
> 
> Tobias
> 
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sqrt-intrin-fm-mapping.patch
Type: text/x-patch
Size: 2617 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130912/290de1cd/attachment.bin>


More information about the cfe-commits mailing list