File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -207,3 +207,32 @@ test at ``llvm/test/Transforms/HelloNew/helloworld.ll``. See
207
207
208
208
$ ninja -C build check-llvm
209
209
# runs our new test alongside all other llvm lit tests
210
+
211
+ FAQs
212
+ ====
213
+
214
+ Required passes
215
+ ---------------
216
+
217
+ A pass that defines a static ``isRequired() `` method that returns true is a required pass. For example:
218
+
219
+ .. code-block :: c++
220
+
221
+ class HelloWorldPass : public PassInfoMixin<HelloWorldPass> {
222
+ public:
223
+ PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
224
+
225
+ static bool isRequired() { return true; }
226
+ };
227
+
228
+ A required pass is a pass that may not be skipped. An example of a required
229
+ pass is ``AlwaysInlinerPass ``, which must always be run to preserve
230
+ ``alwaysinline `` semantics. Pass managers are required since they may contain
231
+ other required passes.
232
+
233
+ An example of how a pass can be skipped is the ``optnone `` function
234
+ attribute, which specifies that optimizations should not be run on the
235
+ function. Required passes will still be run on ``optnone `` functions.
236
+
237
+ For more implementation details, see
238
+ ``PassInstrumentation::runBeforePass() ``.
You can’t perform that action at this time.
0 commit comments