[llvm-bugs] [Bug 24572] New: Comment describing isFsqrtCheap is probably wrong

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Aug 25 10:06:16 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=24572

            Bug ID: 24572
           Summary: Comment describing isFsqrtCheap is probably wrong
           Product: new-bugs
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: schnetter at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Line 221 of include/llvm/Target/TargetLowering.h describes isFsqrtCheap, and
says

/// Return true if sqrt(x) is as cheap or cheaper than 1 / rsqrt(x)

This sounds wrong: When one calculates sqrt(x) via rsqrt(x), one does not use
1/rsqrt(x) -- rather, one uses x*rsqrt(x).

I did not check what code LLVM generates in this case, but I assume it does not
use a division.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150825/48527710/attachment-0001.html>


More information about the llvm-bugs mailing list