diff options
author | Sanjay Patel <spatel@rotateright.com> | 2015-05-22 21:10:06 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2015-05-22 21:10:06 +0000 |
commit | ba2ba80302182bcf1773c560b592949cd9a1d501 (patch) | |
tree | 925620c95192cb142122963aa9512b1676a00243 /llvm/lib/Target/X86/X86TargetMachine.cpp | |
parent | b2f6afb30ac3285f2d2db310ed283398860f12fc (diff) | |
download | bcm5719-llvm-ba2ba80302182bcf1773c560b592949cd9a1d501.tar.gz bcm5719-llvm-ba2ba80302182bcf1773c560b592949cd9a1d501.zip |
make reciprocal estimate code generation more flexible by adding command-line options
This patch adds a class for processing many recip codegen possibilities.
The TargetRecip 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 CPUs continue to *not* use reciprocal estimates by default with -ffast-math.
Differential Revision: http://reviews.llvm.org/D8982
llvm-svn: 238051
Diffstat (limited to 'llvm/lib/Target/X86/X86TargetMachine.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86TargetMachine.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86TargetMachine.cpp b/llvm/lib/Target/X86/X86TargetMachine.cpp index 3e5f1d82202..33576f1771f 100644 --- a/llvm/lib/Target/X86/X86TargetMachine.cpp +++ b/llvm/lib/Target/X86/X86TargetMachine.cpp @@ -105,6 +105,13 @@ X86TargetMachine::X86TargetMachine(const Target &T, StringRef TT, StringRef CPU, if (Subtarget.isTargetWin64()) this->Options.TrapUnreachable = true; + // TODO: By default, all reciprocal estimate operations are off because + // that matches the behavior before TargetRecip was added (except for btver2 + // which used subtarget features to enable this type of codegen). + // We should change this to match GCC behavior where everything but + // scalar division estimates are turned on by default with -ffast-math. + this->Options.Reciprocals.setDefaults("all", false, 1); + initAsmInfo(); } |