diff options
author | Reed Kotler <rkotler@mips.com> | 2012-12-20 04:44:58 +0000 |
---|---|---|
committer | Reed Kotler <rkotler@mips.com> | 2012-12-20 04:44:58 +0000 |
commit | 1f23239c5bdbeb45a612238acd48bb497b3cce15 (patch) | |
tree | b81c55fbd2627a7973812e30e942fae90544b54f /lib/Target/Mips/Mips16RegisterInfo.cpp | |
parent | 9bf571fe2c24305aee6a930ed3b2561f6d4ff237 (diff) | |
download | external_llvm-1f23239c5bdbeb45a612238acd48bb497b3cce15.zip external_llvm-1f23239c5bdbeb45a612238acd48bb497b3cce15.tar.gz external_llvm-1f23239c5bdbeb45a612238acd48bb497b3cce15.tar.bz2 |
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
Diffstat (limited to 'lib/Target/Mips/Mips16RegisterInfo.cpp')
-rw-r--r-- | lib/Target/Mips/Mips16RegisterInfo.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/Target/Mips/Mips16RegisterInfo.cpp b/lib/Target/Mips/Mips16RegisterInfo.cpp index 6b87ecb..ff0f5a0 100644 --- a/lib/Target/Mips/Mips16RegisterInfo.cpp +++ b/lib/Target/Mips/Mips16RegisterInfo.cpp @@ -43,6 +43,32 @@ Mips16RegisterInfo::Mips16RegisterInfo(const MipsSubtarget &ST, const Mips16InstrInfo &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, // ADJCALLSTACKUP pseudo instructions void Mips16RegisterInfo:: |