summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips/MipsRegisterInfo.cpp
diff options
context:
space:
mode:
authorDaniel Sanders <daniel.sanders@imgtec.com>2014-08-08 10:01:29 +0000
committerDaniel Sanders <daniel.sanders@imgtec.com>2014-08-08 10:01:29 +0000
commit35837ac9a934ab77422f3eb60da18f7d051f3692 (patch)
tree9da4f7d17826b1d70da012db2675983f243bd1c7 /llvm/lib/Target/Mips/MipsRegisterInfo.cpp
parent6b0fe34cc5b89e2ed64efbb12385aad25d77ebfa (diff)
downloadbcm5719-llvm-35837ac9a934ab77422f3eb60da18f7d051f3692.tar.gz
bcm5719-llvm-35837ac9a934ab77422f3eb60da18f7d051f3692.zip
[mips] Initial implementation of -mabicalls/-mno-abicalls.
This patch implements the main rules for -mno-abicalls such as reserving $gp, and emitting the correct .option directive. Patch by Matheus Almeida and Toma Tabacu Differential Revision: http://reviews.llvm.org/D4231 llvm-svn: 215194
Diffstat (limited to 'llvm/lib/Target/Mips/MipsRegisterInfo.cpp')
-rw-r--r--llvm/lib/Target/Mips/MipsRegisterInfo.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/MipsRegisterInfo.cpp b/llvm/lib/Target/Mips/MipsRegisterInfo.cpp
index ab371da72ca..20ef3f387dc 100644
--- a/llvm/lib/Target/Mips/MipsRegisterInfo.cpp
+++ b/llvm/lib/Target/Mips/MipsRegisterInfo.cpp
@@ -149,6 +149,12 @@ getReservedRegs(const MachineFunction &MF) const {
for (unsigned I = 0; I < array_lengthof(ReservedGPR64); ++I)
Reserved.set(ReservedGPR64[I]);
+ // For mno-abicalls, GP is a program invariant!
+ if (!Subtarget.isABICalls()) {
+ Reserved.set(Mips::GP);
+ Reserved.set(Mips::GP_64);
+ }
+
if (Subtarget.isFP64bit()) {
// Reserve all registers in AFGR64.
for (RegIter Reg = Mips::AFGR64RegClass.begin(),
OpenPOWER on IntegriCloud