1 //===- MipsRegisterInfo.h - Mips Register Information Impl ------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by Bruno Cardoso Lopes and is distributed under the
6 // University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the Mips implementation of the MRegisterInfo class.
12 //===----------------------------------------------------------------------===//
14 #ifndef MIPSREGISTERINFO_H
15 #define MIPSREGISTERINFO_H
17 #include "llvm/Target/MRegisterInfo.h"
18 #include "MipsGenRegisterInfo.h.inc"
22 class TargetInstrInfo;
25 struct MipsRegisterInfo : public MipsGenRegisterInfo {
26 const TargetInstrInfo &TII;
28 MipsRegisterInfo(const TargetInstrInfo &tii);
30 /// Code Generation virtual methods...
31 void storeRegToStackSlot(MachineBasicBlock &MBB,
32 MachineBasicBlock::iterator MBBI,
33 unsigned SrcReg, int FrameIndex,
34 const TargetRegisterClass *RC) const;
36 void loadRegFromStackSlot(MachineBasicBlock &MBB,
37 MachineBasicBlock::iterator MBBI,
38 unsigned DestReg, int FrameIndex,
39 const TargetRegisterClass *RC) const;
41 void reMaterialize(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
42 unsigned DestReg, const MachineInstr *Orig) const;
44 MachineInstr* foldMemoryOperand(MachineInstr* MI, unsigned OpNum,
45 int FrameIndex) const;
47 void copyRegToReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
48 unsigned DestReg, unsigned SrcReg,
49 const TargetRegisterClass *RC) const;
52 const unsigned *getCalleeSavedRegs(const MachineFunction* MF = 0) const;
54 const TargetRegisterClass* const*
55 getCalleeSavedRegClasses(const MachineFunction* MF = 0) const;
57 BitVector getReservedRegs(const MachineFunction &MF) const;
59 bool hasFP(const MachineFunction &MF) const;
61 void eliminateCallFramePseudoInstr(MachineFunction &MF,
62 MachineBasicBlock &MBB,
63 MachineBasicBlock::iterator I) const;
65 void eliminateFrameIndex(MachineBasicBlock::iterator II,
66 int SPAdj, RegScavenger *RS = NULL) const;
68 void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
70 void emitPrologue(MachineFunction &MF) const;
71 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
73 // Debug information queries.
74 unsigned getRARegister() const;
75 unsigned getFrameRegister(MachineFunction &MF) const;
77 // Exception handling queries.
78 unsigned getEHExceptionRegister() const;
79 unsigned getEHHandlerRegister() const;
82 } // end namespace llvm