Infrastructure for getting the machine code size of a function and an instruction...
[oota-llvm.git] / lib / Target / Mips / MipsRegisterInfo.cpp
index 2988eea01140a23cdb960d91553ea23c285bc858..8d53eada528c090a537b46872215af46c9173b6b 100644 (file)
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// This file contains the MIPS implementation of the MRegisterInfo class.
+// This file contains the MIPS implementation of the TargetRegisterInfo class.
 //
 //===----------------------------------------------------------------------===//
 
@@ -81,47 +81,7 @@ getRegisterNumbering(unsigned RegEnum)
     case Mips::RA   : return 31;
     default: assert(0 && "Unknown register number!");
   }    
-}
-
-void MipsRegisterInfo::reMaterialize(MachineBasicBlock &MBB, 
-                                      MachineBasicBlock::iterator I,
-                                      unsigned DestReg, 
-                                      const MachineInstr *Orig) const 
-{
-    MachineInstr *MI = Orig->clone();
-    MI->getOperand(0).setReg(DestReg);
-    MBB.insert(I, MI);
-}
-
-MachineInstr *MipsRegisterInfo::
-foldMemoryOperand(MachineInstr* MI,
-                  SmallVectorImpl<unsigned> &Ops, int FI) const 
-{
-  if (Ops.size() != 1) return NULL;
-
-  MachineInstr *NewMI = NULL;
-
-  switch (MI->getOpcode()) 
-  {
-    case Mips::ADDu:
-      if ((MI->getOperand(0).isRegister()) &&
-        (MI->getOperand(1).isRegister()) && 
-        (MI->getOperand(1).getReg() == Mips::ZERO) &&
-        (MI->getOperand(2).isRegister())) 
-      {
-        if (Ops[0] == 0)    // COPY -> STORE
-          NewMI = BuildMI(TII.get(Mips::SW)).addFrameIndex(FI)
-                  .addImm(0).addReg(MI->getOperand(2).getReg());
-        else                   // COPY -> LOAD
-          NewMI = BuildMI(TII.get(Mips::LW), MI->getOperand(0)
-                  .getReg()).addImm(0).addFrameIndex(FI);
-      }
-      break;
-  }
-
-  if (NewMI)
-    NewMI->copyKillDeadInfo(MI);
-  return NewMI;
+  return 0; // Not reached
 }
 
 //===----------------------------------------------------------------------===//
@@ -323,6 +283,9 @@ emitPrologue(MachineFunction &MF) const
     FPOffset = NumBytes;
     RAOffset = 0;
     NumBytes += 4;
+  } else {
+    // No calls and no fp.
+    RAOffset = FPOffset = 0;
   }
 
   MFI->setObjectOffset(MFI->CreateStackObject(4,4), FPOffset);