diff options
author | Reed Kotler <rkotler@mips.com> | 2013-12-10 14:29:38 +0000 |
---|---|---|
committer | Reed Kotler <rkotler@mips.com> | 2013-12-10 14:29:38 +0000 |
commit | 526522728ccac69dc8df2aa91735ec5c7495fa20 (patch) | |
tree | 385d401809a1e466112061f3b755402d444bb29c /lib/Target/Mips/MipsRegisterInfo.cpp | |
parent | 8a8581ca4b4c9ca1797ec5f4fa7d5524a59239ea (diff) | |
download | llvm-526522728ccac69dc8df2aa91735ec5c7495fa20.tar.gz llvm-526522728ccac69dc8df2aa91735ec5c7495fa20.tar.bz2 llvm-526522728ccac69dc8df2aa91735ec5c7495fa20.tar.xz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196921 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/MipsRegisterInfo.cpp')
-rw-r--r-- | lib/Target/Mips/MipsRegisterInfo.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Target/Mips/MipsRegisterInfo.cpp b/lib/Target/Mips/MipsRegisterInfo.cpp index 3105b02084..65b1f8cf2d 100644 --- a/lib/Target/Mips/MipsRegisterInfo.cpp +++ b/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. |