aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeDAG.cpp5
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp4
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 2cb6be59a2..8d5c2d030d 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -3377,7 +3377,8 @@ bool SelectionDAGLegalize::ExpandShift(unsigned Opc, SDOperand Op,SDOperand Amt,
/// 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 @@ static void FindLatestCallSeqStart(SDNode *Node, SDNode *&Found,
/// 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
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index f977a73484..02ae7108ae 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -490,6 +490,10 @@ void SelectionDAGLowering::visitRet(ReturnInst &I) {
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!