annotate lib/Target/ARC/ARCInstrInfo.h @ 128:c347d3398279 default tip

fix
author mir3636
date Wed, 06 Dec 2017 14:37:17 +0900
parents 803732b1fca8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1 //===- ARCInstrInfo.h - ARC Instruction Information -------------*- C++ -*-===//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
2 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
3 // The LLVM Compiler Infrastructure
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
4 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
5 // This file is distributed under the University of Illinois Open Source
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
6 // License. See LICENSE.TXT for details.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
7 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
8 //===----------------------------------------------------------------------===//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
9 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
10 // This file contains the ARC implementation of the TargetInstrInfo class.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
11 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
12 //===----------------------------------------------------------------------===//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
13
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
14 #ifndef LLVM_LIB_TARGET_ARC_ARCINSTRINFO_H
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
15 #define LLVM_LIB_TARGET_ARC_ARCINSTRINFO_H
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
16
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
17 #include "ARCRegisterInfo.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
18 #include "llvm/Target/TargetInstrInfo.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
19
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
20 #define GET_INSTRINFO_HEADER
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
21 #include "ARCGenInstrInfo.inc"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
22
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
23 namespace llvm {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
24
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
25 class ARCSubtarget;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
26
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
27 class ARCInstrInfo : public ARCGenInstrInfo {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
28 const ARCRegisterInfo RI;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
29 virtual void anchor();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
30
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
31 public:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
32 ARCInstrInfo();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
33
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
34 const ARCRegisterInfo &getRegisterInfo() const { return RI; }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
35
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
36 /// If the specified machine instruction is a direct
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
37 /// load from a stack slot, return the virtual or physical register number of
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
38 /// the destination along with the FrameIndex of the loaded stack slot. If
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
39 /// not, return 0. This predicate must return 0 if the instruction has
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
40 /// any side effects other than loading from the stack slot.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
41 unsigned isLoadFromStackSlot(const MachineInstr &MI,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
42 int &FrameIndex) const override;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
43
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
44 /// If the specified machine instruction is a direct
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
45 /// store to a stack slot, return the virtual or physical register number of
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
46 /// the source reg along with the FrameIndex of the loaded stack slot. If
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
47 /// not, return 0. This predicate must return 0 if the instruction has
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
48 /// any side effects other than storing to the stack slot.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
49 unsigned isStoreToStackSlot(const MachineInstr &MI,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
50 int &FrameIndex) const override;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
51
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
52 unsigned getInstSizeInBytes(const MachineInstr &MI) const override;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
53
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
54 bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
55 MachineBasicBlock *&FBB,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
56 SmallVectorImpl<MachineOperand> &Cond,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
57 bool AllowModify) const override;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
58
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
59 unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
60 MachineBasicBlock *FBB, ArrayRef<MachineOperand> Cond,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
61 const DebugLoc &dl,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
62 int *BytesAdded = nullptr) const override;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
63
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
64 unsigned removeBranch(MachineBasicBlock &MBB,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
65 int *BytesRemoved = nullptr) const override;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
66
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
67 void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
68 const DebugLoc &dl, unsigned DestReg, unsigned SrcReg,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
69 bool KillSrc) const override;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
70
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
71 void storeRegToStackSlot(MachineBasicBlock &MBB,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
72 MachineBasicBlock::iterator MI, unsigned SrcReg,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
73 bool isKill, int FrameIndex,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
74 const TargetRegisterClass *RC,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
75 const TargetRegisterInfo *TRI) const override;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
76
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
77 void loadRegFromStackSlot(MachineBasicBlock &MBB,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
78 MachineBasicBlock::iterator MI, unsigned DestReg,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
79 int FrameIndex, const TargetRegisterClass *RC,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
80 const TargetRegisterInfo *TRI) const override;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
81
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
82 bool
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
83 reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
84
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
85 // Emit code before MBBI to load immediate value into physical register Reg.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
86 // Returns an iterator to the new instruction.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
87 MachineBasicBlock::iterator loadImmediate(MachineBasicBlock &MBB,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
88 MachineBasicBlock::iterator MI,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
89 unsigned Reg, uint64_t Value) const;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
90 };
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
91
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
92 } // end namespace llvm
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
93
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
94 #endif // LLVM_LIB_TARGET_ARC_ARCINSTRINFO_H