1 //===-- MipsRegisterInfo.h - Mips Register Information Impl -----*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the Mips implementation of the TargetRegisterInfo class.
12 //===----------------------------------------------------------------------===//
14 #ifndef MIPSREGISTERINFO_H
15 #define MIPSREGISTERINFO_H
18 #include "llvm/Target/TargetRegisterInfo.h"
20 #define GET_REGINFO_HEADER
21 #include "MipsGenRegisterInfo.inc"
25 class TargetInstrInfo;
28 class MipsRegisterInfo : public MipsGenRegisterInfo {
30 const MipsSubtarget &Subtarget;
31 const TargetInstrInfo &TII;
34 MipsRegisterInfo(const MipsSubtarget &Subtarget, const TargetInstrInfo &tii);
36 /// getRegisterNumbering - Given the enum value for some register, e.g.
37 /// Mips::RA, return the number that it corresponds to (e.g. 31).
38 static unsigned getRegisterNumbering(unsigned RegEnum);
40 /// Get PIC indirect call register
41 static unsigned getPICCallReg();
43 /// Adjust the Mips stack frame.
44 void adjustMipsStackFrame(MachineFunction &MF) const;
46 /// Code Generation virtual methods...
47 const uint16_t *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
48 const uint32_t *getCallPreservedMask(CallingConv::ID) const;
50 BitVector getReservedRegs(const MachineFunction &MF) const;
52 virtual bool requiresRegisterScavenging(const MachineFunction &MF) const;
54 virtual bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const;
56 /// Stack Frame Processing Methods
57 void eliminateFrameIndex(MachineBasicBlock::iterator II,
58 int SPAdj, RegScavenger *RS = NULL) const;
60 void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
62 /// Debug information queries.
63 unsigned getFrameRegister(const MachineFunction &MF) const;
65 /// Exception handling queries.
66 unsigned getEHExceptionRegister() const;
67 unsigned getEHHandlerRegister() const;
70 virtual void eliminateFI(MachineBasicBlock::iterator II, unsigned OpNo,
71 int FrameIndex, uint64_t StackSize,
72 int64_t SPOffset) const = 0;
75 } // end namespace llvm