summaryrefslogtreecommitdiff
path: root/lib/Target/Mips/Mips16RegisterInfo.cpp
diff options
context:
space:
mode:
authorReed Kotler <rkotler@mips.com>2012-12-20 04:44:58 +0000
committerReed Kotler <rkotler@mips.com>2012-12-20 04:44:58 +0000
commit1f23239c5bdbeb45a612238acd48bb497b3cce15 (patch)
treeb81c55fbd2627a7973812e30e942fae90544b54f /lib/Target/Mips/Mips16RegisterInfo.cpp
parent9bf571fe2c24305aee6a930ed3b2561f6d4ff237 (diff)
downloadllvm-1f23239c5bdbeb45a612238acd48bb497b3cce15.tar.gz
llvm-1f23239c5bdbeb45a612238acd48bb497b3cce15.tar.bz2
llvm-1f23239c5bdbeb45a612238acd48bb497b3cce15.tar.xz
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.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/Target/Mips/Mips16RegisterInfo.cpp b/lib/Target/Mips/Mips16RegisterInfo.cpp
index 6b87ecb08c..ff0f5a0dfb 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::