From ec57fd91af6be26a29535e7dd3dcb63beb71d898 Mon Sep 17 00:00:00 2001 From: Nate Begeman Date: Tue, 9 May 2006 18:20:51 +0000 Subject: [PATCH] Fix PR773 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28207 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 45c686b4cdc..cf11c97f980 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -3071,8 +3071,26 @@ SDOperand SelectionDAGLegalize::PromoteOp(SDOperand Op) { case ISD::FREM: case ISD::FCOPYSIGN: // These operators require that their input be fp extended. - Tmp1 = PromoteOp(Node->getOperand(0)); - Tmp2 = PromoteOp(Node->getOperand(1)); + switch (getTypeAction(Node->getOperand(0).getValueType())) { + case Legal: + Tmp1 = LegalizeOp(Node->getOperand(0)); + break; + case Promote: + Tmp1 = PromoteOp(Node->getOperand(0)); + break; + case Expand: + assert(0 && "not implemented"); + } + switch (getTypeAction(Node->getOperand(1).getValueType())) { + case Legal: + Tmp2 = LegalizeOp(Node->getOperand(1)); + break; + case Promote: + Tmp2 = PromoteOp(Node->getOperand(1)); + break; + case Expand: + assert(0 && "not implemented"); + } Result = DAG.getNode(Node->getOpcode(), NVT, Tmp1, Tmp2); // Perform FP_ROUND: this is probably overly pessimistic.