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 18 #include "llvm/MC/MachineLocation.h" 19 #include "llvm/Target/TargetRegisterInfo.h" 20 21 #define GET_REGINFO_HEADER 22 #include "HexagonGenRegisterInfo.inc" 23 24 namespace llvm { 25 class HexagonRegisterInfo : public HexagonGenRegisterInfo { 26 public: 27 HexagonRegisterInfo(); 28 29 /// Code Generation virtual methods... 30 const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF) 31 const override; 32 33 34 BitVector getReservedRegs(const MachineFunction &MF) const override; 35 36 void eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj, 37 unsigned FIOperandNum, RegScavenger *RS = nullptr) const override; 38 39 /// Returns true since we may need scavenging for a temporary register 40 /// when generating hardware loop instructions. requiresRegisterScavenging(const MachineFunction & MF)41 bool requiresRegisterScavenging(const MachineFunction &MF) const override { 42 return true; 43 } 44 45 /// Returns true. Spill code for predicate registers might need an extra 46 /// register. requiresFrameIndexScavenging(const MachineFunction & MF)47 bool requiresFrameIndexScavenging(const MachineFunction &MF) const override { 48 return true; 49 } 50 51 /// Returns true if the frame pointer is valid. 52 bool useFPForScavengingIndex(const MachineFunction &MF) const override; 53 trackLivenessAfterRegAlloc(const MachineFunction & MF)54 bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const override { 55 return true; 56 } 57 58 // Debug information queries. 59 unsigned getRARegister() const; 60 unsigned getFrameRegister(const MachineFunction &MF) const override; 61 unsigned getFrameRegister() const; 62 unsigned getStackRegister() const; 63 64 const MCPhysReg *getCallerSavedRegs(const MachineFunction *MF, 65 const TargetRegisterClass *RC) const; 66 67 unsigned getFirstCallerSavedNonParamReg() const; 68 69 bool isEHReturnCalleeSaveReg(unsigned Reg) const; 70 bool isCalleeSaveReg(unsigned Reg) const; 71 }; 72 73 } // end namespace llvm 74 75 #endif 76