1 //===-- AMDGPURegisterInfo.h - AMDGPURegisterInfo Interface -*- 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 /// \file
11 /// \brief TargetRegisterInfo interface that is implemented by all hw codegen
12 /// targets.
13 //
14 //===----------------------------------------------------------------------===//
15 
16 #ifndef LLVM_LIB_TARGET_R600_AMDGPUREGISTERINFO_H
17 #define LLVM_LIB_TARGET_R600_AMDGPUREGISTERINFO_H
18 
19 #include "llvm/ADT/BitVector.h"
20 #include "llvm/Target/TargetRegisterInfo.h"
21 
22 #define GET_REGINFO_HEADER
23 #define GET_REGINFO_ENUM
24 #include "AMDGPUGenRegisterInfo.inc"
25 
26 namespace llvm {
27 
28 class AMDGPUSubtarget;
29 class TargetInstrInfo;
30 
31 struct AMDGPURegisterInfo : public AMDGPUGenRegisterInfo {
32   static const MCPhysReg CalleeSavedReg;
33 
34   AMDGPURegisterInfo();
35 
getReservedRegsAMDGPURegisterInfo36   BitVector getReservedRegs(const MachineFunction &MF) const override {
37     assert(!"Unimplemented");  return BitVector();
38   }
39 
getCFGStructurizerRegClassAMDGPURegisterInfo40   virtual const TargetRegisterClass* getCFGStructurizerRegClass(MVT VT) const {
41     assert(!"Unimplemented"); return nullptr;
42   }
43 
getHWRegIndexAMDGPURegisterInfo44   virtual unsigned getHWRegIndex(unsigned Reg) const {
45     assert(!"Unimplemented"); return 0;
46   }
47 
48   /// \returns the sub reg enum value for the given \p Channel
49   /// (e.g. getSubRegFromChannel(0) -> AMDGPU::sub0)
50   unsigned getSubRegFromChannel(unsigned Channel) const;
51 
52   const MCPhysReg* getCalleeSavedRegs(const MachineFunction *MF) const override;
53   void eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj,
54                            unsigned FIOperandNum,
55                            RegScavenger *RS) const override;
56   unsigned getFrameRegister(const MachineFunction &MF) const override;
57 
58   unsigned getIndirectSubReg(unsigned IndirectIndex) const;
59 
60 };
61 
62 } // End namespace llvm
63 
64 #endif
65