Restore previous behavior of defaulting to ZEXT. This works around two
authorReid Spencer <rspencer@reidspencer.com>
Wed, 3 Jan 2007 05:03:05 +0000 (05:03 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Wed, 3 Jan 2007 05:03:05 +0000 (05:03 +0000)
things: (1) preventing PR1071 and (2) working around missing parameter
attributes for bool type. (2) will be fixed shortly. When PR1071 is fixed,
this patch should be undone.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32831 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

index 5fb21a51ecc1cba747bd665df20549b768ad4039..70ff6d9584ff9101d21fd575361bd9c28f73039e 100644 (file)
@@ -766,17 +766,12 @@ void SelectionDAGLowering::visitRet(ReturnInst &I) {
       else
         TmpVT = MVT::i32;
       const FunctionType *FTy = I.getParent()->getParent()->getFunctionType();
-      ISD::NodeType ExtendKind = ISD::ANY_EXTEND;
+      ISD::NodeType ExtendKind = ISD::ZERO_EXTEND; // FIXME: ANY_EXTEND?
       if (FTy->paramHasAttr(0, FunctionType::SExtAttribute))
         ExtendKind = ISD::SIGN_EXTEND;
       if (FTy->paramHasAttr(0, FunctionType::ZExtAttribute))
         ExtendKind = ISD::ZERO_EXTEND;
-      if (ExtendKind == ISD::ANY_EXTEND)
-        // There was no specification for extension in the parameter attributes
-        // so we will just let the legalizer do the ANY_EXTEND
-        ;
-      else
-        RetOp = DAG.getNode(ExtendKind, TmpVT, RetOp);
+      RetOp = DAG.getNode(ExtendKind, TmpVT, RetOp);
     }
     NewValues.push_back(RetOp);
     NewValues.push_back(DAG.getConstant(false, MVT::i32));