1 //===- NVPTXRegisterInfo.h - NVPTX 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 NVPTX implementation of the TargetRegisterInfo class.
12 //===----------------------------------------------------------------------===//
14 #ifndef NVPTXREGISTERINFO_H
15 #define NVPTXREGISTERINFO_H
17 #include "ManagedStringPool.h"
18 #include "llvm/Target/TargetRegisterInfo.h"
20 #define GET_REGINFO_HEADER
21 #include "NVPTXGenRegisterInfo.inc"
22 #include "llvm/Target/TargetRegisterInfo.h"
27 // Forward Declarations.
28 class TargetInstrInfo;
31 class NVPTXRegisterInfo : public NVPTXGenRegisterInfo {
34 // Hold Strings that can be free'd all together with NVPTXRegisterInfo
35 ManagedStringPool ManagedStrPool;
38 NVPTXRegisterInfo(const TargetInstrInfo &tii, const NVPTXSubtarget &st);
40 //------------------------------------------------------
41 // Pure virtual functions from TargetRegisterInfo
42 //------------------------------------------------------
44 // NVPTX callee saved registers
45 virtual const uint16_t *
46 getCalleeSavedRegs(const MachineFunction *MF = 0) const;
48 // NVPTX callee saved register classes
49 virtual const TargetRegisterClass *const *
50 getCalleeSavedRegClasses(const MachineFunction *MF) const;
52 virtual BitVector getReservedRegs(const MachineFunction &MF) const;
54 virtual void eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj,
55 unsigned FIOperandNum,
56 RegScavenger *RS = NULL) const;
58 virtual int getDwarfRegNum(unsigned RegNum, bool isEH) const;
59 virtual unsigned getFrameRegister(const MachineFunction &MF) const;
60 virtual unsigned getRARegister() const;
62 ManagedStringPool *getStrPool() const {
63 return const_cast<ManagedStringPool *>(&ManagedStrPool);
66 const char *getName(unsigned RegNo) const {
69 return getStrPool()->getManagedString(O.str().c_str())->c_str();
74 std::string getNVPTXRegClassName(const TargetRegisterClass *RC);
75 std::string getNVPTXRegClassStr(const TargetRegisterClass *RC);
77 } // end namespace llvm