[LLVMbugs] [Bug 20912] New: -freciprocal-math flag doesn't generate 'arcp' in LLVM IR

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Sep 11 12:15:34 PDT 2014


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

            Bug ID: 20912
           Summary: -freciprocal-math flag doesn't generate 'arcp' in LLVM
                    IR
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: spatel+llvm at rotateright.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

I'm filing this purely as a clang bug to generate the 'arcp' fast math flag
when -freciprocal-math is specified as a parameter. More changes are needed to
produce the correct machine code.

Reference: The addition of fast-math flags to LLVM IR happened in 2012:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-October/054999.html

...but there appears to have been very little follow-up in making those flags
actually do anything (see also bug 20870).

$ ./clang -v
clang version 3.6.0 (217587)
Target: x86_64-apple-darwin13.3.0
Thread model: posix

$ cat reciprocal.c
float reciprocal(float x) {
    return 1.0f / x;
}

$ ./clang -O1 -freciprocal-math reciprocal.c -emit-llvm -S -o -
...
  %div = fdiv float 1.000000e+00, %x ; "arcp" ???

-- 
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/20140911/9cc41e84/attachment.html>


More information about the llvm-bugs mailing list