[LLVMbugs] [Bug 21126] New: missed optimization: recognize square root squared

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Oct 1 15:57:52 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=21126

            Bug ID: 21126
           Summary: missed optimization: recognize square root squared
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: spatel+llvm at rotateright.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

It seems silly, but this actually happens in the real world...for example, in
code that does x ** 3/2 like:
http://benchmarksgame.alioth.debian.org/u32/program.php?test=nbody&lang=gcc&id=1

This should just return 'f':

$ cat sqrt_squared.ll
define double @foo(double %f) #0 {
  %sqrt = tail call double @llvm.sqrt.f64(double %f)
  %mul = fmul fast double %sqrt, %sqrt
  ret double %mul
}

; Function Attrs: nounwind readnone
declare double @llvm.sqrt.f64(double) #1

attributes #0 = { "unsafe-fp-math"="true" }
attributes #1 = { nounwind readnone

-- 
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/20141001/45eae43b/attachment.html>


More information about the llvm-bugs mailing list