1 //===-- AMDGPURegisterInfo.h - AMDGPURegisterInfo Interface -*- C++ -*-----===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// \brief TargetRegisterInfo interface that is implemented by all hw codegen
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_LIB_TARGET_R600_AMDGPUREGISTERINFO_H
17 #define LLVM_LIB_TARGET_R600_AMDGPUREGISTERINFO_H
19 #include "llvm/ADT/BitVector.h"
20 #include "llvm/Target/TargetRegisterInfo.h"
22 #define GET_REGINFO_HEADER
23 #define GET_REGINFO_ENUM
24 #include "AMDGPUGenRegisterInfo.inc"
28 class AMDGPUSubtarget;
29 class TargetInstrInfo;
31 struct AMDGPURegisterInfo : public AMDGPUGenRegisterInfo {
32 static const MCPhysReg CalleeSavedReg;
36 BitVector getReservedRegs(const MachineFunction &MF) const override {
37 assert(!"Unimplemented"); return BitVector();
40 virtual unsigned getHWRegIndex(unsigned Reg) const {
41 assert(!"Unimplemented"); return 0;
44 /// \returns the sub reg enum value for the given \p Channel
45 /// (e.g. getSubRegFromChannel(0) -> AMDGPU::sub0)
46 unsigned getSubRegFromChannel(unsigned Channel) const;
48 const MCPhysReg* getCalleeSavedRegs(const MachineFunction *MF) const override;
49 void eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj,
50 unsigned FIOperandNum,
51 RegScavenger *RS) const override;
52 unsigned getFrameRegister(const MachineFunction &MF) const override;
54 unsigned getIndirectSubReg(unsigned IndirectIndex) const;
58 } // End namespace llvm