LLVM  8.0.1
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 #include <cstdint>
20 
21 #define GET_REGINFO_HEADER
22 #include "MipsGenRegisterInfo.inc"
23 
24 namespace llvm {
25 
26 class TargetRegisterClass;
27 
29 public:
30  enum class MipsPtrClass {
31  /// The default register class for integer values.
32  Default = 0,
33  /// The subset of registers permitted in certain microMIPS instructions
34  /// such as lw16.
35  GPR16MM = 1,
36  /// The stack pointer only.
37  StackPointer = 2,
38  /// The global pointer only.
39  GlobalPointer = 3,
40  };
41 
43 
44  /// Get PIC indirect call register
45  static unsigned getPICCallReg();
46 
47  /// Code Generation virtual methods...
49  unsigned Kind) const override;
50 
51  unsigned getRegPressureLimit(const TargetRegisterClass *RC,
52  MachineFunction &MF) const override;
53  const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF) const override;
55  CallingConv::ID) const override;
56  static const uint32_t *getMips16RetHelperMask();
57 
58  BitVector getReservedRegs(const MachineFunction &MF) const override;
59 
60  bool requiresRegisterScavenging(const MachineFunction &MF) const override;
61 
62  bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const override;
63 
64  /// Stack Frame Processing Methods
66  int SPAdj, unsigned FIOperandNum,
67  RegScavenger *RS = nullptr) const override;
68 
69  // Stack realignment queries.
70  bool canRealignStack(const MachineFunction &MF) const override;
71 
72  /// Debug information queries.
73  unsigned getFrameRegister(const MachineFunction &MF) const override;
74 
75  /// Return GPR register class.
76  virtual const TargetRegisterClass *intRegClass(unsigned Size) const = 0;
77 
78 private:
79  virtual void eliminateFI(MachineBasicBlock::iterator II, unsigned OpNo,
80  int FrameIndex, uint64_t StackSize,
81  int64_t SPOffset) const = 0;
82 };
83 
84 } // end namespace llvm
85 
86 #endif // LLVM_LIB_TARGET_MIPS_MIPSREGISTERINFO_H
This class represents lattice values for constants.
Definition: AllocatorList.h:24
The subset of registers permitted in certain microMIPS instructions such as lw16. ...
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
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
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
uint32_t Size
Definition: Profile.cpp:47
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