LLVM  14.0.0git
NVPTXRegisterInfo.h
Go to the documentation of this file.
1 //===- NVPTXRegisterInfo.h - NVPTX Register Information Impl ----*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the NVPTX implementation of the TargetRegisterInfo class.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_LIB_TARGET_NVPTX_NVPTXREGISTERINFO_H
14 #define LLVM_LIB_TARGET_NVPTX_NVPTXREGISTERINFO_H
15 
16 #include "ManagedStringPool.h"
18 #include <sstream>
19 
20 #define GET_REGINFO_HEADER
21 #include "NVPTXGenRegisterInfo.inc"
22 
23 namespace llvm {
25 private:
26  // Hold Strings that can be free'd all together with NVPTXRegisterInfo
27  ManagedStringPool ManagedStrPool;
28 
29 public:
31 
32  //------------------------------------------------------
33  // Pure virtual functions from TargetRegisterInfo
34  //------------------------------------------------------
35 
36  // NVPTX callee saved registers
37  const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF) const override;
38 
39  BitVector getReservedRegs(const MachineFunction &MF) const override;
40 
42  unsigned FIOperandNum,
43  RegScavenger *RS = nullptr) const override;
44 
45  Register getFrameRegister(const MachineFunction &MF) const override;
46 
48  return const_cast<ManagedStringPool *>(&ManagedStrPool);
49  }
50 
51  const char *getName(unsigned RegNo) const {
52  std::stringstream O;
53  O << "reg" << RegNo;
54  return getStrPool()->getManagedString(O.str().c_str())->c_str();
55  }
56 
57 };
58 
59 std::string getNVPTXRegClassName(const TargetRegisterClass *RC);
60 std::string getNVPTXRegClassStr(const TargetRegisterClass *RC);
61 
62 } // end namespace llvm
63 
64 #endif
llvm::NVPTXRegisterInfo::eliminateFrameIndex
void eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj, unsigned FIOperandNum, RegScavenger *RS=nullptr) const override
Definition: NVPTXRegisterInfo.cpp:112
MI
IRTranslator LLVM IR MI
Definition: IRTranslator.cpp:103
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::NVPTXRegisterInfo::getFrameRegister
Register getFrameRegister(const MachineFunction &MF) const override
Definition: NVPTXRegisterInfo.cpp:129
ManagedStringPool.h
llvm::NVPTXRegisterInfo::NVPTXRegisterInfo
NVPTXRegisterInfo()
Definition: NVPTXRegisterInfo.cpp:95
llvm::BitVector
Definition: BitVector.h:74
llvm::getNVPTXRegClassStr
std::string getNVPTXRegClassStr(TargetRegisterClass const *RC)
Definition: NVPTXRegisterInfo.cpp:72
llvm::ManagedStringPool::getManagedString
std::string * getManagedString(const char *S)
Definition: ManagedStringPool.h:39
llvm::NVPTXRegisterInfo::getName
const char * getName(unsigned RegNo) const
Definition: NVPTXRegisterInfo.h:51
llvm::RISCVFenceField::O
@ O
Definition: RISCVBaseInfo.h:192
llvm::RegScavenger
Definition: RegisterScavenging.h:34
llvm::MachineFunction
Definition: MachineFunction.h:230
llvm::ManagedStringPool
ManagedStringPool - The strings allocated from a managed string pool are owned by the string pool and...
Definition: ManagedStringPool.h:25
llvm::NVPTXRegisterInfo::getReservedRegs
BitVector getReservedRegs(const MachineFunction &MF) const override
Definition: NVPTXRegisterInfo.cpp:107
llvm::Register
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
llvm::NVPTXRegisterInfo::getStrPool
ManagedStringPool * getStrPool() const
Definition: NVPTXRegisterInfo.h:47
llvm::NVPTXRegisterInfo::getCalleeSavedRegs
const MCPhysReg * getCalleeSavedRegs(const MachineFunction *MF) const override
NVPTX Callee Saved Registers.
Definition: NVPTXRegisterInfo.cpp:102
uint16_t
llvm::NVPTXRegisterInfo
Definition: NVPTXRegisterInfo.h:24
llvm::MachineInstrBundleIterator< MachineInstr >
llvm::getNVPTXRegClassName
std::string getNVPTXRegClassName(TargetRegisterClass const *RC)
Definition: NVPTXRegisterInfo.cpp:28
TargetRegisterInfo.h
NVPTXGenRegisterInfo