• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_AMDGPU_AMDGPUREGISTERINFO_H
17 #define LLVM_LIB_TARGET_AMDGPU_AMDGPUREGISTERINFO_H
18 
19 #include "llvm/Target/TargetRegisterInfo.h"
20 
21 #define GET_REGINFO_HEADER
22 #define GET_REGINFO_ENUM
23 #include "AMDGPUGenRegisterInfo.inc"
24 
25 namespace llvm {
26 
27 class AMDGPUSubtarget;
28 class TargetInstrInfo;
29 
30 struct AMDGPURegisterInfo : public AMDGPUGenRegisterInfo {
31   AMDGPURegisterInfo();
32 
33   /// \returns the sub reg enum value for the given \p Channel
34   /// (e.g. getSubRegFromChannel(0) -> AMDGPU::sub0)
35   unsigned getSubRegFromChannel(unsigned Channel) const;
36 
37   const MCPhysReg* getCalleeSavedRegs(const MachineFunction *MF) const override;
38   unsigned getFrameRegister(const MachineFunction &MF) const override;
39 };
40 
41 } // End namespace llvm
42 
43 #endif
44