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"
24 class MipsRegisterInfo : public MipsGenRegisterInfo {
26 enum class MipsPtrClass {
27 /// The default register class for integer values.
29 /// The subset of registers permitted in certain microMIPS instructions
32 /// The stack pointer only.
34 /// The global pointer only.
40 /// Get PIC indirect call register
41 static unsigned getPICCallReg();
43 /// Code Generation virtual methods...
44 const TargetRegisterClass *getPointerRegClass(const MachineFunction &MF,
45 unsigned Kind) const override;
47 unsigned getRegPressureLimit(const TargetRegisterClass *RC,
48 MachineFunction &MF) const override;
49 const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF) const override;
50 const uint32_t *getCallPreservedMask(const MachineFunction &MF,
51 CallingConv::ID) const override;
52 static const uint32_t *getMips16RetHelperMask();
54 BitVector getReservedRegs(const MachineFunction &MF) const override;
56 bool requiresRegisterScavenging(const MachineFunction &MF) const override;
58 bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const override;
60 /// Stack Frame Processing Methods
61 void eliminateFrameIndex(MachineBasicBlock::iterator II,
62 int SPAdj, unsigned FIOperandNum,
63 RegScavenger *RS = nullptr) const override;
65 // Stack realignment queries.
66 bool canRealignStack(const MachineFunction &MF) const override;
68 /// Debug information queries.
69 unsigned getFrameRegister(const MachineFunction &MF) const override;
71 /// \brief Return GPR register class.
72 virtual const TargetRegisterClass *intRegClass(unsigned Size) const = 0;
75 virtual void eliminateFI(MachineBasicBlock::iterator II, unsigned OpNo,
76 int FrameIndex, uint64_t StackSize,
77 int64_t SPOffset) const = 0;
80 } // end namespace llvm