forked from OSchip/llvm-project
Make consistent use of MCPhysReg instead of uint16_t throughout the tree.
llvm-svn: 205610
This commit is contained in:
parent
79ed5d44e7
commit
840beec2d0
|
@ -279,7 +279,7 @@ public:
|
||||||
|
|
||||||
/// getFirstUnallocated - Return the first unallocated register in the set, or
|
/// getFirstUnallocated - Return the first unallocated register in the set, or
|
||||||
/// NumRegs if they are all allocated.
|
/// NumRegs if they are all allocated.
|
||||||
unsigned getFirstUnallocated(const uint16_t *Regs, unsigned NumRegs) const {
|
unsigned getFirstUnallocated(const MCPhysReg *Regs, unsigned NumRegs) const {
|
||||||
for (unsigned i = 0; i != NumRegs; ++i)
|
for (unsigned i = 0; i != NumRegs; ++i)
|
||||||
if (!isAllocated(Regs[i]))
|
if (!isAllocated(Regs[i]))
|
||||||
return i;
|
return i;
|
||||||
|
@ -306,7 +306,7 @@ public:
|
||||||
/// AllocateReg - Attempt to allocate one of the specified registers. If none
|
/// AllocateReg - Attempt to allocate one of the specified registers. If none
|
||||||
/// are available, return zero. Otherwise, return the first one available,
|
/// are available, return zero. Otherwise, return the first one available,
|
||||||
/// marking it and any aliases as allocated.
|
/// marking it and any aliases as allocated.
|
||||||
unsigned AllocateReg(const uint16_t *Regs, unsigned NumRegs) {
|
unsigned AllocateReg(const MCPhysReg *Regs, unsigned NumRegs) {
|
||||||
unsigned FirstUnalloc = getFirstUnallocated(Regs, NumRegs);
|
unsigned FirstUnalloc = getFirstUnallocated(Regs, NumRegs);
|
||||||
if (FirstUnalloc == NumRegs)
|
if (FirstUnalloc == NumRegs)
|
||||||
return 0; // Didn't find the reg.
|
return 0; // Didn't find the reg.
|
||||||
|
@ -318,7 +318,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Version of AllocateReg with list of registers to be shadowed.
|
/// Version of AllocateReg with list of registers to be shadowed.
|
||||||
unsigned AllocateReg(const uint16_t *Regs, const uint16_t *ShadowRegs,
|
unsigned AllocateReg(const MCPhysReg *Regs, const MCPhysReg *ShadowRegs,
|
||||||
unsigned NumRegs) {
|
unsigned NumRegs) {
|
||||||
unsigned FirstUnalloc = getFirstUnallocated(Regs, NumRegs);
|
unsigned FirstUnalloc = getFirstUnallocated(Regs, NumRegs);
|
||||||
if (FirstUnalloc == NumRegs)
|
if (FirstUnalloc == NumRegs)
|
||||||
|
@ -351,7 +351,7 @@ public:
|
||||||
/// Version of AllocateStack with list of extra registers to be shadowed.
|
/// Version of AllocateStack with list of extra registers to be shadowed.
|
||||||
/// Note that, unlike AllocateReg, this shadows ALL of the shadow registers.
|
/// Note that, unlike AllocateReg, this shadows ALL of the shadow registers.
|
||||||
unsigned AllocateStack(unsigned Size, unsigned Align,
|
unsigned AllocateStack(unsigned Size, unsigned Align,
|
||||||
const uint16_t *ShadowRegs, unsigned NumShadowRegs) {
|
const MCPhysReg *ShadowRegs, unsigned NumShadowRegs) {
|
||||||
for (unsigned i = 0; i < NumShadowRegs; ++i)
|
for (unsigned i = 0; i < NumShadowRegs; ++i)
|
||||||
MarkAllocated(ShadowRegs[i]);
|
MarkAllocated(ShadowRegs[i]);
|
||||||
return AllocateStack(Size, Align);
|
return AllocateStack(Size, Align);
|
||||||
|
|
|
@ -54,7 +54,7 @@ class RegisterClassInfo {
|
||||||
|
|
||||||
// Callee saved registers of last MF. Assumed to be valid until the next
|
// Callee saved registers of last MF. Assumed to be valid until the next
|
||||||
// runOnFunction() call.
|
// runOnFunction() call.
|
||||||
const uint16_t *CalleeSaved;
|
const MCPhysReg *CalleeSaved;
|
||||||
|
|
||||||
// Map register number to CalleeSaved index + 1;
|
// Map register number to CalleeSaved index + 1;
|
||||||
SmallVector<uint8_t, 4> CSRNum;
|
SmallVector<uint8_t, 4> CSRNum;
|
||||||
|
|
|
@ -159,7 +159,7 @@ private:
|
||||||
const MCRegisterClass *Classes; // Pointer to the regclass array
|
const MCRegisterClass *Classes; // Pointer to the regclass array
|
||||||
unsigned NumClasses; // Number of entries in the array
|
unsigned NumClasses; // Number of entries in the array
|
||||||
unsigned NumRegUnits; // Number of regunits.
|
unsigned NumRegUnits; // Number of regunits.
|
||||||
const uint16_t (*RegUnitRoots)[2]; // Pointer to regunit root table.
|
const MCPhysReg (*RegUnitRoots)[2]; // Pointer to regunit root table.
|
||||||
const MCPhysReg *DiffLists; // Pointer to the difflists array
|
const MCPhysReg *DiffLists; // Pointer to the difflists array
|
||||||
const char *RegStrings; // Pointer to the string table.
|
const char *RegStrings; // Pointer to the string table.
|
||||||
const uint16_t *SubRegIndices; // Pointer to the subreg lookup
|
const uint16_t *SubRegIndices; // Pointer to the subreg lookup
|
||||||
|
@ -239,7 +239,7 @@ public:
|
||||||
void InitMCRegisterInfo(const MCRegisterDesc *D, unsigned NR, unsigned RA,
|
void InitMCRegisterInfo(const MCRegisterDesc *D, unsigned NR, unsigned RA,
|
||||||
unsigned PC,
|
unsigned PC,
|
||||||
const MCRegisterClass *C, unsigned NC,
|
const MCRegisterClass *C, unsigned NC,
|
||||||
const uint16_t (*RURoots)[2],
|
const MCPhysReg (*RURoots)[2],
|
||||||
unsigned NRU,
|
unsigned NRU,
|
||||||
const MCPhysReg *DL,
|
const MCPhysReg *DL,
|
||||||
const char *Strings,
|
const char *Strings,
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include "llvm/IR/CallSite.h"
|
#include "llvm/IR/CallSite.h"
|
||||||
#include "llvm/IR/CallingConv.h"
|
#include "llvm/IR/CallingConv.h"
|
||||||
#include "llvm/IR/InlineAsm.h"
|
#include "llvm/IR/InlineAsm.h"
|
||||||
|
#include "llvm/MC/MCRegisterInfo.h"
|
||||||
#include "llvm/Target/TargetCallingConv.h"
|
#include "llvm/Target/TargetCallingConv.h"
|
||||||
#include "llvm/Target/TargetMachine.h"
|
#include "llvm/Target/TargetMachine.h"
|
||||||
#include <climits>
|
#include <climits>
|
||||||
|
@ -2170,7 +2171,7 @@ public:
|
||||||
|
|
||||||
/// Returns a 0 terminated array of registers that can be safely used as
|
/// Returns a 0 terminated array of registers that can be safely used as
|
||||||
/// scratch registers.
|
/// scratch registers.
|
||||||
virtual const uint16_t *getScratchRegisters(CallingConv::ID CC) const {
|
virtual const MCPhysReg *getScratchRegisters(CallingConv::ID CC) const {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -169,7 +169,7 @@ void AggressiveAntiDepBreaker::StartBlock(MachineBasicBlock *BB) {
|
||||||
// callee-saved register that is not saved in the prolog.
|
// callee-saved register that is not saved in the prolog.
|
||||||
const MachineFrameInfo *MFI = MF.getFrameInfo();
|
const MachineFrameInfo *MFI = MF.getFrameInfo();
|
||||||
BitVector Pristine = MFI->getPristineRegs(BB);
|
BitVector Pristine = MFI->getPristineRegs(BB);
|
||||||
for (const uint16_t *I = TRI->getCalleeSavedRegs(&MF); *I; ++I) {
|
for (const MCPhysReg *I = TRI->getCalleeSavedRegs(&MF); *I; ++I) {
|
||||||
unsigned Reg = *I;
|
unsigned Reg = *I;
|
||||||
if (!IsReturnBlock && !Pristine.test(Reg)) continue;
|
if (!IsReturnBlock && !Pristine.test(Reg)) continue;
|
||||||
for (MCRegAliasIterator AI(Reg, TRI, true); AI.isValid(); ++AI) {
|
for (MCRegAliasIterator AI(Reg, TRI, true); AI.isValid(); ++AI) {
|
||||||
|
|
|
@ -75,7 +75,7 @@ void CriticalAntiDepBreaker::StartBlock(MachineBasicBlock *BB) {
|
||||||
// callee-saved register that is not saved in the prolog.
|
// callee-saved register that is not saved in the prolog.
|
||||||
const MachineFrameInfo *MFI = MF.getFrameInfo();
|
const MachineFrameInfo *MFI = MF.getFrameInfo();
|
||||||
BitVector Pristine = MFI->getPristineRegs(BB);
|
BitVector Pristine = MFI->getPristineRegs(BB);
|
||||||
for (const uint16_t *I = TRI->getCalleeSavedRegs(&MF); *I; ++I) {
|
for (const MCPhysReg *I = TRI->getCalleeSavedRegs(&MF); *I; ++I) {
|
||||||
if (!IsReturnBlock && !Pristine.test(*I)) continue;
|
if (!IsReturnBlock && !Pristine.test(*I)) continue;
|
||||||
for (MCRegAliasIterator AI(*I, TRI, true); AI.isValid(); ++AI) {
|
for (MCRegAliasIterator AI(*I, TRI, true); AI.isValid(); ++AI) {
|
||||||
unsigned Reg = *AI;
|
unsigned Reg = *AI;
|
||||||
|
|
|
@ -583,7 +583,7 @@ MachineFrameInfo::getPristineRegs(const MachineBasicBlock *MBB) const {
|
||||||
if (!isCalleeSavedInfoValid())
|
if (!isCalleeSavedInfoValid())
|
||||||
return BV;
|
return BV;
|
||||||
|
|
||||||
for (const uint16_t *CSR = TRI->getCalleeSavedRegs(MF); CSR && *CSR; ++CSR)
|
for (const MCPhysReg *CSR = TRI->getCalleeSavedRegs(MF); CSR && *CSR; ++CSR)
|
||||||
BV.set(*CSR);
|
BV.set(*CSR);
|
||||||
|
|
||||||
// The entry MBB always has all CSRs pristine.
|
// The entry MBB always has all CSRs pristine.
|
||||||
|
|
|
@ -243,7 +243,7 @@ void PEI::calculateCalleeSavedRegisters(MachineFunction &F) {
|
||||||
MachineFrameInfo *MFI = F.getFrameInfo();
|
MachineFrameInfo *MFI = F.getFrameInfo();
|
||||||
|
|
||||||
// Get the callee saved register list...
|
// Get the callee saved register list...
|
||||||
const uint16_t *CSRegs = RegInfo->getCalleeSavedRegs(&F);
|
const MCPhysReg *CSRegs = RegInfo->getCalleeSavedRegs(&F);
|
||||||
|
|
||||||
// These are used to keep track the callee-save area. Initialize them.
|
// These are used to keep track the callee-save area. Initialize them.
|
||||||
MinCSFrameIndex = INT_MAX;
|
MinCSFrameIndex = INT_MAX;
|
||||||
|
|
|
@ -215,7 +215,7 @@ PBQPRAProblem *PBQPBuilder::build(MachineFunction *mf, const LiveIntervals *lis,
|
||||||
// Compute an initial allowed set for the current vreg.
|
// Compute an initial allowed set for the current vreg.
|
||||||
typedef std::vector<unsigned> VRAllowed;
|
typedef std::vector<unsigned> VRAllowed;
|
||||||
VRAllowed vrAllowed;
|
VRAllowed vrAllowed;
|
||||||
ArrayRef<uint16_t> rawOrder = trc->getRawAllocationOrder(*mf);
|
ArrayRef<MCPhysReg> rawOrder = trc->getRawAllocationOrder(*mf);
|
||||||
for (unsigned i = 0; i != rawOrder.size(); ++i) {
|
for (unsigned i = 0; i != rawOrder.size(); ++i) {
|
||||||
unsigned preg = rawOrder[i];
|
unsigned preg = rawOrder[i];
|
||||||
if (mri->isReserved(preg))
|
if (mri->isReserved(preg))
|
||||||
|
|
|
@ -91,7 +91,7 @@ void RegScavenger::enterBasicBlock(MachineBasicBlock *mbb) {
|
||||||
|
|
||||||
// Create callee-saved registers bitvector.
|
// Create callee-saved registers bitvector.
|
||||||
CalleeSavedRegs.resize(NumPhysRegs);
|
CalleeSavedRegs.resize(NumPhysRegs);
|
||||||
const uint16_t *CSRegs = TRI->getCalleeSavedRegs(&MF);
|
const MCPhysReg *CSRegs = TRI->getCalleeSavedRegs(&MF);
|
||||||
if (CSRegs != NULL)
|
if (CSRegs != NULL)
|
||||||
for (unsigned i = 0; CSRegs[i]; ++i)
|
for (unsigned i = 0; CSRegs[i]; ++i)
|
||||||
CalleeSavedRegs.set(CSRegs[i]);
|
CalleeSavedRegs.set(CSRegs[i]);
|
||||||
|
|
|
@ -738,7 +738,7 @@ EmitMachineNode(SDNode *Node, bool IsClone, bool IsCloned,
|
||||||
const MCInstrDesc &II = TII->get(Opc);
|
const MCInstrDesc &II = TII->get(Opc);
|
||||||
unsigned NumResults = CountResults(Node);
|
unsigned NumResults = CountResults(Node);
|
||||||
unsigned NumDefs = II.getNumDefs();
|
unsigned NumDefs = II.getNumDefs();
|
||||||
const uint16_t *ScratchRegs = NULL;
|
const MCPhysReg *ScratchRegs = NULL;
|
||||||
|
|
||||||
// Handle STACKMAP and PATCHPOINT specially and then use the generic code.
|
// Handle STACKMAP and PATCHPOINT specially and then use the generic code.
|
||||||
if (Opc == TargetOpcode::STACKMAP || Opc == TargetOpcode::PATCHPOINT) {
|
if (Opc == TargetOpcode::STACKMAP || Opc == TargetOpcode::PATCHPOINT) {
|
||||||
|
|
|
@ -130,7 +130,7 @@ TargetRegisterInfo::getMinimalPhysRegClass(unsigned reg, EVT VT) const {
|
||||||
static void getAllocatableSetForRC(const MachineFunction &MF,
|
static void getAllocatableSetForRC(const MachineFunction &MF,
|
||||||
const TargetRegisterClass *RC, BitVector &R){
|
const TargetRegisterClass *RC, BitVector &R){
|
||||||
assert(RC->isAllocatable() && "invalid for nonallocatable sets");
|
assert(RC->isAllocatable() && "invalid for nonallocatable sets");
|
||||||
ArrayRef<uint16_t> Order = RC->getRawAllocationOrder(MF);
|
ArrayRef<MCPhysReg> Order = RC->getRawAllocationOrder(MF);
|
||||||
for (unsigned i = 0; i != Order.size(); ++i)
|
for (unsigned i = 0; i != Order.size(); ++i)
|
||||||
R.set(Order[i]);
|
R.set(Order[i]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -369,8 +369,8 @@ AArch64FrameLowering::processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
|
||||||
|
|
||||||
// We certainly need some slack space for the scavenger, preferably an extra
|
// We certainly need some slack space for the scavenger, preferably an extra
|
||||||
// register.
|
// register.
|
||||||
const uint16_t *CSRegs = RegInfo->getCalleeSavedRegs();
|
const MCPhysReg *CSRegs = RegInfo->getCalleeSavedRegs();
|
||||||
uint16_t ExtraReg = AArch64::NoRegister;
|
MCPhysReg ExtraReg = AArch64::NoRegister;
|
||||||
|
|
||||||
for (unsigned i = 0; CSRegs[i]; ++i) {
|
for (unsigned i = 0; CSRegs[i]; ++i) {
|
||||||
if (AArch64::GPR64RegClass.contains(CSRegs[i]) &&
|
if (AArch64::GPR64RegClass.contains(CSRegs[i]) &&
|
||||||
|
|
|
@ -1187,13 +1187,13 @@ const char *AArch64TargetLowering::getTargetNodeName(unsigned Opcode) const {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const uint16_t AArch64FPRArgRegs[] = {
|
static const MCPhysReg AArch64FPRArgRegs[] = {
|
||||||
AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3,
|
AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3,
|
||||||
AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
|
AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
|
||||||
};
|
};
|
||||||
static const unsigned NumFPRArgRegs = llvm::array_lengthof(AArch64FPRArgRegs);
|
static const unsigned NumFPRArgRegs = llvm::array_lengthof(AArch64FPRArgRegs);
|
||||||
|
|
||||||
static const uint16_t AArch64ArgRegs[] = {
|
static const MCPhysReg AArch64ArgRegs[] = {
|
||||||
AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3,
|
AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3,
|
||||||
AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
|
AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
|
||||||
};
|
};
|
||||||
|
|
|
@ -33,7 +33,7 @@ AArch64RegisterInfo::AArch64RegisterInfo()
|
||||||
: AArch64GenRegisterInfo(AArch64::X30) {
|
: AArch64GenRegisterInfo(AArch64::X30) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint16_t *
|
const MCPhysReg *
|
||||||
AArch64RegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
|
AArch64RegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
|
||||||
return CSR_PCS_SaveList;
|
return CSR_PCS_SaveList;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ class AArch64Subtarget;
|
||||||
struct AArch64RegisterInfo : public AArch64GenRegisterInfo {
|
struct AArch64RegisterInfo : public AArch64GenRegisterInfo {
|
||||||
AArch64RegisterInfo();
|
AArch64RegisterInfo();
|
||||||
|
|
||||||
const uint16_t *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
|
const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
|
||||||
const uint32_t *getCallPreservedMask(CallingConv::ID) const;
|
const uint32_t *getCallPreservedMask(CallingConv::ID) const;
|
||||||
|
|
||||||
const uint32_t *getTLSDescCallPreservedMask() const;
|
const uint32_t *getTLSDescCallPreservedMask() const;
|
||||||
|
|
|
@ -49,9 +49,9 @@ ARMBaseRegisterInfo::ARMBaseRegisterInfo(const ARMSubtarget &sti)
|
||||||
BasePtr(ARM::R6) {
|
BasePtr(ARM::R6) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint16_t*
|
const MCPhysReg*
|
||||||
ARMBaseRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
|
ARMBaseRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
|
||||||
const uint16_t *RegList = (STI.isTargetIOS() && !STI.isAAPCS_ABI())
|
const MCPhysReg *RegList = (STI.isTargetIOS() && !STI.isAAPCS_ABI())
|
||||||
? CSR_iOS_SaveList
|
? CSR_iOS_SaveList
|
||||||
: CSR_AAPCS_SaveList;
|
: CSR_AAPCS_SaveList;
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ protected:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// Code Generation virtual methods...
|
/// Code Generation virtual methods...
|
||||||
const uint16_t *
|
const MCPhysReg *
|
||||||
getCalleeSavedRegs(const MachineFunction *MF = 0) const override;
|
getCalleeSavedRegs(const MachineFunction *MF = 0) const override;
|
||||||
const uint32_t *getCallPreservedMask(CallingConv::ID) const override;
|
const uint32_t *getCallPreservedMask(CallingConv::ID) const override;
|
||||||
const uint32_t *getNoPreservedMask() const;
|
const uint32_t *getNoPreservedMask() const;
|
||||||
|
|
|
@ -28,7 +28,7 @@ namespace llvm {
|
||||||
static bool f64AssignAPCS(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
|
static bool f64AssignAPCS(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
|
||||||
CCValAssign::LocInfo &LocInfo,
|
CCValAssign::LocInfo &LocInfo,
|
||||||
CCState &State, bool CanFail) {
|
CCState &State, bool CanFail) {
|
||||||
static const uint16_t RegList[] = { ARM::R0, ARM::R1, ARM::R2, ARM::R3 };
|
static const MCPhysReg RegList[] = { ARM::R0, ARM::R1, ARM::R2, ARM::R3 };
|
||||||
|
|
||||||
// Try to get the first register.
|
// Try to get the first register.
|
||||||
if (unsigned Reg = State.AllocateReg(RegList, 4))
|
if (unsigned Reg = State.AllocateReg(RegList, 4))
|
||||||
|
@ -71,10 +71,10 @@ static bool CC_ARM_APCS_Custom_f64(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
|
||||||
static bool f64AssignAAPCS(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
|
static bool f64AssignAAPCS(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
|
||||||
CCValAssign::LocInfo &LocInfo,
|
CCValAssign::LocInfo &LocInfo,
|
||||||
CCState &State, bool CanFail) {
|
CCState &State, bool CanFail) {
|
||||||
static const uint16_t HiRegList[] = { ARM::R0, ARM::R2 };
|
static const MCPhysReg HiRegList[] = { ARM::R0, ARM::R2 };
|
||||||
static const uint16_t LoRegList[] = { ARM::R1, ARM::R3 };
|
static const MCPhysReg LoRegList[] = { ARM::R1, ARM::R3 };
|
||||||
static const uint16_t ShadowRegList[] = { ARM::R0, ARM::R1 };
|
static const MCPhysReg ShadowRegList[] = { ARM::R0, ARM::R1 };
|
||||||
static const uint16_t GPRArgRegs[] = { ARM::R0, ARM::R1, ARM::R2, ARM::R3 };
|
static const MCPhysReg GPRArgRegs[] = { ARM::R0, ARM::R1, ARM::R2, ARM::R3 };
|
||||||
|
|
||||||
unsigned Reg = State.AllocateReg(HiRegList, ShadowRegList, 2);
|
unsigned Reg = State.AllocateReg(HiRegList, ShadowRegList, 2);
|
||||||
if (Reg == 0) {
|
if (Reg == 0) {
|
||||||
|
@ -123,8 +123,8 @@ static bool CC_ARM_AAPCS_Custom_f64(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
|
||||||
|
|
||||||
static bool f64RetAssign(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
|
static bool f64RetAssign(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
|
||||||
CCValAssign::LocInfo &LocInfo, CCState &State) {
|
CCValAssign::LocInfo &LocInfo, CCState &State) {
|
||||||
static const uint16_t HiRegList[] = { ARM::R0, ARM::R2 };
|
static const MCPhysReg HiRegList[] = { ARM::R0, ARM::R2 };
|
||||||
static const uint16_t LoRegList[] = { ARM::R1, ARM::R3 };
|
static const MCPhysReg LoRegList[] = { ARM::R1, ARM::R3 };
|
||||||
|
|
||||||
unsigned Reg = State.AllocateReg(HiRegList, LoRegList, 2);
|
unsigned Reg = State.AllocateReg(HiRegList, LoRegList, 2);
|
||||||
if (Reg == 0)
|
if (Reg == 0)
|
||||||
|
|
|
@ -87,7 +87,7 @@ ARMFrameLowering::canSimplifyCallFramePseudos(const MachineFunction &MF) const {
|
||||||
|
|
||||||
static bool isCSRestore(MachineInstr *MI,
|
static bool isCSRestore(MachineInstr *MI,
|
||||||
const ARMBaseInstrInfo &TII,
|
const ARMBaseInstrInfo &TII,
|
||||||
const uint16_t *CSRegs) {
|
const MCPhysReg *CSRegs) {
|
||||||
// Integer spill area is handled with "pop".
|
// Integer spill area is handled with "pop".
|
||||||
if (isPopOpcode(MI->getOpcode())) {
|
if (isPopOpcode(MI->getOpcode())) {
|
||||||
// The first two operands are predicates. The last two are
|
// The first two operands are predicates. The last two are
|
||||||
|
@ -537,7 +537,7 @@ void ARMFrameLowering::emitEpilogue(MachineFunction &MF,
|
||||||
emitSPUpdate(isARM, MBB, MBBI, dl, TII, NumBytes - ArgRegsSaveSize);
|
emitSPUpdate(isARM, MBB, MBBI, dl, TII, NumBytes - ArgRegsSaveSize);
|
||||||
} else {
|
} else {
|
||||||
// Unwind MBBI to point to first LDR / VLDRD.
|
// Unwind MBBI to point to first LDR / VLDRD.
|
||||||
const uint16_t *CSRegs = RegInfo->getCalleeSavedRegs(&MF);
|
const MCPhysReg *CSRegs = RegInfo->getCalleeSavedRegs(&MF);
|
||||||
if (MBBI != MBB.begin()) {
|
if (MBBI != MBB.begin()) {
|
||||||
do {
|
do {
|
||||||
--MBBI;
|
--MBBI;
|
||||||
|
@ -1368,7 +1368,7 @@ ARMFrameLowering::processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
|
||||||
|
|
||||||
// Don't spill FP if the frame can be eliminated. This is determined
|
// Don't spill FP if the frame can be eliminated. This is determined
|
||||||
// by scanning the callee-save registers to see if any is used.
|
// by scanning the callee-save registers to see if any is used.
|
||||||
const uint16_t *CSRegs = RegInfo->getCalleeSavedRegs(&MF);
|
const MCPhysReg *CSRegs = RegInfo->getCalleeSavedRegs(&MF);
|
||||||
for (unsigned i = 0; CSRegs[i]; ++i) {
|
for (unsigned i = 0; CSRegs[i]; ++i) {
|
||||||
unsigned Reg = CSRegs[i];
|
unsigned Reg = CSRegs[i];
|
||||||
bool Spilled = false;
|
bool Spilled = false;
|
||||||
|
|
|
@ -79,7 +79,7 @@ namespace {
|
||||||
}
|
}
|
||||||
|
|
||||||
// The APCS parameter registers.
|
// The APCS parameter registers.
|
||||||
static const uint16_t GPRArgRegs[] = {
|
static const MCPhysReg GPRArgRegs[] = {
|
||||||
ARM::R0, ARM::R1, ARM::R2, ARM::R3
|
ARM::R0, ARM::R1, ARM::R2, ARM::R3
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -6558,7 +6558,7 @@ EmitSjLjDispatchBlock(MachineInstr *MI, MachineBasicBlock *MBB) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
// N.B. the order the invoke BBs are processed in doesn't matter here.
|
// N.B. the order the invoke BBs are processed in doesn't matter here.
|
||||||
const uint16_t *SavedRegs = RI.getCalleeSavedRegs(MF);
|
const MCPhysReg *SavedRegs = RI.getCalleeSavedRegs(MF);
|
||||||
SmallVector<MachineBasicBlock*, 64> MBBLPads;
|
SmallVector<MachineBasicBlock*, 64> MBBLPads;
|
||||||
for (SmallPtrSet<MachineBasicBlock*, 64>::iterator
|
for (SmallPtrSet<MachineBasicBlock*, 64>::iterator
|
||||||
I = InvokeBBs.begin(), E = InvokeBBs.end(); I != E; ++I) {
|
I = InvokeBBs.begin(), E = InvokeBBs.end(); I != E; ++I) {
|
||||||
|
|
|
@ -293,7 +293,7 @@ void Thumb1FrameLowering::emitPrologue(MachineFunction &MF) const {
|
||||||
AFI->setShouldRestoreSPFromFP(true);
|
AFI->setShouldRestoreSPFromFP(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool isCSRestore(MachineInstr *MI, const uint16_t *CSRegs) {
|
static bool isCSRestore(MachineInstr *MI, const MCPhysReg *CSRegs) {
|
||||||
if (MI->getOpcode() == ARM::tLDRspi &&
|
if (MI->getOpcode() == ARM::tLDRspi &&
|
||||||
MI->getOperand(1).isFI() &&
|
MI->getOperand(1).isFI() &&
|
||||||
isCalleeSavedRegister(MI->getOperand(0).getReg(), CSRegs))
|
isCalleeSavedRegister(MI->getOperand(0).getReg(), CSRegs))
|
||||||
|
@ -328,7 +328,7 @@ void Thumb1FrameLowering::emitEpilogue(MachineFunction &MF,
|
||||||
int NumBytes = (int)MFI->getStackSize();
|
int NumBytes = (int)MFI->getStackSize();
|
||||||
assert((unsigned)NumBytes >= ArgRegsSaveSize &&
|
assert((unsigned)NumBytes >= ArgRegsSaveSize &&
|
||||||
"ArgRegsSaveSize is included in NumBytes");
|
"ArgRegsSaveSize is included in NumBytes");
|
||||||
const uint16_t *CSRegs = RegInfo->getCalleeSavedRegs();
|
const MCPhysReg *CSRegs = RegInfo->getCalleeSavedRegs();
|
||||||
unsigned FramePtr = RegInfo->getFrameRegister(MF);
|
unsigned FramePtr = RegInfo->getFrameRegister(MF);
|
||||||
|
|
||||||
if (!AFI->hasStackFrame()) {
|
if (!AFI->hasStackFrame()) {
|
||||||
|
|
|
@ -31,17 +31,17 @@ static bool CC_ARM64_Custom_i1i8i16_Reg(unsigned ValNo, MVT ValVT, MVT LocVT,
|
||||||
ISD::ArgFlagsTy ArgFlags,
|
ISD::ArgFlagsTy ArgFlags,
|
||||||
CCState &State,
|
CCState &State,
|
||||||
bool IsWebKitJS = false) {
|
bool IsWebKitJS = false) {
|
||||||
static const uint16_t RegList1[] = { ARM64::W0, ARM64::W1, ARM64::W2,
|
static const MCPhysReg RegList1[] = { ARM64::W0, ARM64::W1, ARM64::W2,
|
||||||
ARM64::W3, ARM64::W4, ARM64::W5,
|
ARM64::W3, ARM64::W4, ARM64::W5,
|
||||||
ARM64::W6, ARM64::W7 };
|
ARM64::W6, ARM64::W7 };
|
||||||
static const uint16_t RegList2[] = { ARM64::X0, ARM64::X1, ARM64::X2,
|
static const MCPhysReg RegList2[] = { ARM64::X0, ARM64::X1, ARM64::X2,
|
||||||
ARM64::X3, ARM64::X4, ARM64::X5,
|
ARM64::X3, ARM64::X4, ARM64::X5,
|
||||||
ARM64::X6, ARM64::X7 };
|
ARM64::X6, ARM64::X7 };
|
||||||
static const uint16_t WebKitRegList1[] = { ARM64::W0 };
|
static const MCPhysReg WebKitRegList1[] = { ARM64::W0 };
|
||||||
static const uint16_t WebKitRegList2[] = { ARM64::X0 };
|
static const MCPhysReg WebKitRegList2[] = { ARM64::X0 };
|
||||||
|
|
||||||
const uint16_t *List1 = IsWebKitJS ? WebKitRegList1 : RegList1;
|
const MCPhysReg *List1 = IsWebKitJS ? WebKitRegList1 : RegList1;
|
||||||
const uint16_t *List2 = IsWebKitJS ? WebKitRegList2 : RegList2;
|
const MCPhysReg *List2 = IsWebKitJS ? WebKitRegList2 : RegList2;
|
||||||
|
|
||||||
if (unsigned Reg = State.AllocateReg(List1, List2, 8)) {
|
if (unsigned Reg = State.AllocateReg(List1, List2, 8)) {
|
||||||
// Customized extra section for handling i1/i8/i16:
|
// Customized extra section for handling i1/i8/i16:
|
||||||
|
|
|
@ -388,14 +388,14 @@ void ARM64FrameLowering::emitPrologue(MachineFunction &MF) const {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool isCalleeSavedRegister(unsigned Reg, const uint16_t *CSRegs) {
|
static bool isCalleeSavedRegister(unsigned Reg, const MCPhysReg *CSRegs) {
|
||||||
for (unsigned i = 0; CSRegs[i]; ++i)
|
for (unsigned i = 0; CSRegs[i]; ++i)
|
||||||
if (Reg == CSRegs[i])
|
if (Reg == CSRegs[i])
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool isCSRestore(MachineInstr *MI, const uint16_t *CSRegs) {
|
static bool isCSRestore(MachineInstr *MI, const MCPhysReg *CSRegs) {
|
||||||
if (MI->getOpcode() == ARM64::LDPXpost ||
|
if (MI->getOpcode() == ARM64::LDPXpost ||
|
||||||
MI->getOpcode() == ARM64::LDPDpost || MI->getOpcode() == ARM64::LDPXi ||
|
MI->getOpcode() == ARM64::LDPDpost || MI->getOpcode() == ARM64::LDPXi ||
|
||||||
MI->getOpcode() == ARM64::LDPDi) {
|
MI->getOpcode() == ARM64::LDPDi) {
|
||||||
|
@ -424,7 +424,7 @@ void ARM64FrameLowering::emitEpilogue(MachineFunction &MF,
|
||||||
unsigned NumRestores = 0;
|
unsigned NumRestores = 0;
|
||||||
// Move past the restores of the callee-saved registers.
|
// Move past the restores of the callee-saved registers.
|
||||||
MachineBasicBlock::iterator LastPopI = MBBI;
|
MachineBasicBlock::iterator LastPopI = MBBI;
|
||||||
const uint16_t *CSRegs = RegInfo->getCalleeSavedRegs(&MF);
|
const MCPhysReg *CSRegs = RegInfo->getCalleeSavedRegs(&MF);
|
||||||
if (LastPopI != MBB.begin()) {
|
if (LastPopI != MBB.begin()) {
|
||||||
do {
|
do {
|
||||||
++NumRestores;
|
++NumRestores;
|
||||||
|
@ -708,7 +708,7 @@ void ARM64FrameLowering::processFunctionBeforeCalleeSavedScan(
|
||||||
bool ExtraCSSpill = false;
|
bool ExtraCSSpill = false;
|
||||||
bool CanEliminateFrame = true;
|
bool CanEliminateFrame = true;
|
||||||
DEBUG(dbgs() << "*** processFunctionBeforeCalleeSavedScan\nUsed CSRs:");
|
DEBUG(dbgs() << "*** processFunctionBeforeCalleeSavedScan\nUsed CSRs:");
|
||||||
const uint16_t *CSRegs = RegInfo->getCalleeSavedRegs(&MF);
|
const MCPhysReg *CSRegs = RegInfo->getCalleeSavedRegs(&MF);
|
||||||
|
|
||||||
// Check pairs of consecutive callee-saved registers.
|
// Check pairs of consecutive callee-saved registers.
|
||||||
for (unsigned i = 0; CSRegs[i]; i += 2) {
|
for (unsigned i = 0; CSRegs[i]; i += 2) {
|
||||||
|
|
|
@ -2183,16 +2183,16 @@ void ARM64TargetLowering::saveVarArgRegisters(CCState &CCInfo,
|
||||||
|
|
||||||
SmallVector<SDValue, 8> MemOps;
|
SmallVector<SDValue, 8> MemOps;
|
||||||
|
|
||||||
static const uint16_t GPRArgRegs[] = { ARM64::X0, ARM64::X1, ARM64::X2,
|
static const MCPhysReg GPRArgRegs[] = { ARM64::X0, ARM64::X1, ARM64::X2,
|
||||||
ARM64::X3, ARM64::X4, ARM64::X5,
|
ARM64::X3, ARM64::X4, ARM64::X5,
|
||||||
ARM64::X6, ARM64::X7 };
|
ARM64::X6, ARM64::X7 };
|
||||||
static const unsigned NumGPRArgRegs = array_lengthof(GPRArgRegs);
|
static const unsigned NumGPRArgRegs = array_lengthof(GPRArgRegs);
|
||||||
unsigned FirstVariadicGPR =
|
unsigned FirstVariadicGPR =
|
||||||
CCInfo.getFirstUnallocated(GPRArgRegs, NumGPRArgRegs);
|
CCInfo.getFirstUnallocated(GPRArgRegs, NumGPRArgRegs);
|
||||||
|
|
||||||
static const uint16_t FPRArgRegs[] = { ARM64::Q0, ARM64::Q1, ARM64::Q2,
|
static const MCPhysReg FPRArgRegs[] = { ARM64::Q0, ARM64::Q1, ARM64::Q2,
|
||||||
ARM64::Q3, ARM64::Q4, ARM64::Q5,
|
ARM64::Q3, ARM64::Q4, ARM64::Q5,
|
||||||
ARM64::Q6, ARM64::Q7 };
|
ARM64::Q6, ARM64::Q7 };
|
||||||
static const unsigned NumFPRArgRegs = array_lengthof(FPRArgRegs);
|
static const unsigned NumFPRArgRegs = array_lengthof(FPRArgRegs);
|
||||||
unsigned FirstVariadicFPR =
|
unsigned FirstVariadicFPR =
|
||||||
CCInfo.getFirstUnallocated(FPRArgRegs, NumFPRArgRegs);
|
CCInfo.getFirstUnallocated(FPRArgRegs, NumFPRArgRegs);
|
||||||
|
@ -6235,12 +6235,12 @@ bool ARM64TargetLowering::isFMAFasterThanFMulAndFAdd(EVT VT) const {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint16_t *
|
const MCPhysReg *
|
||||||
ARM64TargetLowering::getScratchRegisters(CallingConv::ID) const {
|
ARM64TargetLowering::getScratchRegisters(CallingConv::ID) const {
|
||||||
// LR is a callee-save register, but we must treat it as clobbered by any call
|
// LR is a callee-save register, but we must treat it as clobbered by any call
|
||||||
// site. Hence we include LR in the scratch registers, which are in turn added
|
// site. Hence we include LR in the scratch registers, which are in turn added
|
||||||
// as implicit-defs for stackmaps and patchpoints.
|
// as implicit-defs for stackmaps and patchpoints.
|
||||||
static const uint16_t ScratchRegs[] = {
|
static const MCPhysReg ScratchRegs[] = {
|
||||||
ARM64::X16, ARM64::X17, ARM64::LR, 0
|
ARM64::X16, ARM64::X17, ARM64::LR, 0
|
||||||
};
|
};
|
||||||
return ScratchRegs;
|
return ScratchRegs;
|
||||||
|
|
|
@ -291,7 +291,7 @@ public:
|
||||||
/// expanded to fmul + fadd.
|
/// expanded to fmul + fadd.
|
||||||
bool isFMAFasterThanFMulAndFAdd(EVT VT) const override;
|
bool isFMAFasterThanFMulAndFAdd(EVT VT) const override;
|
||||||
|
|
||||||
const uint16_t *getScratchRegisters(CallingConv::ID CC) const override;
|
const MCPhysReg *getScratchRegisters(CallingConv::ID CC) const override;
|
||||||
|
|
||||||
bool shouldConvertConstantLoadToIntImm(const APInt &Imm,
|
bool shouldConvertConstantLoadToIntImm(const APInt &Imm,
|
||||||
Type *Ty) const override;
|
Type *Ty) const override;
|
||||||
|
|
|
@ -36,7 +36,7 @@ ARM64RegisterInfo::ARM64RegisterInfo(const ARM64InstrInfo *tii,
|
||||||
const ARM64Subtarget *sti)
|
const ARM64Subtarget *sti)
|
||||||
: ARM64GenRegisterInfo(ARM64::LR), TII(tii), STI(sti) {}
|
: ARM64GenRegisterInfo(ARM64::LR), TII(tii), STI(sti) {}
|
||||||
|
|
||||||
const uint16_t *
|
const MCPhysReg *
|
||||||
ARM64RegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
|
ARM64RegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
|
||||||
assert(MF && "Invalid MachineFunction pointer.");
|
assert(MF && "Invalid MachineFunction pointer.");
|
||||||
if (MF->getFunction()->getCallingConv() == CallingConv::AnyReg)
|
if (MF->getFunction()->getCallingConv() == CallingConv::AnyReg)
|
||||||
|
|
|
@ -36,7 +36,7 @@ public:
|
||||||
bool isReservedReg(const MachineFunction &MF, unsigned Reg) const;
|
bool isReservedReg(const MachineFunction &MF, unsigned Reg) const;
|
||||||
|
|
||||||
/// Code Generation virtual methods...
|
/// Code Generation virtual methods...
|
||||||
const uint16_t *
|
const MCPhysReg *
|
||||||
getCalleeSavedRegs(const MachineFunction *MF = 0) const override;
|
getCalleeSavedRegs(const MachineFunction *MF = 0) const override;
|
||||||
const uint32_t *getCallPreservedMask(CallingConv::ID) const override;
|
const uint32_t *getCallPreservedMask(CallingConv::ID) const override;
|
||||||
|
|
||||||
|
|
|
@ -182,7 +182,7 @@ static bool CC_Hexagon32(unsigned ValNo, MVT ValVT,
|
||||||
MVT LocVT, CCValAssign::LocInfo LocInfo,
|
MVT LocVT, CCValAssign::LocInfo LocInfo,
|
||||||
ISD::ArgFlagsTy ArgFlags, CCState &State) {
|
ISD::ArgFlagsTy ArgFlags, CCState &State) {
|
||||||
|
|
||||||
static const uint16_t RegList[] = {
|
static const MCPhysReg RegList[] = {
|
||||||
Hexagon::R0, Hexagon::R1, Hexagon::R2, Hexagon::R3, Hexagon::R4,
|
Hexagon::R0, Hexagon::R1, Hexagon::R2, Hexagon::R3, Hexagon::R4,
|
||||||
Hexagon::R5
|
Hexagon::R5
|
||||||
};
|
};
|
||||||
|
@ -205,10 +205,10 @@ static bool CC_Hexagon64(unsigned ValNo, MVT ValVT,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const uint16_t RegList1[] = {
|
static const MCPhysReg RegList1[] = {
|
||||||
Hexagon::D1, Hexagon::D2
|
Hexagon::D1, Hexagon::D2
|
||||||
};
|
};
|
||||||
static const uint16_t RegList2[] = {
|
static const MCPhysReg RegList2[] = {
|
||||||
Hexagon::R1, Hexagon::R3
|
Hexagon::R1, Hexagon::R3
|
||||||
};
|
};
|
||||||
if (unsigned Reg = State.AllocateReg(RegList1, RegList2, 2)) {
|
if (unsigned Reg = State.AllocateReg(RegList1, RegList2, 2)) {
|
||||||
|
|
|
@ -43,13 +43,12 @@ HexagonRegisterInfo::HexagonRegisterInfo(HexagonSubtarget &st)
|
||||||
Subtarget(st) {
|
Subtarget(st) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint16_t* HexagonRegisterInfo::getCalleeSavedRegs(const MachineFunction
|
const MCPhysReg *
|
||||||
*MF)
|
HexagonRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
|
||||||
const {
|
static const MCPhysReg CalleeSavedRegsV2[] = {
|
||||||
static const uint16_t CalleeSavedRegsV2[] = {
|
|
||||||
Hexagon::R24, Hexagon::R25, Hexagon::R26, Hexagon::R27, 0
|
Hexagon::R24, Hexagon::R25, Hexagon::R26, Hexagon::R27, 0
|
||||||
};
|
};
|
||||||
static const uint16_t CalleeSavedRegsV3[] = {
|
static const MCPhysReg CalleeSavedRegsV3[] = {
|
||||||
Hexagon::R16, Hexagon::R17, Hexagon::R18, Hexagon::R19,
|
Hexagon::R16, Hexagon::R17, Hexagon::R18, Hexagon::R19,
|
||||||
Hexagon::R20, Hexagon::R21, Hexagon::R22, Hexagon::R23,
|
Hexagon::R20, Hexagon::R21, Hexagon::R22, Hexagon::R23,
|
||||||
Hexagon::R24, Hexagon::R25, Hexagon::R26, Hexagon::R27, 0
|
Hexagon::R24, Hexagon::R25, Hexagon::R26, Hexagon::R27, 0
|
||||||
|
|
|
@ -48,7 +48,7 @@ struct HexagonRegisterInfo : public HexagonGenRegisterInfo {
|
||||||
HexagonRegisterInfo(HexagonSubtarget &st);
|
HexagonRegisterInfo(HexagonSubtarget &st);
|
||||||
|
|
||||||
/// Code Generation virtual methods...
|
/// Code Generation virtual methods...
|
||||||
const uint16_t *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
|
const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
|
||||||
|
|
||||||
const TargetRegisterClass* const* getCalleeSavedRegClasses(
|
const TargetRegisterClass* const* getCalleeSavedRegClasses(
|
||||||
const MachineFunction *MF = 0) const;
|
const MachineFunction *MF = 0) const;
|
||||||
|
|
|
@ -390,7 +390,7 @@ static bool IsLoopN(MachineInstr *MI) {
|
||||||
/// callee-saved register.
|
/// callee-saved register.
|
||||||
static bool DoesModifyCalleeSavedReg(MachineInstr *MI,
|
static bool DoesModifyCalleeSavedReg(MachineInstr *MI,
|
||||||
const TargetRegisterInfo *TRI) {
|
const TargetRegisterInfo *TRI) {
|
||||||
for (const uint16_t *CSR = TRI->getCalleeSavedRegs(); *CSR; ++CSR) {
|
for (const MCPhysReg *CSR = TRI->getCalleeSavedRegs(); *CSR; ++CSR) {
|
||||||
unsigned CalleeSavedReg = *CSR;
|
unsigned CalleeSavedReg = *CSR;
|
||||||
if (MI->modifiesRegister(CalleeSavedReg, TRI))
|
if (MI->modifiesRegister(CalleeSavedReg, TRI))
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -284,7 +284,7 @@ template<typename ArgT>
|
||||||
static void AnalyzeArguments(CCState &State,
|
static void AnalyzeArguments(CCState &State,
|
||||||
SmallVectorImpl<CCValAssign> &ArgLocs,
|
SmallVectorImpl<CCValAssign> &ArgLocs,
|
||||||
const SmallVectorImpl<ArgT> &Args) {
|
const SmallVectorImpl<ArgT> &Args) {
|
||||||
static const uint16_t RegList[] = {
|
static const MCPhysReg RegList[] = {
|
||||||
MSP430::R15W, MSP430::R14W, MSP430::R13W, MSP430::R12W
|
MSP430::R15W, MSP430::R14W, MSP430::R13W, MSP430::R12W
|
||||||
};
|
};
|
||||||
static const unsigned NbRegs = array_lengthof(RegList);
|
static const unsigned NbRegs = array_lengthof(RegList);
|
||||||
|
|
|
@ -37,27 +37,27 @@ MSP430RegisterInfo::MSP430RegisterInfo(MSP430TargetMachine &tm)
|
||||||
StackAlign = TM.getFrameLowering()->getStackAlignment();
|
StackAlign = TM.getFrameLowering()->getStackAlignment();
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint16_t*
|
const MCPhysReg*
|
||||||
MSP430RegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
|
MSP430RegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
|
||||||
const TargetFrameLowering *TFI = MF->getTarget().getFrameLowering();
|
const TargetFrameLowering *TFI = MF->getTarget().getFrameLowering();
|
||||||
const Function* F = MF->getFunction();
|
const Function* F = MF->getFunction();
|
||||||
static const uint16_t CalleeSavedRegs[] = {
|
static const MCPhysReg CalleeSavedRegs[] = {
|
||||||
MSP430::FPW, MSP430::R5W, MSP430::R6W, MSP430::R7W,
|
MSP430::FPW, MSP430::R5W, MSP430::R6W, MSP430::R7W,
|
||||||
MSP430::R8W, MSP430::R9W, MSP430::R10W, MSP430::R11W,
|
MSP430::R8W, MSP430::R9W, MSP430::R10W, MSP430::R11W,
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
static const uint16_t CalleeSavedRegsFP[] = {
|
static const MCPhysReg CalleeSavedRegsFP[] = {
|
||||||
MSP430::R5W, MSP430::R6W, MSP430::R7W,
|
MSP430::R5W, MSP430::R6W, MSP430::R7W,
|
||||||
MSP430::R8W, MSP430::R9W, MSP430::R10W, MSP430::R11W,
|
MSP430::R8W, MSP430::R9W, MSP430::R10W, MSP430::R11W,
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
static const uint16_t CalleeSavedRegsIntr[] = {
|
static const MCPhysReg CalleeSavedRegsIntr[] = {
|
||||||
MSP430::FPW, MSP430::R5W, MSP430::R6W, MSP430::R7W,
|
MSP430::FPW, MSP430::R5W, MSP430::R6W, MSP430::R7W,
|
||||||
MSP430::R8W, MSP430::R9W, MSP430::R10W, MSP430::R11W,
|
MSP430::R8W, MSP430::R9W, MSP430::R10W, MSP430::R11W,
|
||||||
MSP430::R12W, MSP430::R13W, MSP430::R14W, MSP430::R15W,
|
MSP430::R12W, MSP430::R13W, MSP430::R14W, MSP430::R15W,
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
static const uint16_t CalleeSavedRegsIntrFP[] = {
|
static const MCPhysReg CalleeSavedRegsIntrFP[] = {
|
||||||
MSP430::R5W, MSP430::R6W, MSP430::R7W,
|
MSP430::R5W, MSP430::R6W, MSP430::R7W,
|
||||||
MSP430::R8W, MSP430::R9W, MSP430::R10W, MSP430::R11W,
|
MSP430::R8W, MSP430::R9W, MSP430::R10W, MSP430::R11W,
|
||||||
MSP430::R12W, MSP430::R13W, MSP430::R14W, MSP430::R15W,
|
MSP430::R12W, MSP430::R13W, MSP430::R14W, MSP430::R15W,
|
||||||
|
|
|
@ -35,7 +35,7 @@ public:
|
||||||
MSP430RegisterInfo(MSP430TargetMachine &tm);
|
MSP430RegisterInfo(MSP430TargetMachine &tm);
|
||||||
|
|
||||||
/// Code Generation virtual methods...
|
/// Code Generation virtual methods...
|
||||||
const uint16_t *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
|
const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
|
||||||
|
|
||||||
BitVector getReservedRegs(const MachineFunction &MF) const;
|
BitVector getReservedRegs(const MachineFunction &MF) const;
|
||||||
const TargetRegisterClass*
|
const TargetRegisterClass*
|
||||||
|
|
|
@ -110,7 +110,7 @@ uint64_t MipsFrameLowering::estimateStackSize(const MachineFunction &MF) const {
|
||||||
Offset = std::max(Offset, -MFI->getObjectOffset(I));
|
Offset = std::max(Offset, -MFI->getObjectOffset(I));
|
||||||
|
|
||||||
// Conservatively assume all callee-saved registers will be saved.
|
// Conservatively assume all callee-saved registers will be saved.
|
||||||
for (const uint16_t *R = TRI.getCalleeSavedRegs(&MF); *R; ++R) {
|
for (const MCPhysReg *R = TRI.getCalleeSavedRegs(&MF); *R; ++R) {
|
||||||
unsigned Size = TRI.getMinimalPhysRegClass(*R)->getSize();
|
unsigned Size = TRI.getMinimalPhysRegClass(*R)->getSize();
|
||||||
Offset = RoundUpToAlignment(Offset + Size, Size);
|
Offset = RoundUpToAlignment(Offset + Size, Size);
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,16 +50,16 @@ NoZeroDivCheck("mno-check-zero-division", cl::Hidden,
|
||||||
cl::desc("MIPS: Don't trap on integer division by zero."),
|
cl::desc("MIPS: Don't trap on integer division by zero."),
|
||||||
cl::init(false));
|
cl::init(false));
|
||||||
|
|
||||||
static const uint16_t O32IntRegs[4] = {
|
static const MCPhysReg O32IntRegs[4] = {
|
||||||
Mips::A0, Mips::A1, Mips::A2, Mips::A3
|
Mips::A0, Mips::A1, Mips::A2, Mips::A3
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint16_t Mips64IntRegs[8] = {
|
static const MCPhysReg Mips64IntRegs[8] = {
|
||||||
Mips::A0_64, Mips::A1_64, Mips::A2_64, Mips::A3_64,
|
Mips::A0_64, Mips::A1_64, Mips::A2_64, Mips::A3_64,
|
||||||
Mips::T0_64, Mips::T1_64, Mips::T2_64, Mips::T3_64
|
Mips::T0_64, Mips::T1_64, Mips::T2_64, Mips::T3_64
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint16_t Mips64DPRegs[8] = {
|
static const MCPhysReg Mips64DPRegs[8] = {
|
||||||
Mips::D12_64, Mips::D13_64, Mips::D14_64, Mips::D15_64,
|
Mips::D12_64, Mips::D13_64, Mips::D14_64, Mips::D15_64,
|
||||||
Mips::D16_64, Mips::D17_64, Mips::D18_64, Mips::D19_64
|
Mips::D16_64, Mips::D17_64, Mips::D18_64, Mips::D19_64
|
||||||
};
|
};
|
||||||
|
@ -2177,12 +2177,12 @@ SDValue MipsTargetLowering::lowerFP_TO_SINT(SDValue Op,
|
||||||
|
|
||||||
static bool CC_MipsO32(unsigned ValNo, MVT ValVT, MVT LocVT,
|
static bool CC_MipsO32(unsigned ValNo, MVT ValVT, MVT LocVT,
|
||||||
CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags,
|
CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags,
|
||||||
CCState &State, const uint16_t *F64Regs) {
|
CCState &State, const MCPhysReg *F64Regs) {
|
||||||
|
|
||||||
static const unsigned IntRegsSize = 4, FloatRegsSize = 2;
|
static const unsigned IntRegsSize = 4, FloatRegsSize = 2;
|
||||||
|
|
||||||
static const uint16_t IntRegs[] = { Mips::A0, Mips::A1, Mips::A2, Mips::A3 };
|
static const MCPhysReg IntRegs[] = { Mips::A0, Mips::A1, Mips::A2, Mips::A3 };
|
||||||
static const uint16_t F32Regs[] = { Mips::F12, Mips::F14 };
|
static const MCPhysReg F32Regs[] = { Mips::F12, Mips::F14 };
|
||||||
|
|
||||||
// Do not process byval args here.
|
// Do not process byval args here.
|
||||||
if (ArgFlags.isByVal())
|
if (ArgFlags.isByVal())
|
||||||
|
@ -2254,7 +2254,7 @@ static bool CC_MipsO32(unsigned ValNo, MVT ValVT, MVT LocVT,
|
||||||
static bool CC_MipsO32_FP32(unsigned ValNo, MVT ValVT,
|
static bool CC_MipsO32_FP32(unsigned ValNo, MVT ValVT,
|
||||||
MVT LocVT, CCValAssign::LocInfo LocInfo,
|
MVT LocVT, CCValAssign::LocInfo LocInfo,
|
||||||
ISD::ArgFlagsTy ArgFlags, CCState &State) {
|
ISD::ArgFlagsTy ArgFlags, CCState &State) {
|
||||||
static const uint16_t F64Regs[] = { Mips::D6, Mips::D7 };
|
static const MCPhysReg F64Regs[] = { Mips::D6, Mips::D7 };
|
||||||
|
|
||||||
return CC_MipsO32(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State, F64Regs);
|
return CC_MipsO32(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State, F64Regs);
|
||||||
}
|
}
|
||||||
|
@ -2262,7 +2262,7 @@ static bool CC_MipsO32_FP32(unsigned ValNo, MVT ValVT,
|
||||||
static bool CC_MipsO32_FP64(unsigned ValNo, MVT ValVT,
|
static bool CC_MipsO32_FP64(unsigned ValNo, MVT ValVT,
|
||||||
MVT LocVT, CCValAssign::LocInfo LocInfo,
|
MVT LocVT, CCValAssign::LocInfo LocInfo,
|
||||||
ISD::ArgFlagsTy ArgFlags, CCState &State) {
|
ISD::ArgFlagsTy ArgFlags, CCState &State) {
|
||||||
static const uint16_t F64Regs[] = { Mips::D12_64, Mips::D14_64 };
|
static const MCPhysReg F64Regs[] = { Mips::D12_64, Mips::D14_64 };
|
||||||
|
|
||||||
return CC_MipsO32(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State, F64Regs);
|
return CC_MipsO32(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State, F64Regs);
|
||||||
}
|
}
|
||||||
|
@ -3426,7 +3426,7 @@ unsigned MipsTargetLowering::MipsCC::reservedArgArea() const {
|
||||||
return (IsO32 && (CallConv != CallingConv::Fast)) ? 16 : 0;
|
return (IsO32 && (CallConv != CallingConv::Fast)) ? 16 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint16_t *MipsTargetLowering::MipsCC::intArgRegs() const {
|
const MCPhysReg *MipsTargetLowering::MipsCC::intArgRegs() const {
|
||||||
return IsO32 ? O32IntRegs : Mips64IntRegs;
|
return IsO32 ? O32IntRegs : Mips64IntRegs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3443,7 +3443,7 @@ llvm::CCAssignFn *MipsTargetLowering::MipsCC::varArgFn() const {
|
||||||
return IsO32 ? (IsFP64 ? CC_MipsO32_FP64 : CC_MipsO32_FP32) : CC_MipsN_VarArg;
|
return IsO32 ? (IsFP64 ? CC_MipsO32_FP64 : CC_MipsO32_FP32) : CC_MipsN_VarArg;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint16_t *MipsTargetLowering::MipsCC::shadowRegs() const {
|
const MCPhysReg *MipsTargetLowering::MipsCC::shadowRegs() const {
|
||||||
return IsO32 ? O32IntRegs : Mips64DPRegs;
|
return IsO32 ? O32IntRegs : Mips64DPRegs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3451,7 +3451,7 @@ void MipsTargetLowering::MipsCC::allocateRegs(ByValArgInfo &ByVal,
|
||||||
unsigned ByValSize,
|
unsigned ByValSize,
|
||||||
unsigned Align) {
|
unsigned Align) {
|
||||||
unsigned RegSize = regSize(), NumIntArgRegs = numIntArgRegs();
|
unsigned RegSize = regSize(), NumIntArgRegs = numIntArgRegs();
|
||||||
const uint16_t *IntArgRegs = intArgRegs(), *ShadowRegs = shadowRegs();
|
const MCPhysReg *IntArgRegs = intArgRegs(), *ShadowRegs = shadowRegs();
|
||||||
assert(!(ByValSize % RegSize) && !(Align % RegSize) &&
|
assert(!(ByValSize % RegSize) && !(Align % RegSize) &&
|
||||||
"Byval argument's size and alignment should be a multiple of"
|
"Byval argument's size and alignment should be a multiple of"
|
||||||
"RegSize.");
|
"RegSize.");
|
||||||
|
@ -3543,7 +3543,7 @@ passByValArg(SDValue Chain, SDLoc DL,
|
||||||
EVT PtrTy = getPointerTy(), RegTy = MVT::getIntegerVT(RegSize * 8);
|
EVT PtrTy = getPointerTy(), RegTy = MVT::getIntegerVT(RegSize * 8);
|
||||||
|
|
||||||
if (ByVal.NumRegs) {
|
if (ByVal.NumRegs) {
|
||||||
const uint16_t *ArgRegs = CC.intArgRegs();
|
const MCPhysReg *ArgRegs = CC.intArgRegs();
|
||||||
bool LeftoverBytes = (ByVal.NumRegs * RegSize > ByValSize);
|
bool LeftoverBytes = (ByVal.NumRegs * RegSize > ByValSize);
|
||||||
unsigned I = 0;
|
unsigned I = 0;
|
||||||
|
|
||||||
|
@ -3628,7 +3628,7 @@ void MipsTargetLowering::writeVarArgRegs(std::vector<SDValue> &OutChains,
|
||||||
const MipsCC &CC, SDValue Chain,
|
const MipsCC &CC, SDValue Chain,
|
||||||
SDLoc DL, SelectionDAG &DAG) const {
|
SDLoc DL, SelectionDAG &DAG) const {
|
||||||
unsigned NumRegs = CC.numIntArgRegs();
|
unsigned NumRegs = CC.numIntArgRegs();
|
||||||
const uint16_t *ArgRegs = CC.intArgRegs();
|
const MCPhysReg *ArgRegs = CC.intArgRegs();
|
||||||
const CCState &CCInfo = CC.getCCInfo();
|
const CCState &CCInfo = CC.getCCInfo();
|
||||||
unsigned Idx = CCInfo.getFirstUnallocated(ArgRegs, NumRegs);
|
unsigned Idx = CCInfo.getFirstUnallocated(ArgRegs, NumRegs);
|
||||||
unsigned RegSize = CC.regSize();
|
unsigned RegSize = CC.regSize();
|
||||||
|
|
|
@ -382,7 +382,7 @@ namespace llvm {
|
||||||
unsigned reservedArgArea() const;
|
unsigned reservedArgArea() const;
|
||||||
|
|
||||||
/// Return pointer to array of integer argument registers.
|
/// Return pointer to array of integer argument registers.
|
||||||
const uint16_t *intArgRegs() const;
|
const MCPhysReg *intArgRegs() const;
|
||||||
|
|
||||||
typedef SmallVectorImpl<ByValArgInfo>::const_iterator byval_iterator;
|
typedef SmallVectorImpl<ByValArgInfo>::const_iterator byval_iterator;
|
||||||
byval_iterator byval_begin() const { return ByValArgs.begin(); }
|
byval_iterator byval_begin() const { return ByValArgs.begin(); }
|
||||||
|
@ -403,7 +403,7 @@ namespace llvm {
|
||||||
/// Return the function that analyzes variable argument list functions.
|
/// Return the function that analyzes variable argument list functions.
|
||||||
llvm::CCAssignFn *varArgFn() const;
|
llvm::CCAssignFn *varArgFn() const;
|
||||||
|
|
||||||
const uint16_t *shadowRegs() const;
|
const MCPhysReg *shadowRegs() const;
|
||||||
|
|
||||||
void allocateRegs(ByValArgInfo &ByVal, unsigned ByValSize,
|
void allocateRegs(ByValArgInfo &ByVal, unsigned ByValSize,
|
||||||
unsigned Align);
|
unsigned Align);
|
||||||
|
|
|
@ -79,8 +79,8 @@ MipsRegisterInfo::getRegPressureLimit(const TargetRegisterClass *RC,
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
/// Mips Callee Saved Registers
|
/// Mips Callee Saved Registers
|
||||||
const uint16_t* MipsRegisterInfo::
|
const MCPhysReg *
|
||||||
getCalleeSavedRegs(const MachineFunction *MF) const {
|
MipsRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
|
||||||
if (Subtarget.isSingleFloat())
|
if (Subtarget.isSingleFloat())
|
||||||
return CSR_SingleFloatOnly_SaveList;
|
return CSR_SingleFloatOnly_SaveList;
|
||||||
|
|
||||||
|
@ -119,11 +119,11 @@ const uint32_t *MipsRegisterInfo::getMips16RetHelperMask() {
|
||||||
|
|
||||||
BitVector MipsRegisterInfo::
|
BitVector MipsRegisterInfo::
|
||||||
getReservedRegs(const MachineFunction &MF) const {
|
getReservedRegs(const MachineFunction &MF) const {
|
||||||
static const uint16_t ReservedGPR32[] = {
|
static const MCPhysReg ReservedGPR32[] = {
|
||||||
Mips::ZERO, Mips::K0, Mips::K1, Mips::SP
|
Mips::ZERO, Mips::K0, Mips::K1, Mips::SP
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint16_t ReservedGPR64[] = {
|
static const MCPhysReg ReservedGPR64[] = {
|
||||||
Mips::ZERO_64, Mips::K0_64, Mips::K1_64, Mips::SP_64
|
Mips::ZERO_64, Mips::K0_64, Mips::K1_64, Mips::SP_64
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ public:
|
||||||
|
|
||||||
unsigned getRegPressureLimit(const TargetRegisterClass *RC,
|
unsigned getRegPressureLimit(const TargetRegisterClass *RC,
|
||||||
MachineFunction &MF) const;
|
MachineFunction &MF) const;
|
||||||
const uint16_t *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
|
const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
|
||||||
const uint32_t *getCallPreservedMask(CallingConv::ID) const;
|
const uint32_t *getCallPreservedMask(CallingConv::ID) const;
|
||||||
static const uint32_t *getMips16RetHelperMask();
|
static const uint32_t *getMips16RetHelperMask();
|
||||||
|
|
||||||
|
|
|
@ -78,9 +78,9 @@ NVPTXRegisterInfo::NVPTXRegisterInfo(const NVPTXSubtarget &st)
|
||||||
#include "NVPTXGenRegisterInfo.inc"
|
#include "NVPTXGenRegisterInfo.inc"
|
||||||
|
|
||||||
/// NVPTX Callee Saved Registers
|
/// NVPTX Callee Saved Registers
|
||||||
const uint16_t *
|
const MCPhysReg *
|
||||||
NVPTXRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
|
NVPTXRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
|
||||||
static const uint16_t CalleeSavedRegs[] = { 0 };
|
static const MCPhysReg CalleeSavedRegs[] = { 0 };
|
||||||
return CalleeSavedRegs;
|
return CalleeSavedRegs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ public:
|
||||||
//------------------------------------------------------
|
//------------------------------------------------------
|
||||||
|
|
||||||
// NVPTX callee saved registers
|
// NVPTX callee saved registers
|
||||||
virtual const uint16_t *
|
virtual const MCPhysReg *
|
||||||
getCalleeSavedRegs(const MachineFunction *MF = 0) const;
|
getCalleeSavedRegs(const MachineFunction *MF = 0) const;
|
||||||
|
|
||||||
// NVPTX callee saved register classes
|
// NVPTX callee saved register classes
|
||||||
|
|
|
@ -2016,7 +2016,7 @@ bool llvm::CC_PPC32_SVR4_Custom_AlignArgRegs(unsigned &ValNo, MVT &ValVT,
|
||||||
CCValAssign::LocInfo &LocInfo,
|
CCValAssign::LocInfo &LocInfo,
|
||||||
ISD::ArgFlagsTy &ArgFlags,
|
ISD::ArgFlagsTy &ArgFlags,
|
||||||
CCState &State) {
|
CCState &State) {
|
||||||
static const uint16_t ArgRegs[] = {
|
static const MCPhysReg ArgRegs[] = {
|
||||||
PPC::R3, PPC::R4, PPC::R5, PPC::R6,
|
PPC::R3, PPC::R4, PPC::R5, PPC::R6,
|
||||||
PPC::R7, PPC::R8, PPC::R9, PPC::R10,
|
PPC::R7, PPC::R8, PPC::R9, PPC::R10,
|
||||||
};
|
};
|
||||||
|
@ -2043,7 +2043,7 @@ bool llvm::CC_PPC32_SVR4_Custom_AlignFPArgRegs(unsigned &ValNo, MVT &ValVT,
|
||||||
CCValAssign::LocInfo &LocInfo,
|
CCValAssign::LocInfo &LocInfo,
|
||||||
ISD::ArgFlagsTy &ArgFlags,
|
ISD::ArgFlagsTy &ArgFlags,
|
||||||
CCState &State) {
|
CCState &State) {
|
||||||
static const uint16_t ArgRegs[] = {
|
static const MCPhysReg ArgRegs[] = {
|
||||||
PPC::F1, PPC::F2, PPC::F3, PPC::F4, PPC::F5, PPC::F6, PPC::F7,
|
PPC::F1, PPC::F2, PPC::F3, PPC::F4, PPC::F5, PPC::F6, PPC::F7,
|
||||||
PPC::F8
|
PPC::F8
|
||||||
};
|
};
|
||||||
|
@ -2067,8 +2067,8 @@ bool llvm::CC_PPC32_SVR4_Custom_AlignFPArgRegs(unsigned &ValNo, MVT &ValVT,
|
||||||
|
|
||||||
/// GetFPR - Get the set of FP registers that should be allocated for arguments,
|
/// GetFPR - Get the set of FP registers that should be allocated for arguments,
|
||||||
/// on Darwin.
|
/// on Darwin.
|
||||||
static const uint16_t *GetFPR() {
|
static const MCPhysReg *GetFPR() {
|
||||||
static const uint16_t FPR[] = {
|
static const MCPhysReg FPR[] = {
|
||||||
PPC::F1, PPC::F2, PPC::F3, PPC::F4, PPC::F5, PPC::F6, PPC::F7,
|
PPC::F1, PPC::F2, PPC::F3, PPC::F4, PPC::F5, PPC::F6, PPC::F7,
|
||||||
PPC::F8, PPC::F9, PPC::F10, PPC::F11, PPC::F12, PPC::F13
|
PPC::F8, PPC::F9, PPC::F10, PPC::F11, PPC::F12, PPC::F13
|
||||||
};
|
};
|
||||||
|
@ -2265,13 +2265,13 @@ PPCTargetLowering::LowerFormalArguments_32SVR4(
|
||||||
// If the function takes variable number of arguments, make a frame index for
|
// If the function takes variable number of arguments, make a frame index for
|
||||||
// the start of the first vararg value... for expansion of llvm.va_start.
|
// the start of the first vararg value... for expansion of llvm.va_start.
|
||||||
if (isVarArg) {
|
if (isVarArg) {
|
||||||
static const uint16_t GPArgRegs[] = {
|
static const MCPhysReg GPArgRegs[] = {
|
||||||
PPC::R3, PPC::R4, PPC::R5, PPC::R6,
|
PPC::R3, PPC::R4, PPC::R5, PPC::R6,
|
||||||
PPC::R7, PPC::R8, PPC::R9, PPC::R10,
|
PPC::R7, PPC::R8, PPC::R9, PPC::R10,
|
||||||
};
|
};
|
||||||
const unsigned NumGPArgRegs = array_lengthof(GPArgRegs);
|
const unsigned NumGPArgRegs = array_lengthof(GPArgRegs);
|
||||||
|
|
||||||
static const uint16_t FPArgRegs[] = {
|
static const MCPhysReg FPArgRegs[] = {
|
||||||
PPC::F1, PPC::F2, PPC::F3, PPC::F4, PPC::F5, PPC::F6, PPC::F7,
|
PPC::F1, PPC::F2, PPC::F3, PPC::F4, PPC::F5, PPC::F6, PPC::F7,
|
||||||
PPC::F8
|
PPC::F8
|
||||||
};
|
};
|
||||||
|
@ -2405,18 +2405,18 @@ PPCTargetLowering::LowerFormalArguments_64SVR4(
|
||||||
// Area that is at least reserved in caller of this function.
|
// Area that is at least reserved in caller of this function.
|
||||||
unsigned MinReservedArea = ArgOffset;
|
unsigned MinReservedArea = ArgOffset;
|
||||||
|
|
||||||
static const uint16_t GPR[] = {
|
static const MCPhysReg GPR[] = {
|
||||||
PPC::X3, PPC::X4, PPC::X5, PPC::X6,
|
PPC::X3, PPC::X4, PPC::X5, PPC::X6,
|
||||||
PPC::X7, PPC::X8, PPC::X9, PPC::X10,
|
PPC::X7, PPC::X8, PPC::X9, PPC::X10,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint16_t *FPR = GetFPR();
|
static const MCPhysReg *FPR = GetFPR();
|
||||||
|
|
||||||
static const uint16_t VR[] = {
|
static const MCPhysReg VR[] = {
|
||||||
PPC::V2, PPC::V3, PPC::V4, PPC::V5, PPC::V6, PPC::V7, PPC::V8,
|
PPC::V2, PPC::V3, PPC::V4, PPC::V5, PPC::V6, PPC::V7, PPC::V8,
|
||||||
PPC::V9, PPC::V10, PPC::V11, PPC::V12, PPC::V13
|
PPC::V9, PPC::V10, PPC::V11, PPC::V12, PPC::V13
|
||||||
};
|
};
|
||||||
static const uint16_t VSRH[] = {
|
static const MCPhysReg VSRH[] = {
|
||||||
PPC::VSH2, PPC::VSH3, PPC::VSH4, PPC::VSH5, PPC::VSH6, PPC::VSH7, PPC::VSH8,
|
PPC::VSH2, PPC::VSH3, PPC::VSH4, PPC::VSH5, PPC::VSH6, PPC::VSH7, PPC::VSH8,
|
||||||
PPC::VSH9, PPC::VSH10, PPC::VSH11, PPC::VSH12, PPC::VSH13
|
PPC::VSH9, PPC::VSH10, PPC::VSH11, PPC::VSH12, PPC::VSH13
|
||||||
};
|
};
|
||||||
|
@ -2714,18 +2714,18 @@ PPCTargetLowering::LowerFormalArguments_Darwin(
|
||||||
// Area that is at least reserved in caller of this function.
|
// Area that is at least reserved in caller of this function.
|
||||||
unsigned MinReservedArea = ArgOffset;
|
unsigned MinReservedArea = ArgOffset;
|
||||||
|
|
||||||
static const uint16_t GPR_32[] = { // 32-bit registers.
|
static const MCPhysReg GPR_32[] = { // 32-bit registers.
|
||||||
PPC::R3, PPC::R4, PPC::R5, PPC::R6,
|
PPC::R3, PPC::R4, PPC::R5, PPC::R6,
|
||||||
PPC::R7, PPC::R8, PPC::R9, PPC::R10,
|
PPC::R7, PPC::R8, PPC::R9, PPC::R10,
|
||||||
};
|
};
|
||||||
static const uint16_t GPR_64[] = { // 64-bit registers.
|
static const MCPhysReg GPR_64[] = { // 64-bit registers.
|
||||||
PPC::X3, PPC::X4, PPC::X5, PPC::X6,
|
PPC::X3, PPC::X4, PPC::X5, PPC::X6,
|
||||||
PPC::X7, PPC::X8, PPC::X9, PPC::X10,
|
PPC::X7, PPC::X8, PPC::X9, PPC::X10,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint16_t *FPR = GetFPR();
|
static const MCPhysReg *FPR = GetFPR();
|
||||||
|
|
||||||
static const uint16_t VR[] = {
|
static const MCPhysReg VR[] = {
|
||||||
PPC::V2, PPC::V3, PPC::V4, PPC::V5, PPC::V6, PPC::V7, PPC::V8,
|
PPC::V2, PPC::V3, PPC::V4, PPC::V5, PPC::V6, PPC::V7, PPC::V8,
|
||||||
PPC::V9, PPC::V10, PPC::V11, PPC::V12, PPC::V13
|
PPC::V9, PPC::V10, PPC::V11, PPC::V12, PPC::V13
|
||||||
};
|
};
|
||||||
|
@ -2736,7 +2736,7 @@ PPCTargetLowering::LowerFormalArguments_Darwin(
|
||||||
|
|
||||||
unsigned GPR_idx = 0, FPR_idx = 0, VR_idx = 0;
|
unsigned GPR_idx = 0, FPR_idx = 0, VR_idx = 0;
|
||||||
|
|
||||||
const uint16_t *GPR = isPPC64 ? GPR_64 : GPR_32;
|
const MCPhysReg *GPR = isPPC64 ? GPR_64 : GPR_32;
|
||||||
|
|
||||||
// In 32-bit non-varargs functions, the stack space for vectors is after the
|
// In 32-bit non-varargs functions, the stack space for vectors is after the
|
||||||
// stack space for non-vectors. We do not use this space unless we have
|
// stack space for non-vectors. We do not use this space unless we have
|
||||||
|
@ -4044,17 +4044,17 @@ PPCTargetLowering::LowerCall_64SVR4(SDValue Chain, SDValue Callee,
|
||||||
unsigned ArgOffset = PPCFrameLowering::getLinkageSize(true, true);
|
unsigned ArgOffset = PPCFrameLowering::getLinkageSize(true, true);
|
||||||
unsigned GPR_idx = 0, FPR_idx = 0, VR_idx = 0;
|
unsigned GPR_idx = 0, FPR_idx = 0, VR_idx = 0;
|
||||||
|
|
||||||
static const uint16_t GPR[] = {
|
static const MCPhysReg GPR[] = {
|
||||||
PPC::X3, PPC::X4, PPC::X5, PPC::X6,
|
PPC::X3, PPC::X4, PPC::X5, PPC::X6,
|
||||||
PPC::X7, PPC::X8, PPC::X9, PPC::X10,
|
PPC::X7, PPC::X8, PPC::X9, PPC::X10,
|
||||||
};
|
};
|
||||||
static const uint16_t *FPR = GetFPR();
|
static const MCPhysReg *FPR = GetFPR();
|
||||||
|
|
||||||
static const uint16_t VR[] = {
|
static const MCPhysReg VR[] = {
|
||||||
PPC::V2, PPC::V3, PPC::V4, PPC::V5, PPC::V6, PPC::V7, PPC::V8,
|
PPC::V2, PPC::V3, PPC::V4, PPC::V5, PPC::V6, PPC::V7, PPC::V8,
|
||||||
PPC::V9, PPC::V10, PPC::V11, PPC::V12, PPC::V13
|
PPC::V9, PPC::V10, PPC::V11, PPC::V12, PPC::V13
|
||||||
};
|
};
|
||||||
static const uint16_t VSRH[] = {
|
static const MCPhysReg VSRH[] = {
|
||||||
PPC::VSH2, PPC::VSH3, PPC::VSH4, PPC::VSH5, PPC::VSH6, PPC::VSH7, PPC::VSH8,
|
PPC::VSH2, PPC::VSH3, PPC::VSH4, PPC::VSH5, PPC::VSH6, PPC::VSH7, PPC::VSH8,
|
||||||
PPC::VSH9, PPC::VSH10, PPC::VSH11, PPC::VSH12, PPC::VSH13
|
PPC::VSH9, PPC::VSH10, PPC::VSH11, PPC::VSH12, PPC::VSH13
|
||||||
};
|
};
|
||||||
|
@ -4448,17 +4448,17 @@ PPCTargetLowering::LowerCall_Darwin(SDValue Chain, SDValue Callee,
|
||||||
unsigned ArgOffset = PPCFrameLowering::getLinkageSize(isPPC64, true);
|
unsigned ArgOffset = PPCFrameLowering::getLinkageSize(isPPC64, true);
|
||||||
unsigned GPR_idx = 0, FPR_idx = 0, VR_idx = 0;
|
unsigned GPR_idx = 0, FPR_idx = 0, VR_idx = 0;
|
||||||
|
|
||||||
static const uint16_t GPR_32[] = { // 32-bit registers.
|
static const MCPhysReg GPR_32[] = { // 32-bit registers.
|
||||||
PPC::R3, PPC::R4, PPC::R5, PPC::R6,
|
PPC::R3, PPC::R4, PPC::R5, PPC::R6,
|
||||||
PPC::R7, PPC::R8, PPC::R9, PPC::R10,
|
PPC::R7, PPC::R8, PPC::R9, PPC::R10,
|
||||||
};
|
};
|
||||||
static const uint16_t GPR_64[] = { // 64-bit registers.
|
static const MCPhysReg GPR_64[] = { // 64-bit registers.
|
||||||
PPC::X3, PPC::X4, PPC::X5, PPC::X6,
|
PPC::X3, PPC::X4, PPC::X5, PPC::X6,
|
||||||
PPC::X7, PPC::X8, PPC::X9, PPC::X10,
|
PPC::X7, PPC::X8, PPC::X9, PPC::X10,
|
||||||
};
|
};
|
||||||
static const uint16_t *FPR = GetFPR();
|
static const MCPhysReg *FPR = GetFPR();
|
||||||
|
|
||||||
static const uint16_t VR[] = {
|
static const MCPhysReg VR[] = {
|
||||||
PPC::V2, PPC::V3, PPC::V4, PPC::V5, PPC::V6, PPC::V7, PPC::V8,
|
PPC::V2, PPC::V3, PPC::V4, PPC::V5, PPC::V6, PPC::V7, PPC::V8,
|
||||||
PPC::V9, PPC::V10, PPC::V11, PPC::V12, PPC::V13
|
PPC::V9, PPC::V10, PPC::V11, PPC::V12, PPC::V13
|
||||||
};
|
};
|
||||||
|
@ -4466,7 +4466,7 @@ PPCTargetLowering::LowerCall_Darwin(SDValue Chain, SDValue Callee,
|
||||||
const unsigned NumFPRs = 13;
|
const unsigned NumFPRs = 13;
|
||||||
const unsigned NumVRs = array_lengthof(VR);
|
const unsigned NumVRs = array_lengthof(VR);
|
||||||
|
|
||||||
const uint16_t *GPR = isPPC64 ? GPR_64 : GPR_32;
|
const MCPhysReg *GPR = isPPC64 ? GPR_64 : GPR_32;
|
||||||
|
|
||||||
SmallVector<std::pair<unsigned, SDValue>, 8> RegsToPass;
|
SmallVector<std::pair<unsigned, SDValue>, 8> RegsToPass;
|
||||||
SmallVector<TailCallArgumentInfo, 8> TailCallArguments;
|
SmallVector<TailCallArgumentInfo, 8> TailCallArguments;
|
||||||
|
|
|
@ -96,7 +96,7 @@ PPCRegisterInfo::getPointerRegClass(const MachineFunction &MF, unsigned Kind)
|
||||||
return &PPC::GPRCRegClass;
|
return &PPC::GPRCRegClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint16_t*
|
const MCPhysReg*
|
||||||
PPCRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
|
PPCRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
|
||||||
if (Subtarget.isDarwinABI())
|
if (Subtarget.isDarwinABI())
|
||||||
return Subtarget.isPPC64() ? (Subtarget.hasAltivec() ?
|
return Subtarget.isPPC64() ? (Subtarget.hasAltivec() ?
|
||||||
|
|
|
@ -44,7 +44,7 @@ public:
|
||||||
getLargestLegalSuperClass(const TargetRegisterClass *RC) const;
|
getLargestLegalSuperClass(const TargetRegisterClass *RC) const;
|
||||||
|
|
||||||
/// Code Generation virtual methods...
|
/// Code Generation virtual methods...
|
||||||
const uint16_t *getCalleeSavedRegs(const MachineFunction* MF = 0) const;
|
const MCPhysReg *getCalleeSavedRegs(const MachineFunction* MF = 0) const;
|
||||||
const uint32_t *getCallPreservedMask(CallingConv::ID CC) const;
|
const uint32_t *getCallPreservedMask(CallingConv::ID CC) const;
|
||||||
const uint32_t *getNoPreservedMask() const;
|
const uint32_t *getNoPreservedMask() const;
|
||||||
|
|
||||||
|
|
|
@ -27,10 +27,10 @@ AMDGPURegisterInfo::AMDGPURegisterInfo(TargetMachine &tm)
|
||||||
// they are not supported at this time.
|
// they are not supported at this time.
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
const uint16_t AMDGPURegisterInfo::CalleeSavedReg = AMDGPU::NoRegister;
|
const MCPhysReg AMDGPURegisterInfo::CalleeSavedReg = AMDGPU::NoRegister;
|
||||||
|
|
||||||
const uint16_t* AMDGPURegisterInfo::getCalleeSavedRegs(const MachineFunction *MF)
|
const MCPhysReg*
|
||||||
const {
|
AMDGPURegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
|
||||||
return &CalleeSavedReg;
|
return &CalleeSavedReg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ class TargetInstrInfo;
|
||||||
|
|
||||||
struct AMDGPURegisterInfo : public AMDGPUGenRegisterInfo {
|
struct AMDGPURegisterInfo : public AMDGPUGenRegisterInfo {
|
||||||
TargetMachine &TM;
|
TargetMachine &TM;
|
||||||
static const uint16_t CalleeSavedReg;
|
static const MCPhysReg CalleeSavedReg;
|
||||||
|
|
||||||
AMDGPURegisterInfo(TargetMachine &tm);
|
AMDGPURegisterInfo(TargetMachine &tm);
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ struct AMDGPURegisterInfo : public AMDGPUGenRegisterInfo {
|
||||||
/// (e.g. getSubRegFromChannel(0) -> AMDGPU::sub0)
|
/// (e.g. getSubRegFromChannel(0) -> AMDGPU::sub0)
|
||||||
unsigned getSubRegFromChannel(unsigned Channel) const;
|
unsigned getSubRegFromChannel(unsigned Channel) const;
|
||||||
|
|
||||||
const uint16_t* getCalleeSavedRegs(const MachineFunction *MF) const;
|
const MCPhysReg* getCalleeSavedRegs(const MachineFunction *MF) const;
|
||||||
void eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj,
|
void eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj,
|
||||||
unsigned FIOperandNum,
|
unsigned FIOperandNum,
|
||||||
RegScavenger *RS) const;
|
RegScavenger *RS) const;
|
||||||
|
|
|
@ -53,7 +53,7 @@ static bool CC_Sparc_Assign_f64(unsigned &ValNo, MVT &ValVT,
|
||||||
MVT &LocVT, CCValAssign::LocInfo &LocInfo,
|
MVT &LocVT, CCValAssign::LocInfo &LocInfo,
|
||||||
ISD::ArgFlagsTy &ArgFlags, CCState &State)
|
ISD::ArgFlagsTy &ArgFlags, CCState &State)
|
||||||
{
|
{
|
||||||
static const uint16_t RegList[] = {
|
static const MCPhysReg RegList[] = {
|
||||||
SP::I0, SP::I1, SP::I2, SP::I3, SP::I4, SP::I5
|
SP::I0, SP::I1, SP::I2, SP::I3, SP::I4, SP::I5
|
||||||
};
|
};
|
||||||
// Try to get first reg.
|
// Try to get first reg.
|
||||||
|
@ -493,11 +493,11 @@ LowerFormalArguments_32(SDValue Chain,
|
||||||
|
|
||||||
// Store remaining ArgRegs to the stack if this is a varargs function.
|
// Store remaining ArgRegs to the stack if this is a varargs function.
|
||||||
if (isVarArg) {
|
if (isVarArg) {
|
||||||
static const uint16_t ArgRegs[] = {
|
static const MCPhysReg ArgRegs[] = {
|
||||||
SP::I0, SP::I1, SP::I2, SP::I3, SP::I4, SP::I5
|
SP::I0, SP::I1, SP::I2, SP::I3, SP::I4, SP::I5
|
||||||
};
|
};
|
||||||
unsigned NumAllocated = CCInfo.getFirstUnallocated(ArgRegs, 6);
|
unsigned NumAllocated = CCInfo.getFirstUnallocated(ArgRegs, 6);
|
||||||
const uint16_t *CurArgReg = ArgRegs+NumAllocated, *ArgRegEnd = ArgRegs+6;
|
const MCPhysReg *CurArgReg = ArgRegs+NumAllocated, *ArgRegEnd = ArgRegs+6;
|
||||||
unsigned ArgOffset = CCInfo.getNextStackOffset();
|
unsigned ArgOffset = CCInfo.getNextStackOffset();
|
||||||
if (NumAllocated == 6)
|
if (NumAllocated == 6)
|
||||||
ArgOffset += StackOffset;
|
ArgOffset += StackOffset;
|
||||||
|
|
|
@ -38,8 +38,8 @@ SparcRegisterInfo::SparcRegisterInfo(SparcSubtarget &st)
|
||||||
: SparcGenRegisterInfo(SP::O7), Subtarget(st) {
|
: SparcGenRegisterInfo(SP::O7), Subtarget(st) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint16_t* SparcRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF)
|
const MCPhysReg*
|
||||||
const {
|
SparcRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
|
||||||
return CSR_SaveList;
|
return CSR_SaveList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ struct SparcRegisterInfo : public SparcGenRegisterInfo {
|
||||||
SparcRegisterInfo(SparcSubtarget &st);
|
SparcRegisterInfo(SparcSubtarget &st);
|
||||||
|
|
||||||
/// Code Generation virtual methods...
|
/// Code Generation virtual methods...
|
||||||
const uint16_t *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
|
const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
|
||||||
const uint32_t* getCallPreservedMask(CallingConv::ID CC) const;
|
const uint32_t* getCallPreservedMask(CallingConv::ID CC) const;
|
||||||
|
|
||||||
const uint32_t* getRTCallPreservedMask(CallingConv::ID CC) const;
|
const uint32_t* getRTCallPreservedMask(CallingConv::ID CC) const;
|
||||||
|
|
|
@ -93,7 +93,7 @@ processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
|
||||||
// save and restore the stack pointer at the same time, via STMG and LMG.
|
// save and restore the stack pointer at the same time, via STMG and LMG.
|
||||||
// This allows the deallocation to be done by the LMG, rather than needing
|
// This allows the deallocation to be done by the LMG, rather than needing
|
||||||
// a separate %r15 addition.
|
// a separate %r15 addition.
|
||||||
const uint16_t *CSRegs = TRI->getCalleeSavedRegs(&MF);
|
const MCPhysReg *CSRegs = TRI->getCalleeSavedRegs(&MF);
|
||||||
for (unsigned I = 0; CSRegs[I]; ++I) {
|
for (unsigned I = 0; CSRegs[I]; ++I) {
|
||||||
unsigned Reg = CSRegs[I];
|
unsigned Reg = CSRegs[I];
|
||||||
if (SystemZ::GR64BitRegClass.contains(Reg) && MRI.isPhysRegUsed(Reg)) {
|
if (SystemZ::GR64BitRegClass.contains(Reg) && MRI.isPhysRegUsed(Reg)) {
|
||||||
|
|
|
@ -20,9 +20,9 @@ using namespace llvm;
|
||||||
SystemZRegisterInfo::SystemZRegisterInfo(SystemZTargetMachine &tm)
|
SystemZRegisterInfo::SystemZRegisterInfo(SystemZTargetMachine &tm)
|
||||||
: SystemZGenRegisterInfo(SystemZ::R14D), TM(tm) {}
|
: SystemZGenRegisterInfo(SystemZ::R14D), TM(tm) {}
|
||||||
|
|
||||||
const uint16_t*
|
const MCPhysReg*
|
||||||
SystemZRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
|
SystemZRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
|
||||||
static const uint16_t CalleeSavedRegs[] = {
|
static const MCPhysReg CalleeSavedRegs[] = {
|
||||||
SystemZ::R6D, SystemZ::R7D, SystemZ::R8D, SystemZ::R9D,
|
SystemZ::R6D, SystemZ::R7D, SystemZ::R8D, SystemZ::R9D,
|
||||||
SystemZ::R10D, SystemZ::R11D, SystemZ::R12D, SystemZ::R13D,
|
SystemZ::R10D, SystemZ::R11D, SystemZ::R12D, SystemZ::R13D,
|
||||||
SystemZ::R14D, SystemZ::R15D,
|
SystemZ::R14D, SystemZ::R15D,
|
||||||
|
|
|
@ -49,7 +49,7 @@ public:
|
||||||
bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const override {
|
bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const override {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
const uint16_t *getCalleeSavedRegs(const MachineFunction *MF = 0) const
|
const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF = 0) const
|
||||||
override;
|
override;
|
||||||
BitVector getReservedRegs(const MachineFunction &MF) const override;
|
BitVector getReservedRegs(const MachineFunction &MF) const override;
|
||||||
void eliminateFrameIndex(MachineBasicBlock::iterator MI,
|
void eliminateFrameIndex(MachineBasicBlock::iterator MI,
|
||||||
|
|
|
@ -1821,10 +1821,10 @@ bool X86FastISel::FastLowerArguments() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const uint16_t GPR32ArgRegs[] = {
|
static const MCPhysReg GPR32ArgRegs[] = {
|
||||||
X86::EDI, X86::ESI, X86::EDX, X86::ECX, X86::R8D, X86::R9D
|
X86::EDI, X86::ESI, X86::EDX, X86::ECX, X86::R8D, X86::R9D
|
||||||
};
|
};
|
||||||
static const uint16_t GPR64ArgRegs[] = {
|
static const MCPhysReg GPR64ArgRegs[] = {
|
||||||
X86::RDI, X86::RSI, X86::RDX, X86::RCX, X86::R8 , X86::R9
|
X86::RDI, X86::RSI, X86::RDX, X86::RCX, X86::R8 , X86::R9
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2163,7 +2163,7 @@ bool X86FastISel::DoSelectCall(const Instruction *I, const char *MemIntName) {
|
||||||
|
|
||||||
if (Subtarget->is64Bit() && isVarArg && !isWin64) {
|
if (Subtarget->is64Bit() && isVarArg && !isWin64) {
|
||||||
// Count the number of XMM registers allocated.
|
// Count the number of XMM registers allocated.
|
||||||
static const uint16_t XMMArgRegs[] = {
|
static const MCPhysReg XMMArgRegs[] = {
|
||||||
X86::XMM0, X86::XMM1, X86::XMM2, X86::XMM3,
|
X86::XMM0, X86::XMM1, X86::XMM2, X86::XMM3,
|
||||||
X86::XMM4, X86::XMM5, X86::XMM6, X86::XMM7
|
X86::XMM4, X86::XMM5, X86::XMM6, X86::XMM7
|
||||||
};
|
};
|
||||||
|
|
|
@ -1806,8 +1806,8 @@ X86TargetLowering::CanLowerReturn(CallingConv::ID CallConv,
|
||||||
return CCInfo.CheckReturn(Outs, RetCC_X86);
|
return CCInfo.CheckReturn(Outs, RetCC_X86);
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint16_t *X86TargetLowering::getScratchRegisters(CallingConv::ID) const {
|
const MCPhysReg *X86TargetLowering::getScratchRegisters(CallingConv::ID) const {
|
||||||
static const uint16_t ScratchRegs[] = { X86::R11, 0 };
|
static const MCPhysReg ScratchRegs[] = { X86::R11, 0 };
|
||||||
return ScratchRegs;
|
return ScratchRegs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2320,17 +2320,17 @@ X86TargetLowering::LowerFormalArguments(SDValue Chain,
|
||||||
unsigned TotalNumIntRegs = 0, TotalNumXMMRegs = 0;
|
unsigned TotalNumIntRegs = 0, TotalNumXMMRegs = 0;
|
||||||
|
|
||||||
// FIXME: We should really autogenerate these arrays
|
// FIXME: We should really autogenerate these arrays
|
||||||
static const uint16_t GPR64ArgRegsWin64[] = {
|
static const MCPhysReg GPR64ArgRegsWin64[] = {
|
||||||
X86::RCX, X86::RDX, X86::R8, X86::R9
|
X86::RCX, X86::RDX, X86::R8, X86::R9
|
||||||
};
|
};
|
||||||
static const uint16_t GPR64ArgRegs64Bit[] = {
|
static const MCPhysReg GPR64ArgRegs64Bit[] = {
|
||||||
X86::RDI, X86::RSI, X86::RDX, X86::RCX, X86::R8, X86::R9
|
X86::RDI, X86::RSI, X86::RDX, X86::RCX, X86::R8, X86::R9
|
||||||
};
|
};
|
||||||
static const uint16_t XMMArgRegs64Bit[] = {
|
static const MCPhysReg XMMArgRegs64Bit[] = {
|
||||||
X86::XMM0, X86::XMM1, X86::XMM2, X86::XMM3,
|
X86::XMM0, X86::XMM1, X86::XMM2, X86::XMM3,
|
||||||
X86::XMM4, X86::XMM5, X86::XMM6, X86::XMM7
|
X86::XMM4, X86::XMM5, X86::XMM6, X86::XMM7
|
||||||
};
|
};
|
||||||
const uint16_t *GPR64ArgRegs;
|
const MCPhysReg *GPR64ArgRegs;
|
||||||
unsigned NumXMMRegs = 0;
|
unsigned NumXMMRegs = 0;
|
||||||
|
|
||||||
if (IsWin64) {
|
if (IsWin64) {
|
||||||
|
@ -2730,7 +2730,7 @@ X86TargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
|
||||||
// registers used and is in the range 0 - 8 inclusive.
|
// registers used and is in the range 0 - 8 inclusive.
|
||||||
|
|
||||||
// Count the number of XMM registers allocated.
|
// Count the number of XMM registers allocated.
|
||||||
static const uint16_t XMMArgRegs[] = {
|
static const MCPhysReg XMMArgRegs[] = {
|
||||||
X86::XMM0, X86::XMM1, X86::XMM2, X86::XMM3,
|
X86::XMM0, X86::XMM1, X86::XMM2, X86::XMM3,
|
||||||
X86::XMM4, X86::XMM5, X86::XMM6, X86::XMM7
|
X86::XMM4, X86::XMM5, X86::XMM6, X86::XMM7
|
||||||
};
|
};
|
||||||
|
|
|
@ -936,7 +936,7 @@ namespace llvm {
|
||||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||||
LLVMContext &Context) const override;
|
LLVMContext &Context) const override;
|
||||||
|
|
||||||
const uint16_t *getScratchRegisters(CallingConv::ID CC) const override;
|
const MCPhysReg *getScratchRegisters(CallingConv::ID CC) const override;
|
||||||
|
|
||||||
/// Utility function to emit atomic-load-arith operations (and, or, xor,
|
/// Utility function to emit atomic-load-arith operations (and, or, xor,
|
||||||
/// nand, max, min, umax, umin). It takes the corresponding instruction to
|
/// nand, max, min, umax, umin). It takes the corresponding instruction to
|
||||||
|
|
|
@ -231,7 +231,7 @@ X86RegisterInfo::getRegPressureLimit(const TargetRegisterClass *RC,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint16_t *
|
const MCPhysReg *
|
||||||
X86RegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
|
X86RegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
|
||||||
bool HasAVX = TM.getSubtarget<X86Subtarget>().hasAVX();
|
bool HasAVX = TM.getSubtarget<X86Subtarget>().hasAVX();
|
||||||
bool HasAVX512 = TM.getSubtarget<X86Subtarget>().hasAVX512();
|
bool HasAVX512 = TM.getSubtarget<X86Subtarget>().hasAVX512();
|
||||||
|
|
|
@ -100,7 +100,7 @@ public:
|
||||||
|
|
||||||
/// getCalleeSavedRegs - Return a null-terminated list of all of the
|
/// getCalleeSavedRegs - Return a null-terminated list of all of the
|
||||||
/// callee-save registers on this target.
|
/// callee-save registers on this target.
|
||||||
const uint16_t *
|
const MCPhysReg *
|
||||||
getCalleeSavedRegs(const MachineFunction* MF) const override;
|
getCalleeSavedRegs(const MachineFunction* MF) const override;
|
||||||
const uint32_t *getCallPreservedMask(CallingConv::ID) const override;
|
const uint32_t *getCallPreservedMask(CallingConv::ID) const override;
|
||||||
const uint32_t *getNoPreservedMask() const;
|
const uint32_t *getNoPreservedMask() const;
|
||||||
|
|
|
@ -1384,7 +1384,7 @@ XCoreTargetLowering::LowerCCCArguments(SDValue Chain,
|
||||||
// 1b. CopyFromReg vararg registers.
|
// 1b. CopyFromReg vararg registers.
|
||||||
if (isVarArg) {
|
if (isVarArg) {
|
||||||
// Argument registers
|
// Argument registers
|
||||||
static const uint16_t ArgRegs[] = {
|
static const MCPhysReg ArgRegs[] = {
|
||||||
XCore::R0, XCore::R1, XCore::R2, XCore::R3
|
XCore::R0, XCore::R1, XCore::R2, XCore::R3
|
||||||
};
|
};
|
||||||
XCoreFunctionInfo *XFI = MF.getInfo<XCoreFunctionInfo>();
|
XCoreFunctionInfo *XFI = MF.getInfo<XCoreFunctionInfo>();
|
||||||
|
|
|
@ -205,16 +205,16 @@ bool XCoreRegisterInfo::needsFrameMoves(const MachineFunction &MF) {
|
||||||
MF.getFunction()->needsUnwindTableEntry();
|
MF.getFunction()->needsUnwindTableEntry();
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint16_t* XCoreRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF)
|
const MCPhysReg* XCoreRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF)
|
||||||
const {
|
const {
|
||||||
// The callee saved registers LR & FP are explicitly handled during
|
// The callee saved registers LR & FP are explicitly handled during
|
||||||
// emitPrologue & emitEpilogue and related functions.
|
// emitPrologue & emitEpilogue and related functions.
|
||||||
static const uint16_t CalleeSavedRegs[] = {
|
static const MCPhysReg CalleeSavedRegs[] = {
|
||||||
XCore::R4, XCore::R5, XCore::R6, XCore::R7,
|
XCore::R4, XCore::R5, XCore::R6, XCore::R7,
|
||||||
XCore::R8, XCore::R9, XCore::R10,
|
XCore::R8, XCore::R9, XCore::R10,
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
static const uint16_t CalleeSavedRegsFP[] = {
|
static const MCPhysReg CalleeSavedRegsFP[] = {
|
||||||
XCore::R4, XCore::R5, XCore::R6, XCore::R7,
|
XCore::R4, XCore::R5, XCore::R6, XCore::R7,
|
||||||
XCore::R8, XCore::R9,
|
XCore::R8, XCore::R9,
|
||||||
0
|
0
|
||||||
|
|
|
@ -29,7 +29,7 @@ public:
|
||||||
|
|
||||||
/// Code Generation virtual methods...
|
/// Code Generation virtual methods...
|
||||||
|
|
||||||
const uint16_t *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
|
const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
|
||||||
|
|
||||||
BitVector getReservedRegs(const MachineFunction &MF) const;
|
BitVector getReservedRegs(const MachineFunction &MF) const;
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,7 @@ void CallingConvEmitter::EmitAction(Record *Action,
|
||||||
O << IndentStr << "if (unsigned Reg = State.AllocateReg(";
|
O << IndentStr << "if (unsigned Reg = State.AllocateReg(";
|
||||||
O << getQualifiedName(RegList->getElementAsRecord(0)) << ")) {\n";
|
O << getQualifiedName(RegList->getElementAsRecord(0)) << ")) {\n";
|
||||||
} else {
|
} else {
|
||||||
O << IndentStr << "static const uint16_t RegList" << ++Counter
|
O << IndentStr << "static const MCPhysReg RegList" << ++Counter
|
||||||
<< "[] = {\n";
|
<< "[] = {\n";
|
||||||
O << IndentStr << " ";
|
O << IndentStr << " ";
|
||||||
for (unsigned i = 0, e = RegList->getSize(); i != e; ++i) {
|
for (unsigned i = 0, e = RegList->getSize(); i != e; ++i) {
|
||||||
|
@ -143,7 +143,7 @@ void CallingConvEmitter::EmitAction(Record *Action,
|
||||||
unsigned RegListNumber = ++Counter;
|
unsigned RegListNumber = ++Counter;
|
||||||
unsigned ShadowRegListNumber = ++Counter;
|
unsigned ShadowRegListNumber = ++Counter;
|
||||||
|
|
||||||
O << IndentStr << "static const uint16_t RegList" << RegListNumber
|
O << IndentStr << "static const MCPhysReg RegList" << RegListNumber
|
||||||
<< "[] = {\n";
|
<< "[] = {\n";
|
||||||
O << IndentStr << " ";
|
O << IndentStr << " ";
|
||||||
for (unsigned i = 0, e = RegList->getSize(); i != e; ++i) {
|
for (unsigned i = 0, e = RegList->getSize(); i != e; ++i) {
|
||||||
|
@ -152,7 +152,7 @@ void CallingConvEmitter::EmitAction(Record *Action,
|
||||||
}
|
}
|
||||||
O << "\n" << IndentStr << "};\n";
|
O << "\n" << IndentStr << "};\n";
|
||||||
|
|
||||||
O << IndentStr << "static const uint16_t RegList"
|
O << IndentStr << "static const MCPhysReg RegList"
|
||||||
<< ShadowRegListNumber << "[] = {\n";
|
<< ShadowRegListNumber << "[] = {\n";
|
||||||
O << IndentStr << " ";
|
O << IndentStr << " ";
|
||||||
for (unsigned i = 0, e = ShadowRegList->getSize(); i != e; ++i) {
|
for (unsigned i = 0, e = ShadowRegList->getSize(); i != e; ++i) {
|
||||||
|
@ -196,7 +196,7 @@ void CallingConvEmitter::EmitAction(Record *Action,
|
||||||
|
|
||||||
unsigned ShadowRegListNumber = ++Counter;
|
unsigned ShadowRegListNumber = ++Counter;
|
||||||
|
|
||||||
O << IndentStr << "static const uint16_t ShadowRegList"
|
O << IndentStr << "static const MCPhysReg ShadowRegList"
|
||||||
<< ShadowRegListNumber << "[] = {\n";
|
<< ShadowRegListNumber << "[] = {\n";
|
||||||
O << IndentStr << " ";
|
O << IndentStr << " ";
|
||||||
for (unsigned i = 0, e = ShadowRegList->getSize(); i != e; ++i) {
|
for (unsigned i = 0, e = ShadowRegList->getSize(); i != e; ++i) {
|
||||||
|
|
|
@ -831,7 +831,7 @@ RegisterInfoEmitter::runMCDesc(raw_ostream &OS, CodeGenTarget &Target,
|
||||||
|
|
||||||
// Emit the table of register unit roots. Each regunit has one or two root
|
// Emit the table of register unit roots. Each regunit has one or two root
|
||||||
// registers.
|
// registers.
|
||||||
OS << "extern const uint16_t " << TargetName << "RegUnitRoots[][2] = {\n";
|
OS << "extern const MCPhysReg " << TargetName << "RegUnitRoots[][2] = {\n";
|
||||||
for (unsigned i = 0, e = RegBank.getNumNativeRegUnits(); i != e; ++i) {
|
for (unsigned i = 0, e = RegBank.getNumNativeRegUnits(); i != e; ++i) {
|
||||||
ArrayRef<const CodeGenRegister*> Roots = RegBank.getRegUnit(i).getRoots();
|
ArrayRef<const CodeGenRegister*> Roots = RegBank.getRegUnit(i).getRoots();
|
||||||
assert(!Roots.empty() && "All regunits must have a root register.");
|
assert(!Roots.empty() && "All regunits must have a root register.");
|
||||||
|
@ -858,7 +858,7 @@ RegisterInfoEmitter::runMCDesc(raw_ostream &OS, CodeGenTarget &Target,
|
||||||
|
|
||||||
// Emit the register list now.
|
// Emit the register list now.
|
||||||
OS << " // " << Name << " Register Class...\n"
|
OS << " // " << Name << " Register Class...\n"
|
||||||
<< " const uint16_t " << Name
|
<< " const MCPhysReg " << Name
|
||||||
<< "[] = {\n ";
|
<< "[] = {\n ";
|
||||||
for (unsigned i = 0, e = Order.size(); i != e; ++i) {
|
for (unsigned i = 0, e = Order.size(); i != e; ++i) {
|
||||||
Record *Reg = Order[i];
|
Record *Reg = Order[i];
|
||||||
|
@ -1267,7 +1267,7 @@ RegisterInfoEmitter::runTargetDesc(raw_ostream &OS, CodeGenTarget &Target,
|
||||||
OS << "extern const MCRegisterDesc " << TargetName << "RegDesc[];\n";
|
OS << "extern const MCRegisterDesc " << TargetName << "RegDesc[];\n";
|
||||||
OS << "extern const MCPhysReg " << TargetName << "RegDiffLists[];\n";
|
OS << "extern const MCPhysReg " << TargetName << "RegDiffLists[];\n";
|
||||||
OS << "extern const char " << TargetName << "RegStrings[];\n";
|
OS << "extern const char " << TargetName << "RegStrings[];\n";
|
||||||
OS << "extern const uint16_t " << TargetName << "RegUnitRoots[][2];\n";
|
OS << "extern const MCPhysReg " << TargetName << "RegUnitRoots[][2];\n";
|
||||||
OS << "extern const uint16_t " << TargetName << "SubRegIdxLists[];\n";
|
OS << "extern const uint16_t " << TargetName << "SubRegIdxLists[];\n";
|
||||||
OS << "extern const MCRegisterInfo::SubRegCoveredBits "
|
OS << "extern const MCRegisterInfo::SubRegCoveredBits "
|
||||||
<< TargetName << "SubRegIdxRanges[];\n";
|
<< TargetName << "SubRegIdxRanges[];\n";
|
||||||
|
|
Loading…
Reference in New Issue