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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to