LLVM: include/llvm/Pass.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28#ifndef LLVM_PASS_H
29#define LLVM_PASS_H
30
31#ifdef EXPENSIVE_CHECKS
32#include
33#endif
35#include
36
37namespace llvm {
38
49
50
52
53
54
55
65
66
75
76
89
90#ifndef NDEBUG
92#endif
93
94
95
96
97
98
100 AnalysisResolver *Resolver = nullptr;
101 const void *PassID;
103
104public:
105 explicit Pass(PassKind K, char &pid) : PassID(&pid), Kind(K) {}
109
111
112
113
114
115 virtual StringRef getPassName() const;
116
117
118
119 StringRef getPassArgument() const;
120
121
125
126
127
129
130
131
133
134
135
136
137
138
139
141
142 void dump() const;
143
144
145
147 const std::string &Banner) const = 0;
148
149
150
153
154
155 virtual void preparePassManager(PMStack &);
156
157
158 virtual PassManagerType getPotentialPassManagerType() const;
159
160
163
164
165
166
167
168 virtual void getAnalysisUsage(AnalysisUsage &) const;
169
170
171
172
173
174
175
176
177
178
179
180 virtual void releaseMemory();
181
184
185
186
187 virtual void verifyAnalysis() const;
188
189
190 virtual void dumpPassStructure(unsigned Offset = 0);
191
192
193
194 static const PassInfo *lookupPassInfo(const void *TI);
195
196
197
199
200
201
203
204
205
206
207
208
209
210
211 template AnalysisType *
212 getAnalysisIfAvailable() const;
213
214
215
216
217
218
219 bool mustPreserveAnalysisID(char &AID) const;
220
221
222
223
224 template
225 AnalysisType &getAnalysis() const;
226
227 template
228 AnalysisType &
230 bool *Changed = nullptr);
231
232 template
233 AnalysisType &getAnalysisID(AnalysisID PI) const;
234
235 template
237 bool *Changed = nullptr);
238
239#ifdef EXPENSIVE_CHECKS
240
241
243
244
245
247#endif
248};
249
250
251
252
253
254
256public:
258
259
261
262
264 const std::string &Banner) const override;
265
266
267
269
271
272
274
275protected:
276
277
279};
280
281
282
283
284
286public:
288
289
291
292
293
294
295
296
298
300
301
303};
304
305
306
307
308
309
310
311
312
313
315public:
317
318
320 const std::string &Banner) const override;
321
322
323
325
327
328
330
331protected:
332
333
334
336};
337
338
339
340
342
343
344
345
346
348
349}
350
351
352
355
356#endif
aarch64 falkor hwpf fix Falkor HW Prefetch Fix Late Phase
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
AnalysisResolver - Simple interface used by Pass objects to pull all analysis information out of pass...
Represent the analysis usage information of a pass.
PassManagerType getPotentialPassManagerType() const override
Return what kind of Pass Manager can manage this pass.
void assignPassManager(PMStack &PMS, PassManagerType T) override
Find appropriate Function Pass Manager or Call Graph Pass Manager in the PM Stack and add self into t...
FunctionPass(char &pid)
Definition Pass.h:316
virtual bool runOnFunction(Function &F)=0
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass.
bool skipFunction(const Function &F) const
Optional passes call this function to check whether the pass should be skipped.
ImmutablePass class - This class is used to provide information that does not need to be run.
Definition Pass.h:285
ImmutablePass(char &pid)
Definition Pass.h:287
~ImmutablePass() override
ImmutablePass * getAsImmutablePass() override
Definition Pass.h:299
virtual void initializePass()
initializePass - This method may be overriden by immutable passes to allow them to perform various in...
bool runOnModule(Module &) override
ImmutablePasses are never run.
Definition Pass.h:302
PassManagerType getPotentialPassManagerType() const override
Return what kind of Pass Manager can manage this pass.
bool skipModule(const Module &M) const
Optional passes call this function to check whether the pass should be skipped.
ModulePass(char &pid)
Definition Pass.h:257
void assignPassManager(PMStack &PMS, PassManagerType T) override
Find appropriate Module Pass Manager in the PM Stack and add self into that manager.
virtual bool runOnModule(Module &M)=0
runOnModule - Virtual method overriden by subclasses to process the module being operated on.
Pass * createPrinterPass(raw_ostream &OS, const std::string &Banner) const override
createPrinterPass - Get a module printer pass.
A Module instance is used to store all the information related to an LLVM module.
PMDataManager provides the common place to manage the analysis data used by pass managers.
PMStack - This class implements a stack data structure of PMDataManager pointers.
PassInfo class - An instance of this class exists for every pass known by the system,...
Pass interface - Implemented by all 'passes'.
Definition Pass.h:99
Pass(PassKind K, char &pid)
Definition Pass.h:105
AnalysisID getPassID() const
getPassID - Return the PassID number that corresponds to this pass.
Definition Pass.h:122
virtual void assignPassManager(PMStack &, PassManagerType)
Each pass is responsible for assigning a pass manager to itself.
Definition Pass.h:151
AnalysisResolver * getResolver() const
Definition Pass.h:162
PassKind getPassKind() const
Definition Pass.h:110
virtual bool doInitialization(Module &)
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before ...
Definition Pass.h:128
virtual Pass * createPrinterPass(raw_ostream &OS, const std::string &Banner) const =0
createPrinterPass - Get a Pass appropriate to print the IR this pass operates on (Module,...
virtual bool doFinalization(Module &)
doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes...
Definition Pass.h:132
Pass(const Pass &)=delete
Pass & operator=(const Pass &)=delete
StringRef - Represent a constant reference to a string, i.e.
This class implements an extremely fast bulk output stream that can only output to a stream.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
This is an optimization pass for GlobalISel generic memory operations.
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
PassKind
Definition Pass.h:67
@ PT_Region
Definition Pass.h:68
@ PT_CallGraphSCC
Definition Pass.h:71
@ PT_Module
Definition Pass.h:72
@ PT_Function
Definition Pass.h:70
@ PT_Loop
Definition Pass.h:69
@ PT_PassManager
Definition Pass.h:73
PassManagerType
Different types of internal pass managers.
Definition Pass.h:56
@ PMT_LoopPassManager
LPPassManager.
Definition Pass.h:61
@ PMT_RegionPassManager
RGPassManager.
Definition Pass.h:62
@ PMT_Unknown
Definition Pass.h:57
@ PMT_Last
Definition Pass.h:63
@ PMT_CallGraphPassManager
CGPassManager.
Definition Pass.h:59
@ PMT_ModulePassManager
MPPassManager.
Definition Pass.h:58
@ PMT_FunctionPassManager
FPPassManager.
Definition Pass.h:60
LLVM_ABI bool TimePassesIsEnabled
If the user specifies the -time-passes argument on an LLVM tool command line then the value of this b...
LLVM_ABI bool TimePassesPerRun
If TimePassesPerRun is true, there would be one line of report for each pass invocation.
ThinOrFullLTOPhase
This enumerates the LLVM full LTO or ThinLTO optimization phases.
Definition Pass.h:77
@ FullLTOPreLink
Full LTO prelink phase.
Definition Pass.h:85
@ ThinLTOPostLink
ThinLTO postlink (backend compile) phase.
Definition Pass.h:83
@ FullLTOPostLink
Full LTO postlink (backend compile) phase.
Definition Pass.h:87
@ ThinLTOPreLink
ThinLTO prelink (summary) phase.
Definition Pass.h:81
const char * to_string(ThinOrFullLTOPhase Phase)
const void * AnalysisID
Definition Pass.h:51