LegalizeTypes support for promotion of SIGN_EXTEND_INREG.
[oota-llvm.git] / lib / CodeGen / SelectionDAG / LegalizeIntegerTypes.cpp
index 756057cf669cb9d28164ad10e42fc85abe4a4300..062e29e6ac6027ca7767069a37b901dd960610c6 100644 (file)
@@ -66,6 +66,8 @@ void DAGTypeLegalizer::PromoteIntegerResult(SDNode *N, unsigned ResNo) {
   case ISD::SELECT_CC:   Result = PromoteIntRes_SELECT_CC(N); break;
   case ISD::SETCC:       Result = PromoteIntRes_SETCC(N); break;
   case ISD::SHL:         Result = PromoteIntRes_SHL(N); break;
+  case ISD::SIGN_EXTEND_INREG:
+                         Result = PromoteIntRes_SIGN_EXTEND_INREG(N); break;
   case ISD::SRA:         Result = PromoteIntRes_SRA(N); break;
   case ISD::SRL:         Result = PromoteIntRes_SRL(N); break;
   case ISD::TRUNCATE:    Result = PromoteIntRes_TRUNCATE(N); break;
@@ -344,6 +346,12 @@ SDOperand DAGTypeLegalizer::PromoteIntRes_SHL(SDNode *N) {
                      GetPromotedInteger(N->getOperand(0)), N->getOperand(1));
 }
 
+SDOperand DAGTypeLegalizer::PromoteIntRes_SIGN_EXTEND_INREG(SDNode *N) {
+  SDOperand Op = GetPromotedInteger(N->getOperand(0));
+  return DAG.getNode(ISD::SIGN_EXTEND_INREG, Op.getValueType(), Op,
+                     N->getOperand(1));
+}
+
 SDOperand DAGTypeLegalizer::PromoteIntRes_SimpleIntBinOp(SDNode *N) {
   // The input may have strange things in the top bits of the registers, but
   // these operations don't care.  They may have weird bits going out, but