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 LLVM_LIB_TARGET_MIPS_MIPSREGISTERINFO_H
15 #define LLVM_LIB_TARGET_MIPS_MIPSREGISTERINFO_H
18 #include "llvm/Target/TargetRegisterInfo.h"
20 #define GET_REGINFO_HEADER
21 #include "MipsGenRegisterInfo.inc"
26 class MipsRegisterInfo : public MipsGenRegisterInfo {
30 /// getRegisterNumbering - Given the enum value for some register, e.g.
31 /// Mips::RA, return the number that it corresponds to (e.g. 31).
32 static unsigned getRegisterNumbering(unsigned RegEnum);
34 /// Get PIC indirect call register
35 static unsigned getPICCallReg();
37 /// Adjust the Mips stack frame.
38 void adjustMipsStackFrame(MachineFunction &MF) const;
40 /// Code Generation virtual methods...
41 const TargetRegisterClass *getPointerRegClass(const MachineFunction &MF,
42 unsigned Kind) const override;
44 unsigned getRegPressureLimit(const TargetRegisterClass *RC,
45 MachineFunction &MF) const override;
46 const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF) const override;
47 const uint32_t *getCallPreservedMask(const MachineFunction &MF,
48 CallingConv::ID) const override;
49 static const uint32_t *getMips16RetHelperMask();
51 BitVector getReservedRegs(const MachineFunction &MF) const override;
53 bool requiresRegisterScavenging(const MachineFunction &MF) const override;
55 bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const override;
57 /// Stack Frame Processing Methods
58 void eliminateFrameIndex(MachineBasicBlock::iterator II,
59 int SPAdj, unsigned FIOperandNum,
60 RegScavenger *RS = nullptr) const override;
62 void processFunctionBeforeFrameFinalized(MachineFunction &MF,
63 RegScavenger *RS = nullptr) const;
65 /// Debug information queries.
66 unsigned getFrameRegister(const MachineFunction &MF) const override;
68 /// \brief Return GPR register class.
69 virtual const TargetRegisterClass *intRegClass(unsigned Size) const = 0;
72 virtual void eliminateFI(MachineBasicBlock::iterator II, unsigned OpNo,
73 int FrameIndex, uint64_t StackSize,
74 int64_t SPOffset) const = 0;
77 } // end namespace llvm