1 //===- ZPUInstrInfo.cpp - ZPU 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 ZPU implementation of the TargetInstrInfo class.
12 //===----------------------------------------------------------------------===//
14 #include "ZPUInstrInfo.h"
15 #include "ZPUTargetMachine.h"
16 #include "llvm/ADT/STLExtras.h"
17 #include "llvm/CodeGen/MachineInstrBuilder.h"
18 #include "llvm/CodeGen/MachineRegisterInfo.h"
19 #include "llvm/Support/ErrorHandling.h"
20 #include "ZPUGenInstrInfo.inc"
24 ZPUInstrInfo::ZPUInstrInfo(ZPUTargetMachine
&tm
)
25 : TargetInstrInfoImpl(ZPUInsts
, array_lengthof(ZPUInsts
)),
29 /// isLoadFromStackSlot - If the specified machine instruction is a direct
30 /// load from a stack slot, return the virtual or physical register number of
31 /// the destination along with the FrameIndex of the loaded stack slot. If
32 /// not, return 0. This predicate must return 0 if the instruction has
33 /// any side effects other than loading from the stack slot.
34 unsigned ZPUInstrInfo::
35 isLoadFromStackSlot(const MachineInstr
*MI
, int &FrameIndex
) const
42 /// isStoreToStackSlot - If the specified machine instruction is a direct
43 /// store to a stack slot, return the virtual or physical register number of
44 /// the source reg along with the FrameIndex of the loaded stack slot. If
45 /// not, return 0. This predicate must return 0 if the instruction has
46 /// any side effects other than storing to the stack slot.
47 unsigned ZPUInstrInfo::
48 isStoreToStackSlot(const MachineInstr
*MI
, int &FrameIndex
) const
53 /// insertNoop - If data hazard condition is found insert the target nop
56 insertNoop(MachineBasicBlock
&MBB
, MachineBasicBlock::iterator MI
) const
61 copyPhysReg(MachineBasicBlock
&MBB
,
62 MachineBasicBlock::iterator I
, DebugLoc DL
,
63 unsigned DestReg
, unsigned SrcReg
,
68 storeRegToStackSlot(MachineBasicBlock
&MBB
, MachineBasicBlock::iterator I
,
69 unsigned SrcReg
, bool isKill
, int FI
,
70 const TargetRegisterClass
*RC
,
71 const TargetRegisterInfo
*TRI
) const {
75 loadRegFromStackSlot(MachineBasicBlock
&MBB
, MachineBasicBlock::iterator I
,
76 unsigned DestReg
, int FI
,
77 const TargetRegisterClass
*RC
,
78 const TargetRegisterInfo
*TRI
) const