diff options
| author | Akira Hatanaka <ahatanaka@mips.com> | 2012-10-10 01:27:09 +0000 |
|---|---|---|
| committer | Akira Hatanaka <ahatanaka@mips.com> | 2012-10-10 01:27:09 +0000 |
| commit | 9c8dcfc73a25704814d5ea90f3714de794788c56 (patch) | |
| tree | f91ba3a689e43d9e627dede4ca1e9ca95e791187 /llvm/lib/Target | |
| parent | 8772bd8569306e3d95c2fb9cab9274ea759d5d46 (diff) | |
| download | bcm5719-llvm-9c8dcfc73a25704814d5ea90f3714de794788c56.tar.gz bcm5719-llvm-9c8dcfc73a25704814d5ea90f3714de794788c56.zip | |
Implement MipsTargetLowering::CanLowerReturn.
Patch by Sasa Stankovic.
llvm-svn: 165585
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/Mips/MipsISelLowering.cpp | 17 | ||||
| -rw-r--r-- | llvm/lib/Target/Mips/MipsISelLowering.h | 6 |
2 files changed, 22 insertions, 1 deletions
diff --git a/llvm/lib/Target/Mips/MipsISelLowering.cpp b/llvm/lib/Target/Mips/MipsISelLowering.cpp index 362317b2822..2236af9a7b6 100644 --- a/llvm/lib/Target/Mips/MipsISelLowering.cpp +++ b/llvm/lib/Target/Mips/MipsISelLowering.cpp @@ -2597,7 +2597,11 @@ static bool CC_MipsO32(unsigned ValNo, MVT ValVT, llvm_unreachable("Cannot handle this ValVT."); unsigned SizeInBytes = ValVT.getSizeInBits() >> 3; - unsigned Offset = State.AllocateStack(SizeInBytes, OrigAlign); + unsigned Offset; + if (!ArgFlags.isSRet()) + Offset = State.AllocateStack(SizeInBytes, OrigAlign); + else + Offset = State.AllocateStack(SizeInBytes, SizeInBytes); if (!Reg) State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset, LocVT, LocInfo)); @@ -3440,6 +3444,17 @@ MipsTargetLowering::LowerFormalArguments(SDValue Chain, // Return Value Calling Convention Implementation //===----------------------------------------------------------------------===// +bool +MipsTargetLowering::CanLowerReturn(CallingConv::ID CallConv, + MachineFunction &MF, bool isVarArg, + const SmallVectorImpl<ISD::OutputArg> &Outs, + LLVMContext &Context) const { + SmallVector<CCValAssign, 16> RVLocs; + CCState CCInfo(CallConv, isVarArg, MF, getTargetMachine(), + RVLocs, Context); + return CCInfo.CheckReturn(Outs, RetCC_Mips); +} + SDValue MipsTargetLowering::LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, diff --git a/llvm/lib/Target/Mips/MipsISelLowering.h b/llvm/lib/Target/Mips/MipsISelLowering.h index b4cc16c1ca2..28d126b62c6 100644 --- a/llvm/lib/Target/Mips/MipsISelLowering.h +++ b/llvm/lib/Target/Mips/MipsISelLowering.h @@ -216,6 +216,12 @@ namespace llvm { LowerCall(TargetLowering::CallLoweringInfo &CLI, SmallVectorImpl<SDValue> &InVals) const; + virtual bool + CanLowerReturn(CallingConv::ID CallConv, MachineFunction &MF, + bool isVarArg, + const SmallVectorImpl<ISD::OutputArg> &Outs, + LLVMContext &Context) const; + virtual SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, |

