Home | History | Annotate | Download | only in R600
      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 AMDGPUREGISTERINFO_H
     17 #define 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 AMDGPUTargetMachine;
     29 class TargetInstrInfo;
     30 
     31 struct AMDGPURegisterInfo : public AMDGPUGenRegisterInfo {
     32   TargetMachine &TM;
     33   static const uint16_t CalleeSavedReg;
     34 
     35   AMDGPURegisterInfo(TargetMachine &tm);
     36 
     37   virtual BitVector getReservedRegs(const MachineFunction &MF) const {
     38     assert(!"Unimplemented");  return BitVector();
     39   }
     40 
     41   /// \param RC is an AMDIL reg class.
     42   ///
     43   /// \returns The ISA reg class that is equivalent to \p RC.
     44   virtual const TargetRegisterClass * getISARegClass(
     45                                          const TargetRegisterClass * RC) const {
     46     assert(!"Unimplemented"); return NULL;
     47   }
     48 
     49   virtual const TargetRegisterClass* getCFGStructurizerRegClass(MVT VT) const {
     50     assert(!"Unimplemented"); return NULL;
     51   }
     52 
     53   const uint16_t* getCalleeSavedRegs(const MachineFunction *MF) const;
     54   void eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj,
     55                            unsigned FIOperandNum,
     56                            RegScavenger *RS) const;
     57   unsigned getFrameRegister(const MachineFunction &MF) const;
     58 
     59   unsigned getIndirectSubReg(unsigned IndirectIndex) const;
     60 
     61 };
     62 
     63 } // End namespace llvm
     64 
     65 #endif // AMDIDSAREGISTERINFO_H
     66