Stop reserving register $gp. Do not call isGPFI to check whether a frame object
authorAkira Hatanaka <ahatanaka@mips.com>
Sat, 12 May 2012 03:21:18 +0000 (03:21 +0000)
committerAkira Hatanaka <ahatanaka@mips.com>
Sat, 12 May 2012 03:21:18 +0000 (03:21 +0000)
is the $gp save slot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156694 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Mips/MipsRegisterInfo.cpp

index 37b0ed2666f4885ec10272c28a022b55732adaf4..5fdeda92ecb0348377927fe9273f52db98060706 100644 (file)
@@ -118,12 +118,6 @@ getReservedRegs(const MachineFunction &MF) const {
       Reserved.set(*Reg);
   }
 
-  // If GP is dedicated as a global base register, reserve it.
-  if (MF.getInfo<MipsFunctionInfo>()->globalBaseRegFixed()) {
-    Reserved.set(Mips::GP);
-    Reserved.set(Mips::GP_64);
-  }
-
   // Reserve FP if this function should have a dedicated frame pointer register.
   if (MF.getTarget().getFrameLowering()->hasFP(MF)) {
     Reserved.set(Mips::FP);
@@ -217,8 +211,7 @@ eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj,
   //   incoming argument, callee-saved register location or local variable.
   int64_t Offset;
 
-  if (MipsFI->isOutArgFI(FrameIndex) || MipsFI->isGPFI(FrameIndex) ||
-      MipsFI->isDynAllocFI(FrameIndex))
+  if (MipsFI->isOutArgFI(FrameIndex) || MipsFI->isDynAllocFI(FrameIndex))
     Offset = spOffset;
   else
     Offset = spOffset + (int64_t)stackSize;