[Target] remove TargetRecip class; move reciprocal estimate isel functionality to...
authorSanjay Patel <spatel@rotateright.com>
Tue, 18 Oct 2016 17:05:05 +0000 (17:05 +0000)
committerSanjay Patel <spatel@rotateright.com>
Tue, 18 Oct 2016 17:05:05 +0000 (17:05 +0000)
commit08fff9ca81266dde1718bff85cffa64087af9e37
tree0cac555a415565dfa2b0a41a75f10351e4327474
parentef634ecddde9dc73db8c2ff74cc937c03b020c2d
[Target] remove TargetRecip class; move reciprocal estimate isel functionality to TargetLowering

This is a follow-up to D24816 - where we changed reciprocal estimates to be function attributes
rather than TargetOptions.

This patch is intended to be a structural, but not functional change. By moving all of the
TargetRecip functionality into TargetLowering, we can remove all of the reciprocal estimate
state, shield the callers from the string format implementation, and simplify/localize the
logic needed for a target to enable this.

If a function has a "reciprocal-estimates" attribute, those settings may override the target's
default reciprocal preferences for whatever operation and data type we're trying to optimize.
If there's no attribute string or specific setting for the op/type pair, just use the target
default settings.

As noted earlier, a better solution would be to move the reciprocal estimate settings to IR
instructions and SDNodes rather than function attributes, but that's a multi-step job that
requires infrastructure improvements. I intend to work on that, but it's not clear how long
it will take to get all the pieces in place.

Differential Revision: https://reviews.llvm.org/D25440

llvm-svn: 284495
13 files changed:
llvm/include/llvm/Target/TargetLowering.h
llvm/include/llvm/Target/TargetOptions.h
llvm/include/llvm/Target/TargetRecip.h [deleted file]
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/lib/CodeGen/TargetLoweringBase.cpp
llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
llvm/lib/Target/AMDGPU/AMDGPUISelLowering.h
llvm/lib/Target/CMakeLists.txt
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/lib/Target/PowerPC/PPCISelLowering.h
llvm/lib/Target/TargetRecip.cpp [deleted file]
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/lib/Target/X86/X86ISelLowering.h