1 //===- BlackfinInstrInfo.h - Blackfin Instruction Information ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the Blackfin implementation of the TargetInstrInfo class.
12 //===----------------------------------------------------------------------===//
14 #ifndef BLACKFININSTRUCTIONINFO_H
15 #define BLACKFININSTRUCTIONINFO_H
17 #include "llvm/Target/TargetInstrInfo.h"
18 #include "BlackfinRegisterInfo.h"
22 class BlackfinInstrInfo
: public TargetInstrInfoImpl
{
23 const BlackfinRegisterInfo RI
;
24 const BlackfinSubtarget
& Subtarget
;
26 explicit BlackfinInstrInfo(BlackfinSubtarget
&ST
);
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).
31 virtual const BlackfinRegisterInfo
&getRegisterInfo() const { return RI
; }
33 virtual bool isMoveInstr(const MachineInstr
&MI
,
34 unsigned &SrcReg
, unsigned &DstReg
,
35 unsigned &SrcSubIdx
, unsigned &DstSubIdx
) const;
37 virtual unsigned isLoadFromStackSlot(const MachineInstr
*MI
,
38 int &FrameIndex
) const;
40 virtual unsigned isStoreToStackSlot(const MachineInstr
*MI
,
41 int &FrameIndex
) const;
44 InsertBranch(MachineBasicBlock
&MBB
,
45 MachineBasicBlock
*TBB
,
46 MachineBasicBlock
*FBB
,
47 const SmallVectorImpl
<MachineOperand
> &Cond
) const;
49 virtual bool copyRegToReg(MachineBasicBlock
&MBB
,
50 MachineBasicBlock::iterator I
,
51 unsigned DestReg
, unsigned SrcReg
,
52 const TargetRegisterClass
*DestRC
,
53 const TargetRegisterClass
*SrcRC
) const;
55 virtual void storeRegToStackSlot(MachineBasicBlock
&MBB
,
56 MachineBasicBlock::iterator MBBI
,
57 unsigned SrcReg
, bool isKill
,
59 const TargetRegisterClass
*RC
) const;
61 virtual void storeRegToAddr(MachineFunction
&MF
,
62 unsigned SrcReg
, bool isKill
,
63 SmallVectorImpl
<MachineOperand
> &Addr
,
64 const TargetRegisterClass
*RC
,
65 SmallVectorImpl
<MachineInstr
*> &NewMIs
) const;
67 virtual void loadRegFromStackSlot(MachineBasicBlock
&MBB
,
68 MachineBasicBlock::iterator MBBI
,
69 unsigned DestReg
, int FrameIndex
,
70 const TargetRegisterClass
*RC
) const;
72 virtual void loadRegFromAddr(MachineFunction
&MF
, unsigned DestReg
,
73 SmallVectorImpl
<MachineOperand
> &Addr
,
74 const TargetRegisterClass
*RC
,
75 SmallVectorImpl
<MachineInstr
*> &NewMIs
) const;
78 } // end namespace llvm