From 526522728ccac69dc8df2aa91735ec5c7495fa20 Mon Sep 17 00:00:00 2001 From: Reed Kotler Date: Tue, 10 Dec 2013 14:29:38 +0000 Subject: 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 --- lib/Target/Mips/MipsRegisterInfo.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/Target/Mips/MipsRegisterInfo.cpp') 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. -- cgit v1.2.3