]> granicus.if.org Git - clang/commit
Process the -freciprocal-math optimization flag (PR20912)
authorSanjay Patel <spatel@rotateright.com>
Thu, 9 Apr 2015 15:03:23 +0000 (15:03 +0000)
committerSanjay Patel <spatel@rotateright.com>
Thu, 9 Apr 2015 15:03:23 +0000 (15:03 +0000)
commitd2eccb2430fadfc0ee144d7c34a042494c68a9be
treedd6a6128a7ee6d9f2416a9ed49428ae6e99cdbdd
parent16eb22d1dfcdf737dbcea19fcd5406156417dba2
Process the -freciprocal-math optimization flag (PR20912)

The driver currently accepts but ignores the -freciprocal-math flag.
This patch passes the flag through and enables 'arcp' fast-math-flag
generation in IR.

Note that this change does not actually enable the optimization for
any target. The reassociation optimization that this flag specifies
was implemented by http://reviews.llvm.org/D6334 :
http://llvm.org/viewvc/llvm-project?view=revision&revision=222510

Because the optimization is done in the backend rather than IR,
the backend must be modified to understand instruction-level
fast-math-flags or a new function-level attribute must be created.

Also note that -freciprocal-math is independent of any target-specific
usage of reciprocal estimate hardware instructions. That requires
its own flag ('-mrecip').

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234493 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Driver/Options.td
include/clang/Frontend/CodeGenOptions.def
lib/CodeGen/CodeGenFunction.cpp
lib/Driver/Tools.cpp
lib/Frontend/CompilerInvocation.cpp
test/CodeGen/finite-math.c
test/Driver/fast-math.c