1 //==- HexagonRegisterInfo.h - Hexagon Register Information Impl --*- C++ -*-==//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the Hexagon implementation of the TargetRegisterInfo
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONREGISTERINFO_H
16 #define LLVM_LIB_TARGET_HEXAGON_HEXAGONREGISTERINFO_H
18 #include "llvm/MC/MachineLocation.h"
19 #include "llvm/Target/TargetRegisterInfo.h"
21 #define GET_REGINFO_HEADER
22 #include "HexagonGenRegisterInfo.inc"
27 // Generic (pseudo) subreg indices for use with getHexagonSubRegIndex.
28 enum { ps_sub_lo = 0, ps_sub_hi = 1 };
31 class HexagonRegisterInfo : public HexagonGenRegisterInfo {
33 HexagonRegisterInfo();
35 /// Code Generation virtual methods...
36 const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF)
38 const uint32_t *getCallPreservedMask(const MachineFunction &MF,
39 CallingConv::ID) const override;
41 BitVector getReservedRegs(const MachineFunction &MF) const override;
43 void eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj,
44 unsigned FIOperandNum, RegScavenger *RS = nullptr) const override;
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 {
52 /// Returns true. Spill code for predicate registers might need an extra
54 bool requiresFrameIndexScavenging(const MachineFunction &MF) const override {
58 /// Returns true if the frame pointer is valid.
59 bool useFPForScavengingIndex(const MachineFunction &MF) const override;
61 bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const override {
65 // Debug information queries.
66 unsigned getRARegister() const;
67 unsigned getFrameRegister(const MachineFunction &MF) const override;
68 unsigned getFrameRegister() const;
69 unsigned getStackRegister() const;
71 unsigned getHexagonSubRegIndex(const TargetRegisterClass *RC,
72 unsigned GenIdx) const;
74 const MCPhysReg *getCallerSavedRegs(const MachineFunction *MF,
75 const TargetRegisterClass *RC) const;
77 unsigned getFirstCallerSavedNonParamReg() const;
79 bool isEHReturnCalleeSaveReg(unsigned Reg) const;
82 } // end namespace llvm