LLVM  13.0.0git
MipsRegisterInfo.h
Go to the documentation of this file.
1 //===- MipsRegisterInfo.h - Mips Register Information Impl ------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the Mips implementation of the TargetRegisterInfo class.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_LIB_TARGET_MIPS_MIPSREGISTERINFO_H
14 #define LLVM_LIB_TARGET_MIPS_MIPSREGISTERINFO_H
15 
16 #include "Mips.h"
18 #include <cstdint>
19 
20 #define GET_REGINFO_HEADER
21 #include "MipsGenRegisterInfo.inc"
22 
23 namespace llvm {
24 
25 class TargetRegisterClass;
26 
28 public:
29  enum class MipsPtrClass {
30  /// The default register class for integer values.
31  Default = 0,
32  /// The subset of registers permitted in certain microMIPS instructions
33  /// such as lw16.
34  GPR16MM = 1,
35  /// The stack pointer only.
36  StackPointer = 2,
37  /// The global pointer only.
38  GlobalPointer = 3,
39  };
40 
42 
43  /// Get PIC indirect call register
44  static unsigned getPICCallReg();
45 
46  /// Code Generation virtual methods...
48  unsigned Kind) const override;
49 
50  unsigned getRegPressureLimit(const TargetRegisterClass *RC,
51  MachineFunction &MF) const override;
52  const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF) const override;
54  CallingConv::ID) const override;
55  static const uint32_t *getMips16RetHelperMask();
56 
57  BitVector getReservedRegs(const MachineFunction &MF) const override;
58 
59  bool requiresRegisterScavenging(const MachineFunction &MF) const override;
60 
61  /// Stack Frame Processing Methods
63  int SPAdj, unsigned FIOperandNum,
64  RegScavenger *RS = nullptr) const override;
65 
66  // Stack realignment queries.
67  bool canRealignStack(const MachineFunction &MF) const override;
68 
69  /// Debug information queries.
70  Register getFrameRegister(const MachineFunction &MF) const override;
71 
72  /// Return GPR register class.
73  virtual const TargetRegisterClass *intRegClass(unsigned Size) const = 0;
74 
75 private:
76  virtual void eliminateFI(MachineBasicBlock::iterator II, unsigned OpNo,
77  int FrameIndex, uint64_t StackSize,
78  int64_t SPOffset) const = 0;
79 };
80 
81 } // end namespace llvm
82 
83 #endif // LLVM_LIB_TARGET_MIPS_MIPSREGISTERINFO_H
llvm::Check::Size
@ Size
Definition: FileCheck.h:73
llvm
Definition: AllocatorList.h:23
llvm::MipsRegisterInfo::intRegClass
virtual const TargetRegisterClass * intRegClass(unsigned Size) const =0
Return GPR register class.
MachineBasicBlock.h
llvm::MipsRegisterInfo::MipsPtrClass::GlobalPointer
@ GlobalPointer
The global pointer only.
MipsGenRegisterInfo
llvm::MipsRegisterInfo::MipsPtrClass::Default
@ Default
The default register class for integer values.
llvm::MipsRegisterInfo::getCalleeSavedRegs
const MCPhysReg * getCalleeSavedRegs(const MachineFunction *MF) const override
Mips Callee Saved Registers.
Definition: MipsRegisterInfo.cpp:93
llvm::MipsRegisterInfo::getFrameRegister
Register getFrameRegister(const MachineFunction &MF) const override
Debug information queries.
Definition: MipsRegisterInfo.cpp:275
llvm::TargetRegisterClass
Definition: TargetRegisterInfo.h:46
Mips.h
llvm::MipsRegisterInfo::getMips16RetHelperMask
static const uint32_t * getMips16RetHelperMask()
Definition: MipsRegisterInfo.cpp:145
llvm::MipsRegisterInfo::getRegPressureLimit
unsigned getRegPressureLimit(const TargetRegisterClass *RC, MachineFunction &MF) const override
Definition: MipsRegisterInfo.cpp:67
llvm::BitVector
Definition: BitVector.h:74
llvm::lltok::Kind
Kind
Definition: LLToken.h:18
llvm::CallingConv::ID
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition: CallingConv.h:24
llvm::MipsRegisterInfo::MipsPtrClass::GPR16MM
@ GPR16MM
The subset of registers permitted in certain microMIPS instructions such as lw16.
llvm::RegScavenger
Definition: RegisterScavenging.h:34
llvm::MipsRegisterInfo
Definition: MipsRegisterInfo.h:27
llvm::MachineFunction
Definition: MachineFunction.h:230
llvm::MipsRegisterInfo::getPointerRegClass
const TargetRegisterClass * getPointerRegClass(const MachineFunction &MF, unsigned Kind) const override
Code Generation virtual methods...
Definition: MipsRegisterInfo.cpp:47
llvm::MipsRegisterInfo::MipsPtrClass::StackPointer
@ StackPointer
The stack pointer only.
uint32_t
llvm::MipsRegisterInfo::eliminateFrameIndex
void eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj, unsigned FIOperandNum, RegScavenger *RS=nullptr) const override
Stack Frame Processing Methods.
Definition: MipsRegisterInfo.cpp:251
llvm::Register
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
llvm::ISD::FrameIndex
@ FrameIndex
Definition: ISDOpcodes.h:73
uint16_t
llvm::MipsRegisterInfo::getReservedRegs
BitVector getReservedRegs(const MachineFunction &MF) const override
Definition: MipsRegisterInfo.cpp:150
llvm::MipsRegisterInfo::canRealignStack
bool canRealignStack(const MachineFunction &MF) const override
Definition: MipsRegisterInfo.cpp:288
llvm::MipsRegisterInfo::getPICCallReg
static unsigned getPICCallReg()
Get PIC indirect call register.
Definition: MipsRegisterInfo.cpp:44
llvm::MachineInstrBundleIterator< MachineInstr >
llvm::MipsRegisterInfo::getCallPreservedMask
const uint32_t * getCallPreservedMask(const MachineFunction &MF, CallingConv::ID) const override
Definition: MipsRegisterInfo.cpp:124
llvm::MipsRegisterInfo::MipsPtrClass
MipsPtrClass
Definition: MipsRegisterInfo.h:29
llvm::MipsRegisterInfo::requiresRegisterScavenging
bool requiresRegisterScavenging(const MachineFunction &MF) const override
Definition: MipsRegisterInfo.cpp:243
llvm::MipsRegisterInfo::MipsRegisterInfo
MipsRegisterInfo()
Definition: MipsRegisterInfo.cpp:42