annotate lib/Target/SystemZ/SystemZInstrInfo.h @ 134:3a76565eade5 LLVM5.0.1

update 5.0.1
author mir3636
date Sat, 17 Feb 2018 09:57:20 +0900
parents 803732b1fca8
children c2174574ed3a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 //===-- SystemZInstrInfo.h - SystemZ instruction information ----*- C++ -*-===//
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 //
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 // The LLVM Compiler Infrastructure
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 //
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 // This file is distributed under the University of Illinois Open Source
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 // License. See LICENSE.TXT for details.
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 //
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 //===----------------------------------------------------------------------===//
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 //
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 // This file contains the SystemZ implementation of the TargetInstrInfo class.
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 //
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 //===----------------------------------------------------------------------===//
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
14 #ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZINSTRINFO_H
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
15 #define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZINSTRINFO_H
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 #include "SystemZ.h"
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 #include "SystemZRegisterInfo.h"
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
19 #include "llvm/ADT/ArrayRef.h"
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
20 #include "llvm/CodeGen/MachineBasicBlock.h"
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
21 #include "llvm/CodeGen/MachineFunction.h"
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
22 #include "llvm/CodeGen/MachineInstrBuilder.h"
134
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
23 #include "llvm/CodeGen/TargetInstrInfo.h"
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
24 #include <cstdint>
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 #define GET_INSTRINFO_HEADER
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 #include "SystemZGenInstrInfo.inc"
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 namespace llvm {
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
31 class SystemZSubtarget;
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 namespace SystemZII {
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
34
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
35 enum {
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
36 // See comments in SystemZInstrFormats.td.
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
37 SimpleBDXLoad = (1 << 0),
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
38 SimpleBDXStore = (1 << 1),
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
39 Has20BitOffset = (1 << 2),
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
40 HasIndex = (1 << 3),
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
41 Is128Bit = (1 << 4),
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
42 AccessSizeMask = (31 << 5),
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
43 AccessSizeShift = 5,
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
44 CCValuesMask = (15 << 10),
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
45 CCValuesShift = 10,
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
46 CompareZeroCCMaskMask = (15 << 14),
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
47 CompareZeroCCMaskShift = 14,
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
48 CCMaskFirst = (1 << 18),
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
49 CCMaskLast = (1 << 19),
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
50 IsLogical = (1 << 20)
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
51 };
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
52
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
53 static inline unsigned getAccessSize(unsigned int Flags) {
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
54 return (Flags & AccessSizeMask) >> AccessSizeShift;
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
55 }
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
56
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
57 static inline unsigned getCCValues(unsigned int Flags) {
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
58 return (Flags & CCValuesMask) >> CCValuesShift;
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
59 }
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
60
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
61 static inline unsigned getCompareZeroCCMask(unsigned int Flags) {
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
62 return (Flags & CompareZeroCCMaskMask) >> CompareZeroCCMaskShift;
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 }
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
64
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
65 // SystemZ MachineOperand target flags.
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
66 enum {
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
67 // Masks out the bits for the access model.
95
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
68 MO_SYMBOL_MODIFIER = (3 << 0),
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
69
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
70 // @GOT (aka @GOTENT)
95
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
71 MO_GOT = (1 << 0),
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
72
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
73 // @INDNTPOFF
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
74 MO_INDNTPOFF = (2 << 0)
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
75 };
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
76
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
77 // Classifies a branch.
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
78 enum BranchType {
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
79 // An instruction that branches on the current value of CC.
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
80 BranchNormal,
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
81
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
82 // An instruction that peforms a 32-bit signed comparison and branches
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
83 // on the result.
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
84 BranchC,
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
85
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
86 // An instruction that peforms a 32-bit unsigned comparison and branches
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
87 // on the result.
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
88 BranchCL,
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
89
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
90 // An instruction that peforms a 64-bit signed comparison and branches
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
91 // on the result.
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
92 BranchCG,
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
93
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
94 // An instruction that peforms a 64-bit unsigned comparison and branches
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
95 // on the result.
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
96 BranchCLG,
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
97
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
98 // An instruction that decrements a 32-bit register and branches if
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
99 // the result is nonzero.
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
100 BranchCT,
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
101
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
102 // An instruction that decrements a 64-bit register and branches if
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
103 // the result is nonzero.
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
104 BranchCTG
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
105 };
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
106
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
107 // Information about a branch instruction.
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
108 struct Branch {
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
109 // The type of the branch.
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
110 BranchType Type;
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
111
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
112 // CCMASK_<N> is set if CC might be equal to N.
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
113 unsigned CCValid;
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
114
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
115 // CCMASK_<N> is set if the branch should be taken when CC == N.
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
116 unsigned CCMask;
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
117
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
118 // The target of the branch.
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
119 const MachineOperand *Target;
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
120
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
121 Branch(BranchType type, unsigned ccValid, unsigned ccMask,
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
122 const MachineOperand *target)
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
123 : Type(type), CCValid(ccValid), CCMask(ccMask), Target(target) {}
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
124 };
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
125
120
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
126 // Kinds of fused compares in compare-and-* instructions. Together with type
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
127 // of the converted compare, this identifies the compare-and-*
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
128 // instruction.
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
129 enum FusedCompareType {
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
130 // Relative branch - CRJ etc.
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
131 CompareAndBranch,
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
132
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
133 // Indirect branch, used for return - CRBReturn etc.
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
134 CompareAndReturn,
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
135
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
136 // Indirect branch, used for sibcall - CRBCall etc.
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
137 CompareAndSibcall,
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
138
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
139 // Trap
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
140 CompareAndTrap
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
141 };
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
142
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
143 } // end namespace SystemZII
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
144
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
145 class SystemZInstrInfo : public SystemZGenInstrInfo {
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
146 const SystemZRegisterInfo RI;
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
147 SystemZSubtarget &STI;
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
148
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
149 void splitMove(MachineBasicBlock::iterator MI, unsigned NewOpcode) const;
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
150 void splitAdjDynAlloc(MachineBasicBlock::iterator MI) const;
120
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
151 void expandRIPseudo(MachineInstr &MI, unsigned LowOpcode, unsigned HighOpcode,
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
152 bool ConvertHigh) const;
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
153 void expandRIEPseudo(MachineInstr &MI, unsigned LowOpcode,
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
154 unsigned LowOpcodeK, unsigned HighOpcode) const;
120
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
155 void expandRXYPseudo(MachineInstr &MI, unsigned LowOpcode,
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
156 unsigned HighOpcode) const;
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
157 void expandLOCPseudo(MachineInstr &MI, unsigned LowOpcode,
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
158 unsigned HighOpcode) const;
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
159 void expandLOCRPseudo(MachineInstr &MI, unsigned LowOpcode,
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
160 unsigned HighOpcode) const;
120
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
161 void expandZExtPseudo(MachineInstr &MI, unsigned LowOpcode,
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
162 unsigned Size) const;
120
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
163 void expandLoadStackGuard(MachineInstr *MI) const;
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
164
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
165 MachineInstrBuilder
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
166 emitGRX32Move(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
167 const DebugLoc &DL, unsigned DestReg, unsigned SrcReg,
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
168 unsigned LowLowOpcode, unsigned Size, bool KillSrc,
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
169 bool UndefSrc) const;
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
170
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
171 virtual void anchor();
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
172
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
173 protected:
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
174 /// Commutes the operands in the given instruction by changing the operands
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
175 /// order and/or changing the instruction's opcode and/or the immediate value
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
176 /// operand.
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
177 ///
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
178 /// The arguments 'CommuteOpIdx1' and 'CommuteOpIdx2' specify the operands
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
179 /// to be commuted.
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
180 ///
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
181 /// Do not call this method for a non-commutable instruction or
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
182 /// non-commutable operands.
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
183 /// Even though the instruction is commutable, the method may still
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
184 /// fail to commute the operands, null pointer is returned in such cases.
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
185 MachineInstr *commuteInstructionImpl(MachineInstr &MI, bool NewMI,
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
186 unsigned CommuteOpIdx1,
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
187 unsigned CommuteOpIdx2) const override;
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
188
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
189 public:
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
190 explicit SystemZInstrInfo(SystemZSubtarget &STI);
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
191
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
192 // Override TargetInstrInfo.
120
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
193 unsigned isLoadFromStackSlot(const MachineInstr &MI,
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
194 int &FrameIndex) const override;
120
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
195 unsigned isStoreToStackSlot(const MachineInstr &MI,
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
196 int &FrameIndex) const override;
120
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
197 bool isStackSlotCopy(const MachineInstr &MI, int &DestFrameIndex,
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
198 int &SrcFrameIndex) const override;
120
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
199 bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
200 MachineBasicBlock *&FBB,
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
201 SmallVectorImpl<MachineOperand> &Cond,
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
202 bool AllowModify) const override;
120
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
203 unsigned removeBranch(MachineBasicBlock &MBB,
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
204 int *BytesRemoved = nullptr) const override;
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
205 unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
95
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
206 MachineBasicBlock *FBB, ArrayRef<MachineOperand> Cond,
120
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
207 const DebugLoc &DL,
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
208 int *BytesAdded = nullptr) const override;
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
209 bool analyzeCompare(const MachineInstr &MI, unsigned &SrcReg,
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
210 unsigned &SrcReg2, int &Mask, int &Value) const override;
120
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
211 bool optimizeCompareInstr(MachineInstr &CmpInstr, unsigned SrcReg,
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
212 unsigned SrcReg2, int Mask, int Value,
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
213 const MachineRegisterInfo *MRI) const override;
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
214 bool canInsertSelect(const MachineBasicBlock&, ArrayRef<MachineOperand> Cond,
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
215 unsigned, unsigned, int&, int&, int&) const override;
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
216 void insertSelect(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
217 const DebugLoc &DL, unsigned DstReg,
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
218 ArrayRef<MachineOperand> Cond, unsigned TrueReg,
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
219 unsigned FalseReg) const override;
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
220 bool FoldImmediate(MachineInstr &UseMI, MachineInstr &DefMI, unsigned Reg,
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
221 MachineRegisterInfo *MRI) const override;
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
222 bool isPredicable(const MachineInstr &MI) const override;
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
223 bool isProfitableToIfCvt(MachineBasicBlock &MBB, unsigned NumCycles,
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
224 unsigned ExtraPredCycles,
95
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
225 BranchProbability Probability) const override;
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
226 bool isProfitableToIfCvt(MachineBasicBlock &TMBB,
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
227 unsigned NumCyclesT, unsigned ExtraPredCyclesT,
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
228 MachineBasicBlock &FMBB,
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
229 unsigned NumCyclesF, unsigned ExtraPredCyclesF,
95
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
230 BranchProbability Probability) const override;
120
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
231 bool isProfitableToDupForIfCvt(MachineBasicBlock &MBB, unsigned NumCycles,
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
232 BranchProbability Probability) const override;
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
233 bool PredicateInstruction(MachineInstr &MI,
95
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
234 ArrayRef<MachineOperand> Pred) const override;
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
235 void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
120
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
236 const DebugLoc &DL, unsigned DestReg, unsigned SrcReg,
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
237 bool KillSrc) const override;
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
238 void storeRegToStackSlot(MachineBasicBlock &MBB,
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
239 MachineBasicBlock::iterator MBBI,
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
240 unsigned SrcReg, bool isKill, int FrameIndex,
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
241 const TargetRegisterClass *RC,
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
242 const TargetRegisterInfo *TRI) const override;
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
243 void loadRegFromStackSlot(MachineBasicBlock &MBB,
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
244 MachineBasicBlock::iterator MBBI,
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
245 unsigned DestReg, int FrameIdx,
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
246 const TargetRegisterClass *RC,
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
247 const TargetRegisterInfo *TRI) const override;
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
248 MachineInstr *convertToThreeAddress(MachineFunction::iterator &MFI,
120
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
249 MachineInstr &MI,
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
250 LiveVariables *LV) const override;
120
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
251 MachineInstr *
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
252 foldMemoryOperandImpl(MachineFunction &MF, MachineInstr &MI,
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
253 ArrayRef<unsigned> Ops,
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
254 MachineBasicBlock::iterator InsertPt, int FrameIndex,
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
255 LiveIntervals *LIS = nullptr) const override;
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
256 MachineInstr *foldMemoryOperandImpl(
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
257 MachineFunction &MF, MachineInstr &MI, ArrayRef<unsigned> Ops,
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
258 MachineBasicBlock::iterator InsertPt, MachineInstr &LoadMI,
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
259 LiveIntervals *LIS = nullptr) const override;
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
260 bool expandPostRAPseudo(MachineInstr &MBBI) const override;
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
261 bool reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
262 override;
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
263
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
264 // Return the SystemZRegisterInfo, which this class owns.
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
265 const SystemZRegisterInfo &getRegisterInfo() const { return RI; }
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
266
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
267 // Return the size in bytes of MI.
120
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
268 unsigned getInstSizeInBytes(const MachineInstr &MI) const override;
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
269
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
270 // Return true if MI is a conditional or unconditional branch.
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
271 // When returning true, set Cond to the mask of condition-code
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
272 // values on which the instruction will branch, and set Target
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
273 // to the operand that contains the branch target. This target
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
274 // can be a register or a basic block.
120
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
275 SystemZII::Branch getBranchInfo(const MachineInstr &MI) const;
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
276
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
277 // Get the load and store opcodes for a given register class.
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
278 void getLoadStoreOpcodes(const TargetRegisterClass *RC,
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
279 unsigned &LoadOpcode, unsigned &StoreOpcode) const;
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
280
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
281 // Opcode is the opcode of an instruction that has an address operand,
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
282 // and the caller wants to perform that instruction's operation on an
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
283 // address that has displacement Offset. Return the opcode of a suitable
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
284 // instruction (which might be Opcode itself) or 0 if no such instruction
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
285 // exists.
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
286 unsigned getOpcodeForOffset(unsigned Opcode, int64_t Offset) const;
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
287
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
288 // If Opcode is a load instruction that has a LOAD AND TEST form,
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
289 // return the opcode for the testing form, otherwise return 0.
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
290 unsigned getLoadAndTest(unsigned Opcode) const;
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
291
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
292 // Return true if ROTATE AND ... SELECTED BITS can be used to select bits
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
293 // Mask of the R2 operand, given that only the low BitSize bits of Mask are
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
294 // significant. Set Start and End to the I3 and I4 operands if so.
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
295 bool isRxSBGMask(uint64_t Mask, unsigned BitSize,
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
296 unsigned &Start, unsigned &End) const;
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
297
120
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
298 // If Opcode is a COMPARE opcode for which an associated fused COMPARE AND *
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
299 // operation exists, return the opcode for the latter, otherwise return 0.
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
300 // MI, if nonnull, is the compare instruction.
120
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
301 unsigned getFusedCompare(unsigned Opcode,
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
302 SystemZII::FusedCompareType Type,
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
303 const MachineInstr *MI = nullptr) const;
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
304
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
305 // If Opcode is a LOAD opcode for with an associated LOAD AND TRAP
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
306 // operation exists, returh the opcode for the latter, otherwise return 0.
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
307 unsigned getLoadAndTrap(unsigned Opcode) const;
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
308
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
309 // Emit code before MBBI in MI to move immediate value Value into
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
310 // physical register Reg.
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
311 void loadImmediate(MachineBasicBlock &MBB,
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
312 MachineBasicBlock::iterator MBBI,
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
313 unsigned Reg, uint64_t Value) const;
120
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
314
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
315 // Sometimes, it is possible for the target to tell, even without
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
316 // aliasing information, that two MIs access different memory
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
317 // addresses. This function returns true if two MIs access different
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
318 // memory addresses and false otherwise.
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
319 bool
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
320 areMemAccessesTriviallyDisjoint(MachineInstr &MIa, MachineInstr &MIb,
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
321 AliasAnalysis *AA = nullptr) const override;
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
322 };
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
323
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
324 } // end namespace llvm
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
325
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
326 #endif // LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZINSTRINFO_H