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 virtual void eliminateFrameIndex(MachineBasicBlock::iterator MI
,
45 RegScavenger
*RS
= NULL
) const {
46 llvm_unreachable("PTX does not support general function call");
49 virtual void emitPrologue(MachineFunction
&MF
) const {}
50 virtual void emitEpilogue(MachineFunction
&MF
,
51 MachineBasicBlock
&MBB
) const {}
53 virtual unsigned getFrameRegister(const MachineFunction
&MF
) const {
54 llvm_unreachable("PTX does not have a frame register");
58 virtual unsigned getRARegister() const {
59 llvm_unreachable("PTX does not have a return address register");
63 virtual int getDwarfRegNum(unsigned RegNum
, bool isEH
) const {
64 return PTXGenRegisterInfo::getDwarfRegNumFull(RegNum
, 0);
66 }; // struct PTXRegisterInfo
69 #endif // PTX_REGISTER_INFO_H