LLVM API Documentation

Thumb1InstrInfo.h

Go to the documentation of this file.
00001 //===- Thumb1InstrInfo.h - Thumb-1 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 Thumb-1 implementation of the TargetInstrInfo class.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef THUMB1INSTRUCTIONINFO_H
00015 #define THUMB1INSTRUCTIONINFO_H
00016 
00017 #include "llvm/Target/TargetInstrInfo.h"
00018 #include "ARM.h"
00019 #include "ARMInstrInfo.h"
00020 #include "Thumb1RegisterInfo.h"
00021 
00022 namespace llvm {
00023   class ARMSubtarget;
00024 
00025 class Thumb1InstrInfo : public ARMBaseInstrInfo {
00026   Thumb1RegisterInfo RI;
00027 public:
00028   explicit Thumb1InstrInfo(const ARMSubtarget &STI);
00029 
00030   // Return the non-pre/post incrementing version of 'Opc'. Return 0
00031   // if there is not such an opcode.
00032   unsigned getUnindexedOpcode(unsigned Opc) const;
00033 
00034   // Return true if the block does not fall through.
00035   bool BlockHasNoFallThrough(const MachineBasicBlock &MBB) const;
00036 
00037   /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info.  As
00038   /// such, whenever a client has an instance of instruction info, it should
00039   /// always be able to get register info as well (through this method).
00040   ///
00041   const Thumb1RegisterInfo &getRegisterInfo() const { return RI; }
00042 
00043   bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
00044                                  MachineBasicBlock::iterator MI,
00045                                  const std::vector<CalleeSavedInfo> &CSI) const;
00046   bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
00047                                    MachineBasicBlock::iterator MI,
00048                                    const std::vector<CalleeSavedInfo> &CSI) const;
00049 
00050   bool copyRegToReg(MachineBasicBlock &MBB,
00051                             MachineBasicBlock::iterator I,
00052                             unsigned DestReg, unsigned SrcReg,
00053                             const TargetRegisterClass *DestRC,
00054                             const TargetRegisterClass *SrcRC) const;
00055   void storeRegToStackSlot(MachineBasicBlock &MBB,
00056                                    MachineBasicBlock::iterator MBBI,
00057                                    unsigned SrcReg, bool isKill, int FrameIndex,
00058                                    const TargetRegisterClass *RC) const;
00059 
00060   void loadRegFromStackSlot(MachineBasicBlock &MBB,
00061                                     MachineBasicBlock::iterator MBBI,
00062                                     unsigned DestReg, int FrameIndex,
00063                                     const TargetRegisterClass *RC) const;
00064 
00065   bool canFoldMemoryOperand(const MachineInstr *MI,
00066                                     const SmallVectorImpl<unsigned> &Ops) const;
00067 
00068   MachineInstr* foldMemoryOperandImpl(MachineFunction &MF,
00069                                       MachineInstr* MI,
00070                                       const SmallVectorImpl<unsigned> &Ops,
00071                                       int FrameIndex) const;
00072 
00073   MachineInstr* foldMemoryOperandImpl(MachineFunction &MF,
00074                                       MachineInstr* MI,
00075                                       const SmallVectorImpl<unsigned> &Ops,
00076                                       MachineInstr* LoadMI) const {
00077     return 0;
00078   }
00079 };
00080 }
00081 
00082 #endif // THUMB1INSTRUCTIONINFO_H