LLVM API Documentation
00001 //==- HexagonRegisterInfo.h - Hexagon Register Information Impl --*- C++ -*-==// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This file contains the Hexagon implementation of the TargetRegisterInfo 00011 // class. 00012 // 00013 //===----------------------------------------------------------------------===// 00014 00015 #ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONREGISTERINFO_H 00016 #define LLVM_LIB_TARGET_HEXAGON_HEXAGONREGISTERINFO_H 00017 00018 #include "llvm/MC/MachineLocation.h" 00019 #include "llvm/Target/TargetRegisterInfo.h" 00020 00021 #define GET_REGINFO_HEADER 00022 #include "HexagonGenRegisterInfo.inc" 00023 00024 // 00025 // We try not to hard code the reserved registers in our code, 00026 // so the following two macros were defined. However, there 00027 // are still a few places that R11 and R10 are hard wired. 00028 // See below. If, in the future, we decided to change the reserved 00029 // register. Don't forget changing the following places. 00030 // 00031 // 1. the "Defs" set of STriw_pred in HexagonInstrInfo.td 00032 // 2. the "Defs" set of LDri_pred in HexagonInstrInfo.td 00033 // 3. the definition of "IntRegs" in HexagonRegisterInfo.td 00034 // 4. the definition of "DoubleRegs" in HexagonRegisterInfo.td 00035 // 00036 #define HEXAGON_RESERVED_REG_1 Hexagon::R10 00037 #define HEXAGON_RESERVED_REG_2 Hexagon::R11 00038 00039 namespace llvm { 00040 00041 class HexagonSubtarget; 00042 class HexagonInstrInfo; 00043 class Type; 00044 00045 struct HexagonRegisterInfo : public HexagonGenRegisterInfo { 00046 HexagonSubtarget &Subtarget; 00047 00048 HexagonRegisterInfo(HexagonSubtarget &st); 00049 00050 /// Code Generation virtual methods... 00051 const MCPhysReg * 00052 getCalleeSavedRegs(const MachineFunction *MF = nullptr) const override; 00053 00054 const TargetRegisterClass* const* 00055 getCalleeSavedRegClasses(const MachineFunction *MF = nullptr) const; 00056 00057 BitVector getReservedRegs(const MachineFunction &MF) const override; 00058 00059 void eliminateFrameIndex(MachineBasicBlock::iterator II, 00060 int SPAdj, unsigned FIOperandNum, 00061 RegScavenger *RS = nullptr) const override; 00062 00063 /// determineFrameLayout - Determine the size of the frame and maximum call 00064 /// frame size. 00065 void determineFrameLayout(MachineFunction &MF) const; 00066 00067 /// requiresRegisterScavenging - returns true since we may need scavenging for 00068 /// a temporary register when generating hardware loop instructions. 00069 bool requiresRegisterScavenging(const MachineFunction &MF) const override { 00070 return true; 00071 } 00072 00073 bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const override { 00074 return true; 00075 } 00076 00077 // Debug information queries. 00078 unsigned getRARegister() const; 00079 unsigned getFrameRegister(const MachineFunction &MF) const override; 00080 unsigned getFrameRegister() const; 00081 unsigned getStackRegister() const; 00082 }; 00083 00084 } // end namespace llvm 00085 00086 #endif