1 //===- PTXRegisterInfo.h - PTX 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 PTX implementation of the MRegisterInfo class. 11 // 12 //===----------------------------------------------------------------------===// 13 14 #ifndef PTX_REGISTER_INFO_H 15 #define PTX_REGISTER_INFO_H 16 17 #include "llvm/Support/ErrorHandling.h" 18 #include "llvm/ADT/BitVector.h" 19 20 #define GET_REGINFO_HEADER 21 #include "PTXGenRegisterInfo.inc" 22 23 namespace llvm { 24 class PTXTargetMachine; 25 class MachineFunction; 26 27 struct PTXRegisterInfo : public PTXGenRegisterInfo { 28 private: 29 const TargetInstrInfo &TII; 30 31 public: 32 PTXRegisterInfo(PTXTargetMachine &TM, 33 const TargetInstrInfo &tii); 34 35 virtual const unsigned 36 *getCalleeSavedRegs(const MachineFunction *MF = 0) const { 37 static const unsigned CalleeSavedRegs[] = { 0 }; 38 return CalleeSavedRegs; // save nothing 39 } 40 getReservedRegsPTXRegisterInfo41 virtual BitVector getReservedRegs(const MachineFunction &MF) const { 42 BitVector Reserved(getNumRegs()); 43 return Reserved; // reserve no regs 44 } 45 46 virtual void eliminateFrameIndex(MachineBasicBlock::iterator II, 47 int SPAdj, 48 RegScavenger *RS = NULL) const; 49 getFrameRegisterPTXRegisterInfo50 virtual unsigned getFrameRegister(const MachineFunction &MF) const { 51 llvm_unreachable("PTX does not have a frame register"); 52 return 0; 53 } 54 }; // struct PTXRegisterInfo 55 } // namespace llvm 56 57 #endif // PTX_REGISTER_INFO_H 58