LLVM: include/llvm/MC/MCInstrAnalysis.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef LLVM_MC_MCINSTRANALYSIS_H
15#define LLVM_MC_MCINSTRANALYSIS_H
16
23#include
24#include
25
26namespace llvm {
27
30
32protected:
34
36
37public:
40
41
43
44
45
46
47
48
49
50
51
52
53
55
59
61 return Info->get(Inst.getOpcode()).isConditionalBranch();
62 }
63
65 return Info->get(Inst.getOpcode()).isUnconditionalBranch();
66 }
67
71
75
79
83
87
92 return true;
94 if (!PC)
95 return false;
96 return Info->get(Inst.getOpcode()).hasDefOfPhysReg(Inst, PC, MCRI);
97 }
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
122 APInt &Writes) const;
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
143 unsigned CPUID) const {
144 return false;
145 }
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
168 unsigned CPUID) const {
170 }
171
172
173
174
175
176
177
179 unsigned CPUID) const {
180 return false;
181 }
182
183
184
185 virtual bool
188
189
190
191 virtual std::optional<uint64_t>
194
195
196
197 virtual std::optional<uint64_t>
198 getMemoryOperandRelocationOffset(const MCInst &Inst, uint64_t Size) const;
199
200
201 virtual std::vector<std::pair<uint64_t, uint64_t>>
206};
207
208}
209
210#endif
unsigned const MachineRegisterInfo * MRI
static bool isBranch(unsigned Opcode)
Class for arbitrary precision integers.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Instances of this class represent a single low-level machine instruction.
unsigned getOpcode() const
virtual std::vector< std::pair< uint64_t, uint64_t > > findPltEntries(uint64_t PltSectionVA, ArrayRef< uint8_t > PltContents, const MCSubtargetInfo &STI) const
Returns (PLT virtual address, GOT virtual address) pairs for PLT entries.
Definition MCInstrAnalysis.h:202
virtual bool isCall(const MCInst &Inst) const
Definition MCInstrAnalysis.h:72
virtual bool isBranch(const MCInst &Inst) const
Definition MCInstrAnalysis.h:56
virtual bool isOptimizableRegisterMove(const MCInst &MI, unsigned CPUID) const
Returns true if MI is a candidate for move elimination.
Definition MCInstrAnalysis.h:178
virtual bool isDependencyBreaking(const MCInst &MI, APInt &Mask, unsigned CPUID) const
Returns true if MI is a dependency breaking instruction for the subtarget associated with CPUID .
Definition MCInstrAnalysis.h:167
virtual bool isUnconditionalBranch(const MCInst &Inst) const
Definition MCInstrAnalysis.h:64
virtual bool isZeroIdiom(const MCInst &MI, APInt &Mask, unsigned CPUID) const
Returns true if MI is a dependency breaking zero-idiom for the given subtarget.
Definition MCInstrAnalysis.h:142
virtual bool isTerminator(const MCInst &Inst) const
Definition MCInstrAnalysis.h:80
virtual bool isBarrier(const MCInst &Inst) const
Definition MCInstrAnalysis.h:84
virtual void resetState()
Clear the internal state. See updateState for more information.
Definition MCInstrAnalysis.h:42
virtual bool isConditionalBranch(const MCInst &Inst) const
Definition MCInstrAnalysis.h:60
friend class Target
Definition MCInstrAnalysis.h:33
virtual bool mayAffectControlFlow(const MCInst &Inst, const MCRegisterInfo &MCRI) const
Definition MCInstrAnalysis.h:88
virtual bool isReturn(const MCInst &Inst) const
Definition MCInstrAnalysis.h:76
virtual void updateState(const MCInst &Inst, uint64_t Addr)
Update internal state with Inst at Addr.
Definition MCInstrAnalysis.h:54
const MCInstrInfo * Info
Definition MCInstrAnalysis.h:35
MCInstrAnalysis(const MCInstrInfo *Info)
Definition MCInstrAnalysis.h:38
virtual ~MCInstrAnalysis()=default
virtual bool isIndirectBranch(const MCInst &Inst) const
Definition MCInstrAnalysis.h:68
Interface to description of machine instruction set.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
MCRegister getProgramCounter() const
Return the register which is the program counter.
Wrapper class representing physical registers. Should be passed by value.
Generic base class for all target subtargets.
Target - Wrapper for Target specific information.
Triple - Helper class for working with autoconf configuration names.
This is an optimization pass for GlobalISel generic memory operations.