Teach SDISel to combine fsin / fcos into a fsincos node if the following
authorEvan Cheng <evan.cheng@apple.com>
Tue, 29 Jan 2013 02:32:37 +0000 (02:32 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Tue, 29 Jan 2013 02:32:37 +0000 (02:32 +0000)
commit8688a58c53b46d2dda9bf50dafd5195790a7ed58
tree68af412e23ec1d2cb1ddf89586314551b36bd82d
parent8232ece5c1e57efe54342fb35610497d50bf894f
Teach SDISel to combine fsin / fcos into a fsincos node if the following
conditions are met:
1. They share the same operand and are in the same BB.
2. Both outputs are used.
3. The target has a native instruction that maps to ISD::FSINCOS node or
   the target provides a sincos library call.

Implemented the generic optimization in sdisel and enabled it for
Mac OSX. Also added an additional optimization for x86_64 Mac OSX by
using an alternative entry point __sincos_stret which returns the two
results in xmm0 / xmm1.

rdar://13087969
PR13204

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173755 91177308-0d34-0410-b5e6-96231b3b80d8
15 files changed:
include/llvm/CodeGen/ISDOpcodes.h
include/llvm/CodeGen/RuntimeLibcalls.h
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
lib/CodeGen/TargetLoweringBase.cpp
lib/Target/ARM/ARMISelLowering.cpp
lib/Target/Hexagon/HexagonISelLowering.cpp
lib/Target/MBlaze/MBlazeISelLowering.cpp
lib/Target/Mips/MipsISelLowering.cpp
lib/Target/PowerPC/PPCISelLowering.cpp
lib/Target/Sparc/SparcISelLowering.cpp
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86ISelLowering.h
lib/Target/X86/X86Subtarget.cpp
lib/Target/X86/X86Subtarget.h