Expand fcopysign to the bitwise sequence if select is marked as expensive.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32940 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2007-01-05 23:33:44 +00:00
parent 257464a072
commit 636c753b6b

View File

@ -2354,8 +2354,10 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
break;
case TargetLowering::Legal: break;
case TargetLowering::Expand: {
// If this target supports fabs/fneg natively, do this efficiently.
if (TLI.getOperationAction(ISD::FABS, Tmp1.getValueType()) ==
// If this target supports fabs/fneg natively and select is cheap,
// do this efficiently.
if (!TLI.isSelectExpensive() &&
TLI.getOperationAction(ISD::FABS, Tmp1.getValueType()) ==
TargetLowering::Legal &&
TLI.getOperationAction(ISD::FNEG, Tmp1.getValueType()) ==
TargetLowering::Legal) {