1 //===- ARMInstrInfo.h - ARM Instruction Information --------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by the "Instituto Nokia de Tecnologia" and
6 // is distributed under the University of Illinois Open Source
7 // License. See LICENSE.TXT for details.
9 //===----------------------------------------------------------------------===//
11 // This file contains the ARM implementation of the TargetInstrInfo class.
13 //===----------------------------------------------------------------------===//
15 #ifndef ARMINSTRUCTIONINFO_H
16 #define ARMINSTRUCTIONINFO_H
18 #include "llvm/Target/TargetInstrInfo.h"
19 #include "ARMRegisterInfo.h"
23 class ARMInstrInfo : public TargetInstrInfo {
24 const ARMRegisterInfo RI;
28 /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As
29 /// such, whenever a client has an instance of instruction info, it should
30 /// always be able to get register info as well (through this method).
32 virtual const MRegisterInfo &getRegisterInfo() const { return RI; }
34 /// Return true if the instruction is a register to register move and
35 /// leave the source and dest operands in the passed parameters.
37 virtual bool isMoveInstr(const MachineInstr &MI,
38 unsigned &SrcReg, unsigned &DstReg) const;
40 /// isLoadFromStackSlot - If the specified machine instruction is a direct
41 /// load from a stack slot, return the virtual or physical register number of
42 /// the destination along with the FrameIndex of the loaded stack slot. If
43 /// not, return 0. This predicate must return 0 if the instruction has
44 /// any side effects other than loading from the stack slot.
45 virtual unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const;
47 /// isStoreToStackSlot - If the specified machine instruction is a direct
48 /// store to a stack slot, return the virtual or physical register number of
49 /// the source reg along with the FrameIndex of the loaded stack slot. If
50 /// not, return 0. This predicate must return 0 if the instruction has
51 /// any side effects other than storing to the stack slot.
52 virtual unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const;