24 static const MCPhysReg RegList[] = { ARM::R0, ARM::R1, ARM::R2, ARM::R3 };
53 if (!
f64AssignAPCS(ValNo, ValVT, LocVT, LocInfo, State,
true))
55 if (LocVT == MVT::v2f64 &&
65 static const MCPhysReg HiRegList[] = { ARM::R0, ARM::R2 };
66 static const MCPhysReg LoRegList[] = { ARM::R1, ARM::R3 };
67 static const MCPhysReg ShadowRegList[] = { ARM::R0, ARM::R1 };
70 unsigned Reg = State.
AllocateReg(HiRegList, ShadowRegList);
75 assert((!Reg || Reg == ARM::R3) &&
"Wrong GPRs usage for f64");
88 for (i = 0; i < 2; ++i)
89 if (HiRegList[i] == Reg)
94 assert(
T == LoRegList[i] &&
"Could not allocate register");
108 if (LocVT == MVT::v2f64 &&
116 static const MCPhysReg HiRegList[] = { ARM::R0, ARM::R2 };
117 static const MCPhysReg LoRegList[] = { ARM::R1, ARM::R3 };
119 unsigned Reg = State.
AllocateReg(HiRegList, LoRegList);
124 for (i = 0; i < 2; ++i)
125 if (HiRegList[i] == Reg)
140 if (LocVT == MVT::v2f64 && !
f64RetAssign(ValNo, ValVT, LocVT, LocInfo, State))
156 ARM::S4, ARM::S5, ARM::S6, ARM::S7,
157 ARM::S8, ARM::S9, ARM::S10, ARM::S11,
158 ARM::S12, ARM::S13, ARM::S14, ARM::S15 };
160 ARM::D4, ARM::D5, ARM::D6, ARM::D7 };
177 if (PendingMembers.
size() > 0)
178 assert(PendingMembers[0].getLocVT() == LocVT);
193 const Align StackAlign =
DL.getStackAlignment();
194 const Align FirstMemberAlign(PendingMembers[0].getExtraInfo());
195 Align Alignment = std::min(FirstMemberAlign, StackAlign);
206 while (RegIdx % RegAlign != 0 && RegIdx < RegList.
size())
233 for (
CCValAssign &PendingMember : PendingMembers) {
234 PendingMember.convertToReg(RegResult);
235 State.
addLoc(PendingMember);
238 PendingMembers.clear();
248 for (
auto &It : PendingMembers) {
249 if (RegIdx >= RegList.
size())
252 It.convertToReg(State.
AllocateReg(RegList[RegIdx++]));
256 PendingMembers.clear();
260 if (LocVT != MVT::i32)
264 for (
auto Reg : RegList)
274 for (
auto &It : PendingMembers) {
277 Alignment =
Align(1);
281 PendingMembers.
clear();
316#include "ARMGenCallingConv.inc"
static const MCPhysReg GPRArgRegs[]
static bool CC_ARM_AAPCS_VFP_Custom_f16(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
static bool f64RetAssign(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, CCState &State)
static const MCPhysReg RRegList[]
static bool RetCC_ARM_AAPCS_Custom_f64(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
static const MCPhysReg SRegList[]
static bool CC_ARM_AAPCS_Custom_Aggregate(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
static bool f64AssignAAPCS(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, CCState &State, bool CanFail)
static const MCPhysReg DRegList[]
static bool RetCC_ARM_APCS_Custom_f64(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
static bool CC_ARM_AAPCS_Custom_f64(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
static bool f64AssignAPCS(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, CCState &State, bool CanFail)
static const MCPhysReg QRegList[]
static bool CC_ARM_AAPCS_Custom_f16(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
static bool CC_ARM_APCS_Custom_f64(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
static bool CustomAssignInRegList(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, CCState &State, ArrayRef< MCPhysReg > RegList)
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool isTargetAEABI() const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
size - Get the array size.
CCState - This class holds information needed while lowering arguments and return values.
MachineFunction & getMachineFunction() const
unsigned getFirstUnallocated(ArrayRef< MCPhysReg > Regs) const
getFirstUnallocated - Return the index of the first unallocated register in the set,...
MCRegister AllocateReg(MCPhysReg Reg)
AllocateReg - Attempt to allocate one register.
MCPhysReg AllocateRegBlock(ArrayRef< MCPhysReg > Regs, unsigned RegsRequired)
AllocateRegBlock - Attempt to allocate a block of RegsRequired consecutive registers.
int64_t AllocateStack(unsigned Size, Align Alignment)
AllocateStack - Allocate a chunk of stack space with the specified size and alignment.
uint64_t getStackSize() const
Returns the size of the currently allocated portion of the stack.
SmallVectorImpl< CCValAssign > & getPendingLocs()
void addLoc(const CCValAssign &V)
CCValAssign - Represent assignment of one arg/retval to a location.
static CCValAssign getPending(unsigned ValNo, MVT ValVT, MVT LocVT, LocInfo HTP, unsigned ExtraInfo=0)
static CCValAssign getCustomReg(unsigned ValNo, MVT ValVT, unsigned RegNo, MVT LocVT, LocInfo HTP)
static CCValAssign getCustomMem(unsigned ValNo, MVT ValVT, int64_t Offset, MVT LocVT, LocInfo HTP)
TypeSize getSizeInBits() const
Returns the size of the specified MVT in bits.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
const DataLayout & getDataLayout() const
Return the DataLayout attached to the Module associated to this MF.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
This struct is a compact representation of a valid (non-zero power of two) alignment.
uint64_t value() const
This is a hole in the type system and should not be abused.
Align getNonZeroOrigAlign() const
bool isInConsecutiveRegsLast() const
Align getNonZeroMemAlign() const