aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-01-18 21:50:14 +0000
committerChris Lattner <sabre@nondot.org>2006-01-18 21:50:14 +0000
commitd12b2d7b5ae73c6f1b89a30f12e9d30e731b2e20 (patch)
tree59ef39ae122e134db8ef6856e2536b36bf0ba7bb /lib
parentc4e8c9f318a4cb9ff75d8955482a8ca6412803cd (diff)
downloadexternal_llvm-d12b2d7b5ae73c6f1b89a30f12e9d30e731b2e20.zip
external_llvm-d12b2d7b5ae73c6f1b89a30f12e9d30e731b2e20.tar.gz
external_llvm-d12b2d7b5ae73c6f1b89a30f12e9d30e731b2e20.tar.bz2
Temporary work around for a libcall insertion bug: If a target doesn't
support FSIN/FCOS nodes, do not lower sin/cos to them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25425 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index f3e2546..f977a73 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -1070,7 +1070,9 @@ void SelectionDAGLowering::visitCall(CallInst &I) {
} else if (Name[0] == 's' && (Name == "sin" || Name == "sinf")) {
if (I.getNumOperands() == 2 && // Basic sanity checks.
I.getOperand(1)->getType()->isFloatingPoint() &&
- I.getType() == I.getOperand(1)->getType()) {
+ I.getType() == I.getOperand(1)->getType() &&
+ TLI.isOperationLegal(ISD::FSIN,
+ TLI.getValueType(I.getOperand(1)->getType()))) {
SDOperand Tmp = getValue(I.getOperand(1));
setValue(&I, DAG.getNode(ISD::FSIN, Tmp.getValueType(), Tmp));
return;
@@ -1078,7 +1080,9 @@ void SelectionDAGLowering::visitCall(CallInst &I) {
} else if (Name[0] == 'c' && (Name == "cos" || Name == "cosf")) {
if (I.getNumOperands() == 2 && // Basic sanity checks.
I.getOperand(1)->getType()->isFloatingPoint() &&
- I.getType() == I.getOperand(1)->getType()) {
+ I.getType() == I.getOperand(1)->getType() &&
+ TLI.isOperationLegal(ISD::FCOS,
+ TLI.getValueType(I.getOperand(1)->getType()))) {
SDOperand Tmp = getValue(I.getOperand(1));
setValue(&I, DAG.getNode(ISD::FCOS, Tmp.getValueType(), Tmp));
return;