forked from OSchip/llvm-project
[mips] Remove ByValArgInfo::Address in favour of CCValAssign::getMemLocOffset(). NFC.
Summary: ByValArgInfo is practically the same as CCState::ByValInfo now. Reviewers: vmedic Reviewed By: vmedic Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5976 llvm-svn: 221057
This commit is contained in:
parent
eac09608d0
commit
f43e68793b
|
@ -2647,7 +2647,7 @@ MipsTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
|
|||
assert(!IsTailCall &&
|
||||
"Do not tail-call optimize if there is a byval argument.");
|
||||
passByValArg(Chain, DL, RegsToPass, MemOpChains, StackPtr, MFI, DAG, Arg,
|
||||
MipsCCInfo, *ByValArg, Flags, Subtarget.isLittle());
|
||||
MipsCCInfo, *ByValArg, Flags, Subtarget.isLittle(), VA);
|
||||
++ByValArg;
|
||||
continue;
|
||||
}
|
||||
|
@ -2905,7 +2905,7 @@ MipsTargetLowering::LowerFormalArguments(SDValue Chain,
|
|||
"ByVal args of size 0 should have been ignored by front-end.");
|
||||
assert(ByValArg != MipsCCInfo.byval_end());
|
||||
copyByValRegs(Chain, DL, OutChains, DAG, Flags, InVals, &*FuncArg,
|
||||
MipsCCInfo, *ByValArg);
|
||||
MipsCCInfo, *ByValArg, VA);
|
||||
++ByValArg;
|
||||
continue;
|
||||
}
|
||||
|
@ -3676,10 +3676,9 @@ void MipsTargetLowering::MipsCC::handleByValArg(unsigned ValNo, MVT ValVT,
|
|||
allocateRegs(ByVal, ByValSize, Align, State);
|
||||
|
||||
// Allocate space on caller's stack.
|
||||
ByVal.Address =
|
||||
unsigned Offset =
|
||||
State.AllocateStack(ByValSize - RegSizeInBytes * ByVal.NumRegs, Align);
|
||||
State.addLoc(
|
||||
CCValAssign::getMem(ValNo, ValVT, ByVal.Address, LocVT, LocInfo));
|
||||
State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset, LocVT, LocInfo));
|
||||
ByValArgs.push_back(ByVal);
|
||||
}
|
||||
|
||||
|
@ -3737,11 +3736,11 @@ MVT MipsTargetLowering::MipsCC::getRegVT(MVT VT, const Type *OrigTy,
|
|||
return VT;
|
||||
}
|
||||
|
||||
void MipsTargetLowering::
|
||||
copyByValRegs(SDValue Chain, SDLoc DL, std::vector<SDValue> &OutChains,
|
||||
SelectionDAG &DAG, const ISD::ArgFlagsTy &Flags,
|
||||
SmallVectorImpl<SDValue> &InVals, const Argument *FuncArg,
|
||||
const MipsCC &CC, const ByValArgInfo &ByVal) const {
|
||||
void MipsTargetLowering::copyByValRegs(
|
||||
SDValue Chain, SDLoc DL, std::vector<SDValue> &OutChains, SelectionDAG &DAG,
|
||||
const ISD::ArgFlagsTy &Flags, SmallVectorImpl<SDValue> &InVals,
|
||||
const Argument *FuncArg, const MipsCC &CC, const ByValArgInfo &ByVal,
|
||||
const CCValAssign &VA) const {
|
||||
MachineFunction &MF = DAG.getMachineFunction();
|
||||
MachineFrameInfo *MFI = MF.getFrameInfo();
|
||||
unsigned GPRSizeInBytes = Subtarget.getGPRSizeInBytes();
|
||||
|
@ -3754,7 +3753,7 @@ copyByValRegs(SDValue Chain, SDLoc DL, std::vector<SDValue> &OutChains,
|
|||
(int)CC.reservedArgArea() -
|
||||
(int)((CC.intArgRegs().size() - ByVal.FirstIdx) * GPRSizeInBytes);
|
||||
else
|
||||
FrameObjOffset = ByVal.Address;
|
||||
FrameObjOffset = VA.getLocMemOffset();
|
||||
|
||||
// Create frame object.
|
||||
EVT PtrTy = getPointerTy();
|
||||
|
@ -3783,13 +3782,13 @@ copyByValRegs(SDValue Chain, SDLoc DL, std::vector<SDValue> &OutChains,
|
|||
}
|
||||
|
||||
// Copy byVal arg to registers and stack.
|
||||
void MipsTargetLowering::
|
||||
passByValArg(SDValue Chain, SDLoc DL,
|
||||
std::deque< std::pair<unsigned, SDValue> > &RegsToPass,
|
||||
SmallVectorImpl<SDValue> &MemOpChains, SDValue StackPtr,
|
||||
MachineFrameInfo *MFI, SelectionDAG &DAG, SDValue Arg,
|
||||
const MipsCC &CC, const ByValArgInfo &ByVal,
|
||||
const ISD::ArgFlagsTy &Flags, bool isLittle) const {
|
||||
void MipsTargetLowering::passByValArg(
|
||||
SDValue Chain, SDLoc DL,
|
||||
std::deque<std::pair<unsigned, SDValue>> &RegsToPass,
|
||||
SmallVectorImpl<SDValue> &MemOpChains, SDValue StackPtr,
|
||||
MachineFrameInfo *MFI, SelectionDAG &DAG, SDValue Arg, const MipsCC &CC,
|
||||
const ByValArgInfo &ByVal, const ISD::ArgFlagsTy &Flags, bool isLittle,
|
||||
const CCValAssign &VA) const {
|
||||
unsigned ByValSizeInBytes = Flags.getByValSize();
|
||||
unsigned OffsetInBytes = 0; // From beginning of struct
|
||||
unsigned RegSizeInBytes = Subtarget.getGPRSizeInBytes();
|
||||
|
@ -3873,7 +3872,7 @@ passByValArg(SDValue Chain, SDLoc DL,
|
|||
SDValue Src = DAG.getNode(ISD::ADD, DL, PtrTy, Arg,
|
||||
DAG.getConstant(OffsetInBytes, PtrTy));
|
||||
SDValue Dst = DAG.getNode(ISD::ADD, DL, PtrTy, StackPtr,
|
||||
DAG.getIntPtrConstant(ByVal.Address));
|
||||
DAG.getIntPtrConstant(VA.getLocMemOffset()));
|
||||
Chain = DAG.getMemcpy(Chain, DL, Dst, Src, DAG.getConstant(MemCpySize, PtrTy),
|
||||
Alignment, /*isVolatile=*/false, /*AlwaysInline=*/false,
|
||||
MachinePointerInfo(), MachinePointerInfo());
|
||||
|
|
|
@ -343,9 +343,8 @@ namespace llvm {
|
|||
struct ByValArgInfo {
|
||||
unsigned FirstIdx; // Index of the first register used.
|
||||
unsigned NumRegs; // Number of registers used for this argument.
|
||||
unsigned Address; // Offset of the stack area used to pass this argument.
|
||||
|
||||
ByValArgInfo() : FirstIdx(0), NumRegs(0), Address(0) {}
|
||||
ByValArgInfo() : FirstIdx(0), NumRegs(0) {}
|
||||
};
|
||||
|
||||
/// MipsCC - This class provides methods used to analyze formal and call
|
||||
|
@ -483,20 +482,20 @@ namespace llvm {
|
|||
/// copyByValArg - Copy argument registers which were used to pass a byval
|
||||
/// argument to the stack. Create a stack frame object for the byval
|
||||
/// argument.
|
||||
void copyByValRegs(SDValue Chain, SDLoc DL,
|
||||
std::vector<SDValue> &OutChains, SelectionDAG &DAG,
|
||||
const ISD::ArgFlagsTy &Flags,
|
||||
void copyByValRegs(SDValue Chain, SDLoc DL, std::vector<SDValue> &OutChains,
|
||||
SelectionDAG &DAG, const ISD::ArgFlagsTy &Flags,
|
||||
SmallVectorImpl<SDValue> &InVals,
|
||||
const Argument *FuncArg,
|
||||
const MipsCC &CC, const ByValArgInfo &ByVal) const;
|
||||
const Argument *FuncArg, const MipsCC &CC,
|
||||
const ByValArgInfo &ByVal, const CCValAssign &VA) const;
|
||||
|
||||
/// passByValArg - Pass a byval argument in registers or on stack.
|
||||
void passByValArg(SDValue Chain, SDLoc DL,
|
||||
std::deque< std::pair<unsigned, SDValue> > &RegsToPass,
|
||||
std::deque<std::pair<unsigned, SDValue>> &RegsToPass,
|
||||
SmallVectorImpl<SDValue> &MemOpChains, SDValue StackPtr,
|
||||
MachineFrameInfo *MFI, SelectionDAG &DAG, SDValue Arg,
|
||||
const MipsCC &CC, const ByValArgInfo &ByVal,
|
||||
const ISD::ArgFlagsTy &Flags, bool isLittle) const;
|
||||
const ISD::ArgFlagsTy &Flags, bool isLittle,
|
||||
const CCValAssign &VA) const;
|
||||
|
||||
/// writeVarArgRegs - Write variable function arguments passed in registers
|
||||
/// to the stack. Also create a stack frame object for the first variable
|
||||
|
|
Loading…
Reference in New Issue