diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 63530deac71..1e976e3f680 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -1071,9 +1071,11 @@ SDOperand SelectionDAGLegalize::PromoteOp(SDOperand Op) { Result = PromoteOp(Node->getOperand(0)); // The high bits are not guaranteed to be anything. Insert an extend. if (Node->getOpcode() == ISD::SIGN_EXTEND) - Result = DAG.getNode(ISD::SIGN_EXTEND_INREG, NVT, Result, VT); + Result = DAG.getNode(ISD::SIGN_EXTEND_INREG, NVT, Result, + Node->getOperand(0).getValueType()); else - Result = DAG.getNode(ISD::ZERO_EXTEND_INREG, NVT, Result, VT); + Result = DAG.getNode(ISD::ZERO_EXTEND_INREG, NVT, Result, + Node->getOperand(0).getValueType()); break; } break;