summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-01-05 23:33:44 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-01-05 23:33:44 +0000
commit5f80c450f3b57954a174e83c01217167fc149121 (patch)
tree45d8306b5fb4a2bef356f293427154c3be2f0b00 /llvm/lib
parent549163707c20b08ba5b7f39196dfc6e15c863035 (diff)
downloadbcm5719-llvm-5f80c450f3b57954a174e83c01217167fc149121.tar.gz
bcm5719-llvm-5f80c450f3b57954a174e83c01217167fc149121.zip
Expand fcopysign to the bitwise sequence if select is marked as expensive.
llvm-svn: 32940
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 3c4252a0c46..aad61477eff 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -2354,11 +2354,13 @@ 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()) ==
- TargetLowering::Legal &&
+ // 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) {
+ TargetLowering::Legal) {
// Get the sign bit of the RHS.
MVT::ValueType IVT =
Tmp2.getValueType() == MVT::f32 ? MVT::i32 : MVT::i64;
OpenPOWER on IntegriCloud