LLVM  5.0.0
HexagonRegisterInfo.h
Go to the documentation of this file.
1 //==- HexagonRegisterInfo.h - Hexagon 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 Hexagon implementation of the TargetRegisterInfo
11 // class.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONREGISTERINFO_H
16 #define LLVM_LIB_TARGET_HEXAGON_HEXAGONREGISTERINFO_H
17 
20 
21 #define GET_REGINFO_HEADER
22 #include "HexagonGenRegisterInfo.inc"
23 
24 namespace llvm {
25 
26 namespace Hexagon {
27  // Generic (pseudo) subreg indices for use with getHexagonSubRegIndex.
28  enum { ps_sub_lo = 0, ps_sub_hi = 1 };
29 }
30 
32 public:
34 
35  /// Code Generation virtual methods...
37  const override;
39  CallingConv::ID) const override;
40 
41  BitVector getReservedRegs(const MachineFunction &MF) const override;
42 
44  unsigned FIOperandNum, RegScavenger *RS = nullptr) const override;
45 
46  /// Returns true since we may need scavenging for a temporary register
47  /// when generating hardware loop instructions.
48  bool requiresRegisterScavenging(const MachineFunction &MF) const override {
49  return true;
50  }
51 
52  /// Returns true. Spill code for predicate registers might need an extra
53  /// register.
54  bool requiresFrameIndexScavenging(const MachineFunction &MF) const override {
55  return true;
56  }
57 
58  /// Returns true if the frame pointer is valid.
59  bool useFPForScavengingIndex(const MachineFunction &MF) const override;
60 
61  bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const override {
62  return true;
63  }
64 
65  // Debug information queries.
66  unsigned getRARegister() const;
67  unsigned getFrameRegister(const MachineFunction &MF) const override;
68  unsigned getFrameRegister() const;
69  unsigned getStackRegister() const;
70 
71  unsigned getHexagonSubRegIndex(const TargetRegisterClass *RC,
72  unsigned GenIdx) const;
73 
75  const TargetRegisterClass *RC) const;
76 
77  unsigned getFirstCallerSavedNonParamReg() const;
78 
79  bool isEHReturnCalleeSaveReg(unsigned Reg) const;
80 };
81 
82 } // end namespace llvm
83 
84 #endif
const MCPhysReg * getCallerSavedRegs(const MachineFunction *MF, const TargetRegisterClass *RC) const
unsigned getHexagonSubRegIndex(const TargetRegisterClass *RC, unsigned GenIdx) const
Reg
All possible values of the reg field in the ModR/M byte.
void eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj, unsigned FIOperandNum, RegScavenger *RS=nullptr) const override
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
unsigned getFirstCallerSavedNonParamReg() const
bool isEHReturnCalleeSaveReg(unsigned Reg) const
bool requiresRegisterScavenging(const MachineFunction &MF) const override
Returns true since we may need scavenging for a temporary register when generating hardware loop inst...
bool useFPForScavengingIndex(const MachineFunction &MF) const override
Returns true if the frame pointer is valid.
bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const override
const uint32_t * getCallPreservedMask(const MachineFunction &MF, CallingConv::ID) const override
BitVector getReservedRegs(const MachineFunction &MF) const override
bool requiresFrameIndexScavenging(const MachineFunction &MF) const override
Returns true.
const MCPhysReg * getCalleeSavedRegs(const MachineFunction *MF) const override
Code Generation virtual methods...