LLVM  4.0.0
MipsRegisterInfo.h
Go to the documentation of this file.
1 //===-- MipsRegisterInfo.h - Mips Register Information Impl -----*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the Mips implementation of the TargetRegisterInfo class.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_MIPS_MIPSREGISTERINFO_H
15 #define LLVM_LIB_TARGET_MIPS_MIPSREGISTERINFO_H
16 
17 #include "Mips.h"
19 
20 #define GET_REGINFO_HEADER
21 #include "MipsGenRegisterInfo.inc"
22 
23 namespace llvm {
25 public:
26  enum class MipsPtrClass {
27  /// The default register class for integer values.
28  Default = 0,
29  /// The subset of registers permitted in certain microMIPS instructions
30  /// such as lw16.
31  GPR16MM = 1,
32  /// The stack pointer only.
33  StackPointer = 2,
34  /// The global pointer only.
35  GlobalPointer = 3,
36  };
37 
39 
40  /// Get PIC indirect call register
41  static unsigned getPICCallReg();
42 
43  /// Code Generation virtual methods...
45  unsigned Kind) const override;
46 
47  unsigned getRegPressureLimit(const TargetRegisterClass *RC,
48  MachineFunction &MF) const override;
49  const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF) const override;
51  CallingConv::ID) const override;
52  static const uint32_t *getMips16RetHelperMask();
53 
54  BitVector getReservedRegs(const MachineFunction &MF) const override;
55 
56  bool requiresRegisterScavenging(const MachineFunction &MF) const override;
57 
58  bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const override;
59 
60  /// Stack Frame Processing Methods
62  int SPAdj, unsigned FIOperandNum,
63  RegScavenger *RS = nullptr) const override;
64 
65  // Stack realignment queries.
66  bool canRealignStack(const MachineFunction &MF) const override;
67 
68  /// Debug information queries.
69  unsigned getFrameRegister(const MachineFunction &MF) const override;
70 
71  /// \brief Return GPR register class.
72  virtual const TargetRegisterClass *intRegClass(unsigned Size) const = 0;
73 
74 private:
75  virtual void eliminateFI(MachineBasicBlock::iterator II, unsigned OpNo,
76  int FrameIndex, uint64_t StackSize,
77  int64_t SPOffset) const = 0;
78 };
79 
80 } // end namespace llvm
81 
82 #endif
The subset of registers permitted in certain microMIPS instructions such as lw16. ...
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
unsigned getFrameRegister(const MachineFunction &MF) const override
Debug information queries.
unsigned getRegPressureLimit(const TargetRegisterClass *RC, MachineFunction &MF) const override
virtual const TargetRegisterClass * intRegClass(unsigned Size) const =0
Return GPR register class.
BitVector getReservedRegs(const MachineFunction &MF) const override
const TargetRegisterClass * getPointerRegClass(const MachineFunction &MF, unsigned Kind) const override
Code Generation virtual methods...
The default register class for integer values.
static unsigned getPICCallReg()
Get PIC indirect call register.
const MCPhysReg * getCalleeSavedRegs(const MachineFunction *MF) const override
Mips Callee Saved Registers.
static const uint32_t * getMips16RetHelperMask()
bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const override
const unsigned Kind
bool requiresRegisterScavenging(const MachineFunction &MF) const override
void eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj, unsigned FIOperandNum, RegScavenger *RS=nullptr) const override
Stack Frame Processing Methods.
bool canRealignStack(const MachineFunction &MF) const override
const uint32_t * getCallPreservedMask(const MachineFunction &MF, CallingConv::ID) const override