1 //===- PTXRegisterInfo.h - PTX 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 PTX implementation of the MRegisterInfo class.
12 //===----------------------------------------------------------------------===//
14 #ifndef PTX_REGISTER_INFO_H
15 #define PTX_REGISTER_INFO_H
17 #include "llvm/Support/ErrorHandling.h"
18 #include "llvm/ADT/BitVector.h"
20 #include "PTXGenRegisterInfo.h.inc"
23 class PTXTargetMachine;
24 class MachineFunction;
26 struct PTXRegisterInfo : public PTXGenRegisterInfo {
27 PTXRegisterInfo(PTXTargetMachine &TM,
28 const TargetInstrInfo &TII) {}
30 virtual const unsigned
31 *getCalleeSavedRegs(const MachineFunction *MF = 0) const {
32 static const unsigned CalleeSavedRegs[] = { 0 };
33 return CalleeSavedRegs; // save nothing
36 virtual BitVector getReservedRegs(const MachineFunction &MF) const {
37 BitVector Reserved(getNumRegs());
38 return Reserved; // reserve no regs
41 virtual bool hasFP(const MachineFunction &MF) const { return false; }
43 // FIXME: Given that PTX does not support stack frame, what should we do here?
44 virtual void eliminateFrameIndex(MachineBasicBlock::iterator MI,
46 RegScavenger *RS = NULL) const {}
48 virtual void emitPrologue(MachineFunction &MF) const {}
49 virtual void emitEpilogue(MachineFunction &MF,
50 MachineBasicBlock &MBB) const {}
52 virtual unsigned getFrameRegister(const MachineFunction &MF) const {
53 llvm_unreachable("PTX does not have a frame register");
57 virtual unsigned getRARegister() const {
58 llvm_unreachable("PTX does not have a return address register");
62 virtual int getDwarfRegNum(unsigned RegNum, bool isEH) const {
63 return PTXGenRegisterInfo::getDwarfRegNumFull(RegNum, 0);
65 }; // struct PTXRegisterInfo
68 #endif // PTX_REGISTER_INFO_H