Restore previous behavior of defaulting to ZEXT. This works around two

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
This commit is contained in:
Reid Spencer 2007-01-03 05:03:05 +00:00
parent 8c57dfb1ae
commit 376dd212f9

View 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));