make reciprocal estimate code generation more flexible by adding command-line options...
authorSanjay Patel <spatel@rotateright.com>
Tue, 2 Jun 2015 15:28:15 +0000 (15:28 +0000)
committerSanjay Patel <spatel@rotateright.com>
Tue, 2 Jun 2015 15:28:15 +0000 (15:28 +0000)
commit871beb8dd7df339b5fac7640254098d5afa653ee
tree61da53997e857f26f826f08fa6ff24e0f78fd57a
parent1145b664341473fb91e33d58e0f0d2fd2e21fc24
make reciprocal estimate code generation more flexible by adding command-line options (2nd try)

The first try (r238051) to land this was reverted due to bot failures
that were hopefully addressed by r238788.

This patch adds a TargetRecip class for processing many recip codegen possibilities.
The class is intended to handle both command-line options to llc as well
as options passed in from a front-end such as clang with the -mrecip option.

The x86 backend is updated to use the new functionality.
Only -mcpu=btver2 with -ffast-math should see a functional change from this patch.
All other x86 CPUs continue to *not* use reciprocal estimates by default with -ffast-math.

Differential Revision: http://reviews.llvm.org/D8982

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238842 91177308-0d34-0410-b5e6-96231b3b80d8
12 files changed:
include/llvm/CodeGen/CommandFlags.h
include/llvm/Target/TargetOptions.h
include/llvm/Target/TargetRecip.h [new file with mode: 0644]
lib/Target/CMakeLists.txt
lib/Target/TargetRecip.cpp [new file with mode: 0644]
lib/Target/X86/X86.td
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86Subtarget.cpp
lib/Target/X86/X86Subtarget.h
lib/Target/X86/X86TargetMachine.cpp
test/CodeGen/X86/recip-fastmath.ll
test/CodeGen/X86/sqrt-fastmath.ll