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

Chris Lattner lattner at cs.uiuc.edu
Fri Jan 20 10:38:44 PST 2006



Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.271 -> 1.272
SelectionDAGISel.cpp updated: 1.128 -> 1.129
---
Log message:

If the target doesn't support f32 natively, insert the FP_EXTEND in target-indep
code, so that the LowerReturn code doesn't have to handle it.


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

 LegalizeDAG.cpp      |    5 +++--
 SelectionDAGISel.cpp |    4 ++++
 2 files changed, 7 insertions(+), 2 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.271 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.272
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.271	Wed Jan 18 22:54:52 2006
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp	Fri Jan 20 12:38:32 2006
@@ -3377,7 +3377,8 @@
 /// Found.
 static void FindLatestCallSeqStart(SDNode *Node, SDNode *&Found,
                                    std::set<SDNode*> &Visited) {
-  if (Node->getNodeDepth() <= Found->getNodeDepth() ||
+  if (/*Node->getNodeDepth() <= Found->getNodeDepth() ||*/
+      Node->getNumOperands() == 0 ||
       !Visited.insert(Node).second) return;
   
   // If we found an CALLSEQ_START, we already know this node occurs later
@@ -3404,7 +3405,7 @@
 /// than Found.
 static void FindEarliestCallSeqEnd(SDNode *Node, SDNode *&Found,
                                    std::set<SDNode*> &Visited) {
-  if ((Found && Node->getNodeDepth() >= Found->getNodeDepth()) ||
+  if (/*(Found && Node->getNodeDepth() >= Found->getNodeDepth()) ||*/
       !Visited.insert(Node).second) return;
 
   // If we found an CALLSEQ_END, we already know this node occurs earlier


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.128 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.129
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.128	Wed Jan 18 15:50:14 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp	Fri Jan 20 12:38:32 2006
@@ -490,6 +490,10 @@
       Op1 = DAG.getNode(ISD::ZERO_EXTEND, TmpVT, Op1);
     break;
   case MVT::f32:
+    // If this is a machine where f32 is promoted to f64, do so now.
+    if (TLI.getTypeAction(MVT::f32) == TargetLowering::Promote)
+      Op1 = DAG.getNode(ISD::FP_EXTEND, TLI.getTypeToTransformTo(MVT::f32),Op1);
+    break;
   case MVT::i64:
   case MVT::f64:
     break; // No extension needed!






More information about the llvm-commits mailing list