LLVM API Documentation

BlackfinInstrInfo.h

Go to the documentation of this file.
00001 //===- BlackfinInstrInfo.h - Blackfin Instruction Information ---*- 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 //===----------------------------------------------------------------------===//
00009 //
00010 // This file contains the Blackfin implementation of the TargetInstrInfo class.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef BLACKFININSTRUCTIONINFO_H
00015 #define BLACKFININSTRUCTIONINFO_H
00016 
00017 #include "llvm/Target/TargetInstrInfo.h"
00018 #include "BlackfinRegisterInfo.h"
00019 
00020 namespace llvm {
00021 
00022   class BlackfinInstrInfo : public TargetInstrInfoImpl {
00023     const BlackfinRegisterInfo RI;
00024     const BlackfinSubtarget& Subtarget;
00025   public:
00026     explicit BlackfinInstrInfo(BlackfinSubtarget &ST);
00027 
00028     /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info.  As
00029     /// such, whenever a client has an instance of instruction info, it should
00030     /// always be able to get register info as well (through this method).
00031     virtual const BlackfinRegisterInfo &getRegisterInfo() const { return RI; }
00032 
00033     virtual bool isMoveInstr(const MachineInstr &MI,
00034                              unsigned &SrcReg, unsigned &DstReg,
00035                              unsigned &SrcSubIdx, unsigned &DstSubIdx) const;
00036 
00037     virtual unsigned isLoadFromStackSlot(const MachineInstr *MI,
00038                                          int &FrameIndex) const;
00039 
00040     virtual unsigned isStoreToStackSlot(const MachineInstr *MI,
00041                                         int &FrameIndex) const;
00042 
00043     virtual unsigned
00044     InsertBranch(MachineBasicBlock &MBB,
00045                  MachineBasicBlock *TBB,
00046                  MachineBasicBlock *FBB,
00047                  const SmallVectorImpl<MachineOperand> &Cond) const;
00048 
00049     virtual bool copyRegToReg(MachineBasicBlock &MBB,
00050                               MachineBasicBlock::iterator I,
00051                               unsigned DestReg, unsigned SrcReg,
00052                               const TargetRegisterClass *DestRC,
00053                               const TargetRegisterClass *SrcRC) const;
00054 
00055     virtual void storeRegToStackSlot(MachineBasicBlock &MBB,
00056                                      MachineBasicBlock::iterator MBBI,
00057                                      unsigned SrcReg, bool isKill,
00058                                      int FrameIndex,
00059                                      const TargetRegisterClass *RC) const;
00060 
00061     virtual void storeRegToAddr(MachineFunction &MF,
00062                                 unsigned SrcReg, bool isKill,
00063                                 SmallVectorImpl<MachineOperand> &Addr,
00064                                 const TargetRegisterClass *RC,
00065                                 SmallVectorImpl<MachineInstr*> &NewMIs) const;
00066 
00067     virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
00068                                       MachineBasicBlock::iterator MBBI,
00069                                       unsigned DestReg, int FrameIndex,
00070                                       const TargetRegisterClass *RC) const;
00071 
00072     virtual void loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
00073                                  SmallVectorImpl<MachineOperand> &Addr,
00074                                  const TargetRegisterClass *RC,
00075                                  SmallVectorImpl<MachineInstr*> &NewMIs) const;
00076   };
00077 
00078 } // end namespace llvm
00079 
00080 #endif