mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Make consistent use of MCPhysReg instead of uint16_t throughout the tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205610 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -49,9 +49,9 @@ ARMBaseRegisterInfo::ARMBaseRegisterInfo(const ARMSubtarget &sti)
|
||||
BasePtr(ARM::R6) {
|
||||
}
|
||||
|
||||
const uint16_t*
|
||||
const MCPhysReg*
|
||||
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_AAPCS_SaveList;
|
||||
|
||||
|
@@ -100,7 +100,7 @@ protected:
|
||||
|
||||
public:
|
||||
/// Code Generation virtual methods...
|
||||
const uint16_t *
|
||||
const MCPhysReg *
|
||||
getCalleeSavedRegs(const MachineFunction *MF = 0) const override;
|
||||
const uint32_t *getCallPreservedMask(CallingConv::ID) const override;
|
||||
const uint32_t *getNoPreservedMask() const;
|
||||
|
@@ -28,7 +28,7 @@ namespace llvm {
|
||||
static bool f64AssignAPCS(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
|
||||
CCValAssign::LocInfo &LocInfo,
|
||||
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.
|
||||
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,
|
||||
CCValAssign::LocInfo &LocInfo,
|
||||
CCState &State, bool CanFail) {
|
||||
static const uint16_t HiRegList[] = { ARM::R0, ARM::R2 };
|
||||
static const uint16_t LoRegList[] = { ARM::R1, ARM::R3 };
|
||||
static const uint16_t ShadowRegList[] = { ARM::R0, ARM::R1 };
|
||||
static const uint16_t GPRArgRegs[] = { ARM::R0, ARM::R1, ARM::R2, ARM::R3 };
|
||||
static const MCPhysReg HiRegList[] = { ARM::R0, ARM::R2 };
|
||||
static const MCPhysReg LoRegList[] = { ARM::R1, ARM::R3 };
|
||||
static const MCPhysReg ShadowRegList[] = { ARM::R0, ARM::R1 };
|
||||
static const MCPhysReg GPRArgRegs[] = { ARM::R0, ARM::R1, ARM::R2, ARM::R3 };
|
||||
|
||||
unsigned Reg = State.AllocateReg(HiRegList, ShadowRegList, 2);
|
||||
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,
|
||||
CCValAssign::LocInfo &LocInfo, CCState &State) {
|
||||
static const uint16_t HiRegList[] = { ARM::R0, ARM::R2 };
|
||||
static const uint16_t LoRegList[] = { ARM::R1, ARM::R3 };
|
||||
static const MCPhysReg HiRegList[] = { ARM::R0, ARM::R2 };
|
||||
static const MCPhysReg LoRegList[] = { ARM::R1, ARM::R3 };
|
||||
|
||||
unsigned Reg = State.AllocateReg(HiRegList, LoRegList, 2);
|
||||
if (Reg == 0)
|
||||
|
@@ -87,7 +87,7 @@ ARMFrameLowering::canSimplifyCallFramePseudos(const MachineFunction &MF) const {
|
||||
|
||||
static bool isCSRestore(MachineInstr *MI,
|
||||
const ARMBaseInstrInfo &TII,
|
||||
const uint16_t *CSRegs) {
|
||||
const MCPhysReg *CSRegs) {
|
||||
// Integer spill area is handled with "pop".
|
||||
if (isPopOpcode(MI->getOpcode())) {
|
||||
// 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);
|
||||
} else {
|
||||
// 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()) {
|
||||
do {
|
||||
--MBBI;
|
||||
@@ -1368,7 +1368,7 @@ ARMFrameLowering::processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
|
||||
|
||||
// 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.
|
||||
const uint16_t *CSRegs = RegInfo->getCalleeSavedRegs(&MF);
|
||||
const MCPhysReg *CSRegs = RegInfo->getCalleeSavedRegs(&MF);
|
||||
for (unsigned i = 0; CSRegs[i]; ++i) {
|
||||
unsigned Reg = CSRegs[i];
|
||||
bool Spilled = false;
|
||||
|
@@ -79,7 +79,7 @@ namespace {
|
||||
}
|
||||
|
||||
// The APCS parameter registers.
|
||||
static const uint16_t GPRArgRegs[] = {
|
||||
static const MCPhysReg GPRArgRegs[] = {
|
||||
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.
|
||||
const uint16_t *SavedRegs = RI.getCalleeSavedRegs(MF);
|
||||
const MCPhysReg *SavedRegs = RI.getCalleeSavedRegs(MF);
|
||||
SmallVector<MachineBasicBlock*, 64> MBBLPads;
|
||||
for (SmallPtrSet<MachineBasicBlock*, 64>::iterator
|
||||
I = InvokeBBs.begin(), E = InvokeBBs.end(); I != E; ++I) {
|
||||
|
@@ -293,7 +293,7 @@ void Thumb1FrameLowering::emitPrologue(MachineFunction &MF) const {
|
||||
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 &&
|
||||
MI->getOperand(1).isFI() &&
|
||||
isCalleeSavedRegister(MI->getOperand(0).getReg(), CSRegs))
|
||||
@@ -328,7 +328,7 @@ void Thumb1FrameLowering::emitEpilogue(MachineFunction &MF,
|
||||
int NumBytes = (int)MFI->getStackSize();
|
||||
assert((unsigned)NumBytes >= ArgRegsSaveSize &&
|
||||
"ArgRegsSaveSize is included in NumBytes");
|
||||
const uint16_t *CSRegs = RegInfo->getCalleeSavedRegs();
|
||||
const MCPhysReg *CSRegs = RegInfo->getCalleeSavedRegs();
|
||||
unsigned FramePtr = RegInfo->getFrameRegister(MF);
|
||||
|
||||
if (!AFI->hasStackFrame()) {
|
||||
|
Reference in New Issue
Block a user