LLVM  8.0.0svn
NVPTXRegisterInfo.h
Go to the documentation of this file.
1 //===- NVPTXRegisterInfo.h - NVPTX 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 NVPTX implementation of the TargetRegisterInfo class.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_NVPTX_NVPTXREGISTERINFO_H
15 #define LLVM_LIB_TARGET_NVPTX_NVPTXREGISTERINFO_H
16 
17 #include "ManagedStringPool.h"
19 #include <sstream>
20 
21 #define GET_REGINFO_HEADER
22 #include "NVPTXGenRegisterInfo.inc"
23 
24 namespace llvm {
26 private:
27  // Hold Strings that can be free'd all together with NVPTXRegisterInfo
28  ManagedStringPool ManagedStrPool;
29 
30 public:
32 
33  //------------------------------------------------------
34  // Pure virtual functions from TargetRegisterInfo
35  //------------------------------------------------------
36 
37  // NVPTX callee saved registers
38  const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF) const override;
39 
40  BitVector getReservedRegs(const MachineFunction &MF) const override;
41 
43  unsigned FIOperandNum,
44  RegScavenger *RS = nullptr) const override;
45 
46  unsigned getFrameRegister(const MachineFunction &MF) const override;
47 
49  return const_cast<ManagedStringPool *>(&ManagedStrPool);
50  }
51 
52  const char *getName(unsigned RegNo) const {
53  std::stringstream O;
54  O << "reg" << RegNo;
55  return getStrPool()->getManagedString(O.str().c_str())->c_str();
56  }
57 
58 };
59 
60 std::string getNVPTXRegClassName(const TargetRegisterClass *RC);
61 std::string getNVPTXRegClassStr(const TargetRegisterClass *RC);
62 
63 } // end namespace llvm
64 
65 #endif
This class represents lattice values for constants.
Definition: AllocatorList.h:24
const MCPhysReg * getCalleeSavedRegs(const MachineFunction *MF) const override
NVPTX Callee Saved Registers.
ManagedStringPool - The strings allocated from a managed string pool are owned by the string pool and...
void eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj, unsigned FIOperandNum, RegScavenger *RS=nullptr) const override
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
BitVector getReservedRegs(const MachineFunction &MF) const override
SmallVectorImpl< T >::const_pointer c_str(SmallVectorImpl< T > &str)
std::string * getManagedString(const char *S)
const char * getName(unsigned RegNo) const
unsigned getFrameRegister(const MachineFunction &MF) const override
std::string getNVPTXRegClassStr(TargetRegisterClass const *RC)
std::string getNVPTXRegClassName(TargetRegisterClass const *RC)
IRTranslator LLVM IR MI
ManagedStringPool * getStrPool() const