mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-22 13:29:44 +00:00
Turn on register scavenger for Mips 16
We use an unused Mips 32 register for the emergency slot instead of using the stack. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170665 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9bf571fe2c
commit
1f23239c5b
@ -43,6 +43,32 @@ Mips16RegisterInfo::Mips16RegisterInfo(const MipsSubtarget &ST,
|
|||||||
const Mips16InstrInfo &I)
|
const Mips16InstrInfo &I)
|
||||||
: MipsRegisterInfo(ST), TII(I) {}
|
: MipsRegisterInfo(ST), TII(I) {}
|
||||||
|
|
||||||
|
bool Mips16RegisterInfo::requiresRegisterScavenging
|
||||||
|
(const MachineFunction &MF) const {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
bool Mips16RegisterInfo::requiresFrameIndexScavenging
|
||||||
|
(const MachineFunction &MF) const {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Mips16RegisterInfo::useFPForScavengingIndex
|
||||||
|
(const MachineFunction &MF) const {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Mips16RegisterInfo::saveScavengerRegister
|
||||||
|
(MachineBasicBlock &MBB,
|
||||||
|
MachineBasicBlock::iterator I,
|
||||||
|
MachineBasicBlock::iterator &UseMI,
|
||||||
|
const TargetRegisterClass *RC,
|
||||||
|
unsigned Reg) const {
|
||||||
|
DebugLoc DL;
|
||||||
|
TII.copyPhysReg(MBB, I, DL, Mips::T0, Reg, true);
|
||||||
|
TII.copyPhysReg(MBB, UseMI, DL, Reg, Mips::T0, true);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// This function eliminate ADJCALLSTACKDOWN,
|
// This function eliminate ADJCALLSTACKDOWN,
|
||||||
// ADJCALLSTACKUP pseudo instructions
|
// ADJCALLSTACKUP pseudo instructions
|
||||||
void Mips16RegisterInfo::
|
void Mips16RegisterInfo::
|
||||||
|
@ -27,6 +27,19 @@ public:
|
|||||||
void eliminateCallFramePseudoInstr(MachineFunction &MF,
|
void eliminateCallFramePseudoInstr(MachineFunction &MF,
|
||||||
MachineBasicBlock &MBB,
|
MachineBasicBlock &MBB,
|
||||||
MachineBasicBlock::iterator I) const;
|
MachineBasicBlock::iterator I) const;
|
||||||
|
|
||||||
|
bool requiresRegisterScavenging(const MachineFunction &MF) const;
|
||||||
|
|
||||||
|
bool requiresFrameIndexScavenging(const MachineFunction &MF) const;
|
||||||
|
|
||||||
|
bool useFPForScavengingIndex(const MachineFunction &MF) const;
|
||||||
|
|
||||||
|
bool saveScavengerRegister(MachineBasicBlock &MBB,
|
||||||
|
MachineBasicBlock::iterator I,
|
||||||
|
MachineBasicBlock::iterator &UseMI,
|
||||||
|
const TargetRegisterClass *RC,
|
||||||
|
unsigned Reg) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void eliminateFI(MachineBasicBlock::iterator II, unsigned OpNo,
|
virtual void eliminateFI(MachineBasicBlock::iterator II, unsigned OpNo,
|
||||||
int FrameIndex, uint64_t StackSize,
|
int FrameIndex, uint64_t StackSize,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user