[InstCombine] Signed saturation patterns
[llvm-complete.git] / lib / Target / NVPTX / NVPTXRegisterInfo.h
blob9ef6940daf864fc642942d68dd1f527c68f2dd1b
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.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_LIB_TARGET_NVPTX_NVPTXREGISTERINFO_H
14 #define LLVM_LIB_TARGET_NVPTX_NVPTXREGISTERINFO_H
16 #include "ManagedStringPool.h"
17 #include "llvm/CodeGen/TargetRegisterInfo.h"
18 #include <sstream>
20 #define GET_REGINFO_HEADER
21 #include "NVPTXGenRegisterInfo.inc"
23 namespace llvm {
24 class NVPTXRegisterInfo : public NVPTXGenRegisterInfo {
25 private:
26 // Hold Strings that can be free'd all together with NVPTXRegisterInfo
27 ManagedStringPool ManagedStrPool;
29 public:
30 NVPTXRegisterInfo();
32 //------------------------------------------------------
33 // Pure virtual functions from TargetRegisterInfo
34 //------------------------------------------------------
36 // NVPTX callee saved registers
37 const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF) const override;
39 BitVector getReservedRegs(const MachineFunction &MF) const override;
41 void eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj,
42 unsigned FIOperandNum,
43 RegScavenger *RS = nullptr) const override;
45 Register getFrameRegister(const MachineFunction &MF) const override;
47 ManagedStringPool *getStrPool() const {
48 return const_cast<ManagedStringPool *>(&ManagedStrPool);
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();
59 std::string getNVPTXRegClassName(const TargetRegisterClass *RC);
60 std::string getNVPTXRegClassStr(const TargetRegisterClass *RC);
62 } // end namespace llvm
64 #endif