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 LLVM_LIB_TARGET_NVPTX_NVPTXREGISTERINFO_H
15 #define LLVM_LIB_TARGET_NVPTX_NVPTXREGISTERINFO_H
17 #include "ManagedStringPool.h"
18 #include "llvm/Target/TargetRegisterInfo.h"
21 #define GET_REGINFO_HEADER
22 #include "NVPTXGenRegisterInfo.inc"
26 // Forward Declarations.
27 class TargetInstrInfo;
30 class NVPTXRegisterInfo : public NVPTXGenRegisterInfo {
33 // Hold Strings that can be free'd all together with NVPTXRegisterInfo
34 ManagedStringPool ManagedStrPool;
37 NVPTXRegisterInfo(const NVPTXSubtarget &st);
39 //------------------------------------------------------
40 // Pure virtual functions from TargetRegisterInfo
41 //------------------------------------------------------
43 // NVPTX callee saved registers
45 getCalleeSavedRegs(const MachineFunction *MF = nullptr) const override;
47 BitVector getReservedRegs(const MachineFunction &MF) const override;
49 void eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj,
50 unsigned FIOperandNum,
51 RegScavenger *RS = nullptr) const override;
53 unsigned getFrameRegister(const MachineFunction &MF) const override;
55 ManagedStringPool *getStrPool() const {
56 return const_cast<ManagedStringPool *>(&ManagedStrPool);
59 const char *getName(unsigned RegNo) const {
62 return getStrPool()->getManagedString(O.str().c_str())->c_str();
67 std::string getNVPTXRegClassName(const TargetRegisterClass *RC);
68 std::string getNVPTXRegClassStr(const TargetRegisterClass *RC);
70 } // end namespace llvm