LLVM API Documentation
00001 //===-- Thumb2InstrInfo.h - Thumb-2 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-2 implementation of the TargetInstrInfo class. 00011 // 00012 //===----------------------------------------------------------------------===// 00013 00014 #ifndef LLVM_LIB_TARGET_ARM_THUMB2INSTRINFO_H 00015 #define LLVM_LIB_TARGET_ARM_THUMB2INSTRINFO_H 00016 00017 #include "ARMBaseInstrInfo.h" 00018 #include "Thumb2RegisterInfo.h" 00019 00020 namespace llvm { 00021 class ARMSubtarget; 00022 class ScheduleHazardRecognizer; 00023 00024 class Thumb2InstrInfo : public ARMBaseInstrInfo { 00025 Thumb2RegisterInfo RI; 00026 public: 00027 explicit Thumb2InstrInfo(const ARMSubtarget &STI); 00028 00029 /// getNoopForMachoTarget - Return the noop instruction to use for a noop. 00030 void getNoopForMachoTarget(MCInst &NopInst) const override; 00031 00032 // Return the non-pre/post incrementing version of 'Opc'. Return 0 00033 // if there is not such an opcode. 00034 unsigned getUnindexedOpcode(unsigned Opc) const override; 00035 00036 void ReplaceTailWithBranchTo(MachineBasicBlock::iterator Tail, 00037 MachineBasicBlock *NewDest) const override; 00038 00039 bool isLegalToSplitMBBAt(MachineBasicBlock &MBB, 00040 MachineBasicBlock::iterator MBBI) const override; 00041 00042 void copyPhysReg(MachineBasicBlock &MBB, 00043 MachineBasicBlock::iterator I, DebugLoc DL, 00044 unsigned DestReg, unsigned SrcReg, 00045 bool KillSrc) const override; 00046 00047 void storeRegToStackSlot(MachineBasicBlock &MBB, 00048 MachineBasicBlock::iterator MBBI, 00049 unsigned SrcReg, bool isKill, int FrameIndex, 00050 const TargetRegisterClass *RC, 00051 const TargetRegisterInfo *TRI) const override; 00052 00053 void loadRegFromStackSlot(MachineBasicBlock &MBB, 00054 MachineBasicBlock::iterator MBBI, 00055 unsigned DestReg, int FrameIndex, 00056 const TargetRegisterClass *RC, 00057 const TargetRegisterInfo *TRI) const override; 00058 00059 /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As 00060 /// such, whenever a client has an instance of instruction info, it should 00061 /// always be able to get register info as well (through this method). 00062 /// 00063 const Thumb2RegisterInfo &getRegisterInfo() const override { return RI; } 00064 00065 private: 00066 void expandLoadStackGuard(MachineBasicBlock::iterator MI, 00067 Reloc::Model RM) const override; 00068 }; 00069 00070 /// getITInstrPredicate - Valid only in Thumb2 mode. This function is identical 00071 /// to llvm::getInstrPredicate except it returns AL for conditional branch 00072 /// instructions which are "predicated", but are not in IT blocks. 00073 ARMCC::CondCodes getITInstrPredicate(const MachineInstr *MI, unsigned &PredReg); 00074 00075 00076 } 00077 00078 #endif