diff options
| author | Chris Lattner <sabre@nondot.org> | 2005-09-02 01:24:55 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2005-09-02 01:24:55 +0000 |
| commit | 763a3a0fa75c710384a6b3263501cbe5cc51eea4 (patch) | |
| tree | 1fde9c644e8e5234300f9fc75d46a6f69dcff585 /llvm/lib | |
| parent | d9af1aab517ac7104e033bddceb4f12b6dacf8a6 (diff) | |
| download | bcm5719-llvm-763a3a0fa75c710384a6b3263501cbe5cc51eea4.tar.gz bcm5719-llvm-763a3a0fa75c710384a6b3263501cbe5cc51eea4.zip | |
Restore this patch now that the latent bug has been fixed
llvm-svn: 23209
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/PowerPC/PPCISelLowering.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp index 5b77784819f..8490adb3c33 100644 --- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp @@ -613,8 +613,12 @@ PPC32TargetLowering::LowerCallTo(SDOperand Chain, std::vector<MVT::ValueType> RetVals; MVT::ValueType RetTyVT = getValueType(RetTy); + MVT::ValueType ActualRetTyVT = RetTyVT; + if (RetTyVT >= MVT::i1 && RetTyVT <= MVT::i16) + ActualRetTyVT = MVT::i32; // Promote result to i32. + if (RetTyVT != MVT::isVoid) - RetVals.push_back(RetTyVT); + RetVals.push_back(ActualRetTyVT); RetVals.push_back(MVT::Other); SDOperand TheCall = SDOperand(DAG.getCall(RetVals, @@ -622,7 +626,17 @@ PPC32TargetLowering::LowerCallTo(SDOperand Chain, Chain = TheCall.getValue(RetTyVT != MVT::isVoid); Chain = DAG.getNode(ISD::CALLSEQ_END, MVT::Other, Chain, DAG.getConstant(NumBytes, getPointerTy())); - return std::make_pair(TheCall, Chain); + SDOperand RetVal = TheCall; + + // If the result is a small value, add a note so that we keep track of the + // information about whether it is sign or zero extended. + if (RetTyVT != ActualRetTyVT) { + RetVal = DAG.getNode(RetTy->isSigned() ? ISD::AssertSext : ISD::AssertZext, + MVT::i32, RetVal, DAG.getValueType(RetTyVT)); + RetVal = DAG.getNode(ISD::TRUNCATE, RetTyVT, RetVal); + } + + return std::make_pair(RetVal, Chain); } SDOperand PPC32TargetLowering::LowerVAStart(SDOperand Chain, SDOperand VAListP, |

