LLVM API Documentation

AMDGPUMCInstLower.h
Go to the documentation of this file.
00001 //===- AMDGPUMCInstLower.h MachineInstr Lowering Interface ------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 /// \file
00009 //===----------------------------------------------------------------------===//
00010 
00011 #ifndef LLVM_LIB_TARGET_R600_AMDGPUMCINSTLOWER_H
00012 #define LLVM_LIB_TARGET_R600_AMDGPUMCINSTLOWER_H
00013 
00014 namespace llvm {
00015 
00016 class AMDGPUSubtarget;
00017 class MachineInstr;
00018 class MCContext;
00019 class MCInst;
00020 
00021 class AMDGPUMCInstLower {
00022 
00023   // This must be kept in sync with the SISubtarget class in SIInstrInfo.td
00024   enum SISubtarget {
00025     SI = 0
00026   };
00027 
00028   MCContext &Ctx;
00029   const AMDGPUSubtarget &ST;
00030 
00031   /// Convert a member of the AMDGPUSubtarget::Generation enum to the
00032   /// SISubtarget enum.
00033   enum SISubtarget AMDGPUSubtargetToSISubtarget(unsigned Gen) const;
00034 
00035   /// Get the MC opcode for this MachineInstr.
00036   unsigned getMCOpcode(unsigned MIOpcode) const;
00037 
00038 public:
00039   AMDGPUMCInstLower(MCContext &ctx, const AMDGPUSubtarget &ST);
00040 
00041   /// \brief Lower a MachineInstr to an MCInst
00042   void lower(const MachineInstr *MI, MCInst &OutMI) const;
00043 
00044 };
00045 
00046 } // End namespace llvm
00047 
00048 #endif