summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips/MipsRegisterInfo.cpp
diff options
context:
space:
mode:
authorVasileios Kalintiris <Vasileios.Kalintiris@imgtec.com>2015-10-26 12:38:43 +0000
committerVasileios Kalintiris <Vasileios.Kalintiris@imgtec.com>2015-10-26 12:38:43 +0000
commit43dff0c03324bd8aa2dfa93062db8597ea43f07b (patch)
tree5bdc1797d1b48276b6fd8a4278e35f5904fd7423 /llvm/lib/Target/Mips/MipsRegisterInfo.cpp
parent684af8156c3612964abcdfa41003b3aece1cffeb (diff)
downloadbcm5719-llvm-43dff0c03324bd8aa2dfa93062db8597ea43f07b.tar.gz
bcm5719-llvm-43dff0c03324bd8aa2dfa93062db8597ea43f07b.zip
[mips] Interrupt attribute support for mips32r2+.
Summary: This patch adds support for using the "interrupt" attribute on Mips for interrupt handling functions. At this time only mips32r2+ with the o32 ABI with the static relocation model is supported. Unsupported configurations will be rejected Patch by Simon Dardis (+ clang-format & some trivial changes to follow the LLVM coding standards by me). Reviewers: mpf, dsanders Subscribers: dsanders, vkalintiris, llvm-commits Differential Revision: http://reviews.llvm.org/D10768 llvm-svn: 251286
Diffstat (limited to 'llvm/lib/Target/Mips/MipsRegisterInfo.cpp')
-rw-r--r--llvm/lib/Target/Mips/MipsRegisterInfo.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/MipsRegisterInfo.cpp b/llvm/lib/Target/Mips/MipsRegisterInfo.cpp
index 775d8006fdf..28e5a425849 100644
--- a/llvm/lib/Target/Mips/MipsRegisterInfo.cpp
+++ b/llvm/lib/Target/Mips/MipsRegisterInfo.cpp
@@ -84,6 +84,16 @@ MipsRegisterInfo::getRegPressureLimit(const TargetRegisterClass *RC,
const MCPhysReg *
MipsRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
const MipsSubtarget &Subtarget = MF->getSubtarget<MipsSubtarget>();
+ const Function *F = MF->getFunction();
+ if (F->hasFnAttribute("interrupt")) {
+ if (Subtarget.hasMips64())
+ return Subtarget.hasMips64r6() ? CSR_Interrupt_64R6_SaveList
+ : CSR_Interrupt_64_SaveList;
+ else
+ return Subtarget.hasMips32r6() ? CSR_Interrupt_32R6_SaveList
+ : CSR_Interrupt_32_SaveList;
+ }
+
if (Subtarget.isSingleFloat())
return CSR_SingleFloatOnly_SaveList;
OpenPOWER on IntegriCloud