summaryrefslogtreecommitdiff
path: root/lib/Target/ARM/ARMBaseRegisterInfo.h
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-12-02 07:38:06 +0000
committerBill Wendling <isanbard@gmail.com>2013-12-02 07:38:06 +0000
commit1b26fdbf1f01e90b803cc035b6b932cd95c76830 (patch)
treec9717538bdb0fd127cbdd8cba12633cb32552fa8 /lib/Target/ARM/ARMBaseRegisterInfo.h
parent3d238de4d54eb0b16afd96a57f49f92b2f7748e0 (diff)
downloadllvm-1b26fdbf1f01e90b803cc035b6b932cd95c76830.tar.gz
llvm-1b26fdbf1f01e90b803cc035b6b932cd95c76830.tar.bz2
llvm-1b26fdbf1f01e90b803cc035b6b932cd95c76830.tar.xz
Merging r196046:
------------------------------------------------------------------------ r196046 | tnorthover | 2013-12-01 06:16:24 -0800 (Sun, 01 Dec 2013) | 8 lines ARM: fix bug in -Oz stack adjustment folding Previously, we clobbered callee-saved registers when folding an "add sp, #N" into a "pop {rD, ...}" instruction. This change checks whether a register we're going to add to the "pop" could actually be live outside the function before doing so and should fix the issue. This should fix PR18081. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@196074 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMBaseRegisterInfo.h')
-rw-r--r--lib/Target/ARM/ARMBaseRegisterInfo.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Target/ARM/ARMBaseRegisterInfo.h b/lib/Target/ARM/ARMBaseRegisterInfo.h
index 0d4f54f891..e28fff68f4 100644
--- a/lib/Target/ARM/ARMBaseRegisterInfo.h
+++ b/lib/Target/ARM/ARMBaseRegisterInfo.h
@@ -72,6 +72,14 @@ static inline bool isARMArea3Register(unsigned Reg, bool isIOS) {
}
}
+static inline bool isCalleeSavedRegister(unsigned Reg,
+ const MCPhysReg *CSRegs) {
+ for (unsigned i = 0; CSRegs[i]; ++i)
+ if (Reg == CSRegs[i])
+ return true;
+ return false;
+}
+
class ARMBaseRegisterInfo : public ARMGenRegisterInfo {
protected:
const ARMSubtarget &STI;