LLVM  3.7.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:
27 
28  /// getRegisterNumbering - Given the enum value for some register, e.g.
29  /// Mips::RA, return the number that it corresponds to (e.g. 31).
30  static unsigned getRegisterNumbering(unsigned RegEnum);
31 
32  /// Get PIC indirect call register
33  static unsigned getPICCallReg();
34 
35  /// Adjust the Mips stack frame.
36  void adjustMipsStackFrame(MachineFunction &MF) const;
37 
38  /// Code Generation virtual methods...
40  unsigned Kind) const override;
41 
42  unsigned getRegPressureLimit(const TargetRegisterClass *RC,
43  MachineFunction &MF) const override;
44  const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF) const override;
45  const uint32_t *getCallPreservedMask(const MachineFunction &MF,
46  CallingConv::ID) const override;
47  static const uint32_t *getMips16RetHelperMask();
48 
49  BitVector getReservedRegs(const MachineFunction &MF) const override;
50 
51  bool requiresRegisterScavenging(const MachineFunction &MF) const override;
52 
53  bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const override;
54 
55  /// Stack Frame Processing Methods
57  int SPAdj, unsigned FIOperandNum,
58  RegScavenger *RS = nullptr) const override;
59 
61  RegScavenger *RS = nullptr) const;
62 
63  // Stack realignment queries.
64  bool canRealignStack(const MachineFunction &MF) const;
65 
66  bool needsStackRealignment(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
void processFunctionBeforeFrameFinalized(MachineFunction &MF, RegScavenger *RS=nullptr) const
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
static unsigned getRegisterNumbering(unsigned RegEnum)
getRegisterNumbering - Given the enum value for some register, e.g.
virtual const TargetRegisterClass * intRegClass(unsigned Size) const =0
Return GPR register class.
BitVector getReservedRegs(const MachineFunction &MF) const override
bundle_iterator< MachineInstr, instr_iterator > iterator
const TargetRegisterClass * getPointerRegClass(const MachineFunction &MF, unsigned Kind) const override
Code Generation virtual methods...
static unsigned getPICCallReg()
Get PIC indirect call register.
const MCPhysReg * getCalleeSavedRegs(const MachineFunction *MF) const override
Mips Callee Saved Registers.
bool canRealignStack(const MachineFunction &MF) const
void adjustMipsStackFrame(MachineFunction &MF) const
Adjust the Mips stack frame.
static const uint32_t * getMips16RetHelperMask()
bool needsStackRealignment(const MachineFunction &MF) const override
bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const override
const ARM::ArchExtKind 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.
const uint32_t * getCallPreservedMask(const MachineFunction &MF, CallingConv::ID) const override