llvm.org GIT mirror llvm / 605a80b
[mips] Remove remaining use of MipsCC::intArgRegs() in favour of MipsABIInfo::GetByValArgRegs() and MipsABIInfo::GetVarArgRegs() Summary: Depends on D6112 Reviewers: theraven, vmedic Reviewed By: vmedic Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6113 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221521 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Sanders 6 years ago
4 changed file(s) with 18 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
2626 return makeArrayRef(Mips64IntRegs);
2727 llvm_unreachable("Unhandled ABI");
2828 }
29
30 const ArrayRef MipsABIInfo::GetVarArgRegs() const {
31 if (IsO32())
32 return makeArrayRef(O32IntRegs);
33 if (IsN32() || IsN64())
34 return makeArrayRef(Mips64IntRegs);
35 llvm_unreachable("Unhandled ABI");
36 }
3737 bool IsEABI() const { return ThisABI == ABI::EABI; }
3838 ABI GetEnumValue() const { return ThisABI; }
3939
40 /// The registers to use for byval arguments.
4041 const ArrayRef GetByValArgRegs() const;
42
43 /// The registers to use for the variable argument list.
44 const ArrayRef GetVarArgRegs() const;
4145
4246 /// Ordering of ABI's
4347 /// MipsGenSubtargetInfo.inc will use this to resolve conflicts when given
36273627 return (Subtarget.isABI_O32() && (CallConv != CallingConv::Fast)) ? 16 : 0;
36283628 }
36293629
3630 const ArrayRef MipsTargetLowering::MipsCC::intArgRegs() const {
3631 if (Subtarget.isABI_O32())
3632 return makeArrayRef(O32IntRegs);
3633 return makeArrayRef(Mips64IntRegs);
3634 }
3635
36363630 void MipsTargetLowering::copyByValRegs(
36373631 SDValue Chain, SDLoc DL, std::vector &OutChains, SelectionDAG &DAG,
36383632 const ISD::ArgFlagsTy &Flags, SmallVectorImpl &InVals,
36453639 unsigned RegAreaSize = NumRegs * GPRSizeInBytes;
36463640 unsigned FrameObjSize = std::max(Flags.getByValSize(), RegAreaSize);
36473641 int FrameObjOffset;
3642 ArrayRef ByValArgRegs = Subtarget.getABI().GetByValArgRegs();
36483643
36493644 if (RegAreaSize)
3650 FrameObjOffset =
3651 (int)CC.reservedArgArea() -
3652 (int)((CC.intArgRegs().size() - FirstReg) * GPRSizeInBytes);
3645 FrameObjOffset = (int)CC.reservedArgArea() -
3646 (int)((ByValArgRegs.size() - FirstReg) * GPRSizeInBytes);
36533647 else
36543648 FrameObjOffset = VA.getLocMemOffset();
36553649
36673661 const TargetRegisterClass *RC = getRegClassFor(RegTy);
36683662
36693663 for (unsigned I = 0; I < NumRegs; ++I) {
3670 unsigned ArgReg = CC.intArgRegs()[FirstReg + I];
3664 unsigned ArgReg = ByValArgRegs[FirstReg + I];
36713665 unsigned VReg = addLiveIn(MF, ArgReg, RC);
36723666 unsigned Offset = I * GPRSizeInBytes;
36733667 SDValue StorePtr = DAG.getNode(ISD::ADD, DL, PtrTy, FIN,
36953689 unsigned NumRegs = LastReg - FirstReg;
36963690
36973691 if (NumRegs) {
3698 const ArrayRef ArgRegs = CC.intArgRegs();
3692 const ArrayRef ArgRegs = Subtarget.getABI().GetByValArgRegs();
36993693 bool LeftoverBytes = (NumRegs * RegSizeInBytes > ByValSizeInBytes);
37003694 unsigned I = 0;
37013695
37783772 const MipsCC &CC, SDValue Chain,
37793773 SDLoc DL, SelectionDAG &DAG,
37803774 CCState &State) const {
3781 const ArrayRef ArgRegs = CC.intArgRegs();
3775 const ArrayRef ArgRegs = Subtarget.getABI().GetVarArgRegs();
37823776 unsigned Idx = State.getFirstUnallocated(ArgRegs.data(), ArgRegs.size());
37833777 unsigned RegSizeInBytes = Subtarget.getGPRSizeInBytes();
37843778 MVT RegTy = MVT::getIntegerVT(RegSizeInBytes * 8);
365365 /// reservedArgArea - The size of the area the caller reserves for
366366 /// register arguments. This is 16-byte if ABI is O32.
367367 unsigned reservedArgArea() const;
368
369 /// Return pointer to array of integer argument registers.
370 const ArrayRef intArgRegs() const;
371368
372369 private:
373370 CallingConv::ID CallConv;