summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips/MipsRegisterInfo.cpp
diff options
context:
space:
mode:
authorReed Kotler <rkotler@mips.com>2013-12-10 14:29:38 +0000
committerReed Kotler <rkotler@mips.com>2013-12-10 14:29:38 +0000
commit0ff40017815297785c8b634ec03a47f12ca19f86 (patch)
treeb8d77285ab0ebfcdd64f9df19f3d766272535fa4 /llvm/lib/Target/Mips/MipsRegisterInfo.cpp
parent0508125cd41e3d89bf419049ab547dc1df5be0db (diff)
downloadbcm5719-llvm-0ff40017815297785c8b634ec03a47f12ca19f86.tar.gz
bcm5719-llvm-0ff40017815297785c8b634ec03a47f12ca19f86.zip
Next step in Mips16 prologue/epilogue cleanup.
Save S2(reg 18) only when we are calling floating point stubs that have a return value of float or complex. Some more work to make this better but this is the first step. llvm-svn: 196921
Diffstat (limited to 'llvm/lib/Target/Mips/MipsRegisterInfo.cpp')
-rw-r--r--llvm/lib/Target/Mips/MipsRegisterInfo.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/MipsRegisterInfo.cpp b/llvm/lib/Target/Mips/MipsRegisterInfo.cpp
index 3105b020845..65b1f8cf2d1 100644
--- a/llvm/lib/Target/Mips/MipsRegisterInfo.cpp
+++ b/llvm/lib/Target/Mips/MipsRegisterInfo.cpp
@@ -27,6 +27,7 @@
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/DebugInfo.h"
#include "llvm/IR/Constants.h"
+#include "llvm/IR/Function.h"
#include "llvm/IR/Type.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
@@ -183,6 +184,8 @@ getReservedRegs(const MachineFunction &MF) const {
Reserved.set(Mips::RA_64);
Reserved.set(Mips::T0);
Reserved.set(Mips::T1);
+ if (MF.getFunction()->hasFnAttribute("saveS2"))
+ Reserved.set(Mips::S2);
}
// Reserve GP if small section is used.
OpenPOWER on IntegriCloud