mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 15:17:25 +00:00
[mips] Make sure sret argument is returned in register V0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166539 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -3539,10 +3539,11 @@ MipsTargetLowering::LowerReturn(SDValue Chain,
|
||||
if (!Reg)
|
||||
llvm_unreachable("sret virtual register not created in the entry block");
|
||||
SDValue Val = DAG.getCopyFromReg(Chain, dl, Reg, getPointerTy());
|
||||
unsigned V0 = IsN64 ? Mips::V0_64 : Mips::V0;
|
||||
|
||||
Chain = DAG.getCopyToReg(Chain, dl, IsN64 ? Mips::V0_64 : Mips::V0, Val,
|
||||
Flag);
|
||||
Chain = DAG.getCopyToReg(Chain, dl, V0, Val, Flag);
|
||||
Flag = Chain.getValue(1);
|
||||
MF.getRegInfo().addLiveOut(V0);
|
||||
}
|
||||
|
||||
// Return on Mips is always a "jr $ra"
|
||||
|
||||
Reference in New Issue
Block a user