[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Jan 18 13:50:26 PST 2006



Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.127 -> 1.128
---
Log message:

Temporary work around for a libcall insertion bug: If a target doesn't
support FSIN/FCOS nodes, do not lower sin/cos to them.


---
Diffs of the changes:  (+6 -2)

 SelectionDAGISel.cpp |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.127 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.128
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.127	Tue Jan 17 14:06:42 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp	Wed Jan 18 15:50:14 2006
@@ -1070,7 +1070,9 @@
         } 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 @@
         } 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;






More information about the llvm-commits mailing list