MLIR  17.0.0git
PassManager.h
Go to the documentation of this file.
1 //===- PassManager.h - Pass Management Interface ----------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef MLIR_PASS_PASSMANAGER_H
10 #define MLIR_PASS_PASSMANAGER_H
11 
12 #include "mlir/IR/Dialect.h"
15 #include "mlir/Support/Timing.h"
16 #include "llvm/ADT/SmallVector.h"
17 #include "llvm/ADT/iterator.h"
18 #include "llvm/Support/raw_ostream.h"
19 
20 #include <functional>
21 #include <vector>
22 #include <optional>
23 
24 namespace llvm {
25 class Any;
26 } // namespace llvm
27 
28 namespace mlir {
29 class AnalysisManager;
30 class MLIRContext;
31 class Operation;
32 class Pass;
33 class PassInstrumentation;
34 class PassInstrumentor;
35 
36 namespace detail {
37 struct OpPassManagerImpl;
38 class OpToOpPassAdaptor;
39 class PassCrashReproducerGenerator;
40 struct PassExecutionState;
41 } // namespace detail
42 
43 //===----------------------------------------------------------------------===//
44 // OpPassManager
45 //===----------------------------------------------------------------------===//
46 
47 /// This class represents a pass manager that runs passes on either a specific
48 /// operation type, or any isolated operation. This pass manager can not be run
49 /// on an operation directly, but must be run either as part of a top-level
50 /// `PassManager`(e.g. when constructed via `nest` calls), or dynamically within
51 /// a pass by using the `Pass::runPipeline` API.
53 public:
54  /// This enum represents the nesting behavior of the pass manager.
55  enum class Nesting {
56  /// Implicit nesting behavior. This allows for adding passes operating on
57  /// operations different from this pass manager, in which case a new pass
58  /// manager is implicitly nested for the operation type of the new pass.
59  Implicit,
60  /// Explicit nesting behavior. This requires that any passes added to this
61  /// pass manager support its operation type.
62  Explicit
63  };
64 
65  /// Construct a new op-agnostic ("any") pass manager with the given operation
66  /// type and nesting behavior. This is the same as invoking:
67  /// `OpPassManager(getAnyOpAnchorName(), nesting)`.
69 
70  /// Construct a new pass manager with the given anchor operation type and
71  /// nesting behavior.
72  OpPassManager(StringRef name, Nesting nesting = Nesting::Explicit);
75  OpPassManager(const OpPassManager &rhs);
79 
80  /// Iterator over the passes in this pass manager.
81  using pass_iterator =
82  llvm::pointee_iterator<MutableArrayRef<std::unique_ptr<Pass>>::iterator>;
86 
88  llvm::pointee_iterator<ArrayRef<std::unique_ptr<Pass>>::const_iterator>;
89  const_pass_iterator begin() const;
90  const_pass_iterator end() const;
92  return {begin(), end()};
93  }
94 
95  /// Returns true if the pass manager has no passes.
96  bool empty() const { return begin() == end(); }
97 
98  /// Nest a new operation pass manager for the given operation kind under this
99  /// pass manager.
100  OpPassManager &nest(OperationName nestedName);
101  OpPassManager &nest(StringRef nestedName);
102  template <typename OpT>
104  return nest(OpT::getOperationName());
105  }
106 
107  /// Nest a new op-agnostic ("any") pass manager under this pass manager.
108  /// Note: This is the same as invoking `nest(getAnyOpAnchorName())`.
110 
111  /// Add the given pass to this pass manager. If this pass has a concrete
112  /// operation type, it must be the same type as this pass manager.
113  void addPass(std::unique_ptr<Pass> pass);
114 
115  /// Clear the pipeline, but not the other options set on this OpPassManager.
116  void clear();
117 
118  /// Add the given pass to a nested pass manager for the given operation kind
119  /// `OpT`.
120  template <typename OpT>
121  void addNestedPass(std::unique_ptr<Pass> pass) {
122  nest<OpT>().addPass(std::move(pass));
123  }
124 
125  /// Returns the number of passes held by this manager.
126  size_t size() const;
127 
128  /// Return the operation name that this pass manager operates on, or
129  /// std::nullopt if this is an op-agnostic pass manager.
130  std::optional<OperationName> getOpName(MLIRContext &context) const;
131 
132  /// Return the operation name that this pass manager operates on, or
133  /// std::nullopt if this is an op-agnostic pass manager.
134  std::optional<StringRef> getOpName() const;
135 
136  /// Return the name used to anchor this pass manager. This is either the name
137  /// of an operation, or the result of `getAnyOpAnchorName()` in the case of an
138  /// op-agnostic pass manager.
139  StringRef getOpAnchorName() const;
140 
141  /// Return the string name used to anchor op-agnostic pass managers that
142  /// operate generically on any viable operation.
143  static StringRef getAnyOpAnchorName() { return "any"; }
144 
145  /// Returns the internal implementation instance.
147 
148  /// Prints out the passes of the pass manager as the textual representation
149  /// of pipelines.
150  /// Note: The quality of the string representation depends entirely on the
151  /// the correctness of per-pass overrides of Pass::printAsTextualPipeline.
152  void printAsTextualPipeline(raw_ostream &os) const;
153 
154  /// Raw dump of the pass manager to llvm::errs().
155  void dump();
156 
157  /// Merge the pass statistics of this class into 'other'.
158  void mergeStatisticsInto(OpPassManager &other);
159 
160  /// Register dependent dialects for the current pass manager.
161  /// This is forwarding to every pass in this PassManager, see the
162  /// documentation for the same method on the Pass class.
163  void getDependentDialects(DialectRegistry &dialects) const;
164 
165  /// Enable or disable the implicit nesting on this particular PassManager.
166  /// This will also apply to any newly nested PassManager built from this
167  /// instance.
168  void setNesting(Nesting nesting);
169 
170  /// Return the current nesting mode.
172 
173 private:
174  /// Initialize all of the passes within this pass manager with the given
175  /// initialization generation. The initialization generation is used to detect
176  /// if a pass manager has already been initialized.
177  LogicalResult initialize(MLIRContext *context, unsigned newInitGeneration);
178 
179  /// A pointer to an internal implementation instance.
180  std::unique_ptr<detail::OpPassManagerImpl> impl;
181 
182  /// Allow access to initialize.
184 
185  /// Allow access to the constructor.
186  friend class PassManager;
187  friend class Pass;
188 
189  /// Allow access.
191 };
192 
193 //===----------------------------------------------------------------------===//
194 // PassManager
195 //===----------------------------------------------------------------------===//
196 
197 /// An enum describing the different display modes for the information within
198 /// the pass manager.
199 enum class PassDisplayMode {
200  // In this mode the results are displayed in a list sorted by total,
201  // with each pass/analysis instance aggregated into one unique result.
202  List,
203 
204  // In this mode the results are displayed in a nested pipeline view that
205  // mirrors the internal pass pipeline that is being executed in the pass
206  // manager.
207  Pipeline,
208 };
209 
210 /// The main pass manager and pipeline builder.
211 class PassManager : public OpPassManager {
212 public:
213  /// Create a new pass manager under the given context with a specific nesting
214  /// style. The created pass manager can schedule operations that match
215  /// `operationName`.
217  StringRef operationName = PassManager::getAnyOpAnchorName(),
218  Nesting nesting = Nesting::Explicit);
219  PassManager(OperationName operationName, Nesting nesting = Nesting::Explicit);
221 
222  /// Create a new pass manager under the given context with a specific nesting
223  /// style. The created pass manager can schedule operations that match
224  /// `OperationTy`.
225  template <typename OperationTy>
227  return PassManager(ctx, OperationTy::getOperationName(), nesting);
228  }
229 
230  /// Run the passes within this manager on the provided operation. The
231  /// specified operation must have the same name as the one provided the pass
232  /// manager on construction.
234 
235  /// Return an instance of the context.
236  MLIRContext *getContext() const { return context; }
237 
238  /// Enable support for the pass manager to generate a reproducer on the event
239  /// of a crash or a pass failure. `outputFile` is a .mlir filename used to
240  /// write the generated reproducer. If `genLocalReproducer` is true, the pass
241  /// manager will attempt to generate a local reproducer that contains the
242  /// smallest pipeline.
243  void enableCrashReproducerGeneration(StringRef outputFile,
244  bool genLocalReproducer = false);
245 
246  /// Streams on which to output crash reproducer.
248  virtual ~ReproducerStream() = default;
249 
250  /// Description of the reproducer stream.
251  virtual StringRef description() = 0;
252 
253  /// Stream on which to output reproducer.
254  virtual raw_ostream &os() = 0;
255  };
256 
257  /// Method type for constructing ReproducerStream.
259  std::function<std::unique_ptr<ReproducerStream>(std::string &error)>;
260 
261  /// Enable support for the pass manager to generate a reproducer on the event
262  /// of a crash or a pass failure. `factory` is used to construct the streams
263  /// to write the generated reproducer to. If `genLocalReproducer` is true, the
264  /// pass manager will attempt to generate a local reproducer that contains the
265  /// smallest pipeline.
267  bool genLocalReproducer = false);
268 
269  /// Runs the verifier after each individual pass.
270  void enableVerifier(bool enabled = true);
271 
272  //===--------------------------------------------------------------------===//
273  // Instrumentations
274  //===--------------------------------------------------------------------===//
275 
276  /// Add the provided instrumentation to the pass manager.
277  void addInstrumentation(std::unique_ptr<PassInstrumentation> pi);
278 
279  //===--------------------------------------------------------------------===//
280  // IR Printing
281 
282  /// A configuration struct provided to the IR printer instrumentation.
284  public:
285  using PrintCallbackFn = function_ref<void(raw_ostream &)>;
286 
287  /// Initialize the configuration.
288  /// * 'printModuleScope' signals if the top-level module IR should always be
289  /// printed. This should only be set to true when multi-threading is
290  /// disabled, otherwise we may try to print IR that is being modified
291  /// asynchronously.
292  /// * 'printAfterOnlyOnChange' signals that when printing the IR after a
293  /// pass, in the case of a non-failure, we should first check if any
294  /// potential mutations were made. This allows for reducing the number of
295  /// logs that don't contain meaningful changes.
296  /// * 'printAfterOnlyOnFailure' signals that when printing the IR after a
297  /// pass, we only print in the case of a failure.
298  /// - This option should *not* be used with the other `printAfter` flags
299  /// above.
300  /// * 'opPrintingFlags' sets up the printing flags to use when printing the
301  /// IR.
302  explicit IRPrinterConfig(
303  bool printModuleScope = false, bool printAfterOnlyOnChange = false,
304  bool printAfterOnlyOnFailure = false,
305  OpPrintingFlags opPrintingFlags = OpPrintingFlags());
306  virtual ~IRPrinterConfig();
307 
308  /// A hook that may be overridden by a derived config that checks if the IR
309  /// of 'operation' should be dumped *before* the pass 'pass' has been
310  /// executed. If the IR should be dumped, 'printCallback' should be invoked
311  /// with the stream to dump into.
312  virtual void printBeforeIfEnabled(Pass *pass, Operation *operation,
313  PrintCallbackFn printCallback);
314 
315  /// A hook that may be overridden by a derived config that checks if the IR
316  /// of 'operation' should be dumped *after* the pass 'pass' has been
317  /// executed. If the IR should be dumped, 'printCallback' should be invoked
318  /// with the stream to dump into.
319  virtual void printAfterIfEnabled(Pass *pass, Operation *operation,
320  PrintCallbackFn printCallback);
321 
322  /// Returns true if the IR should always be printed at the top-level scope.
323  bool shouldPrintAtModuleScope() const { return printModuleScope; }
324 
325  /// Returns true if the IR should only printed after a pass if the IR
326  /// "changed".
327  bool shouldPrintAfterOnlyOnChange() const { return printAfterOnlyOnChange; }
328 
329  /// Returns true if the IR should only printed after a pass if the pass
330  /// "failed".
332  return printAfterOnlyOnFailure;
333  }
334 
335  /// Returns the printing flags to be used to print the IR.
336  OpPrintingFlags getOpPrintingFlags() const { return opPrintingFlags; }
337 
338  private:
339  /// A flag that indicates if the IR should be printed at module scope.
340  bool printModuleScope;
341 
342  /// A flag that indicates that the IR after a pass should only be printed if
343  /// a change is detected.
344  bool printAfterOnlyOnChange;
345 
346  /// A flag that indicates that the IR after a pass should only be printed if
347  /// the pass failed.
348  bool printAfterOnlyOnFailure;
349 
350  /// Flags to control printing behavior.
351  OpPrintingFlags opPrintingFlags;
352  };
353 
354  /// Add an instrumentation to print the IR before and after pass execution,
355  /// using the provided configuration.
356  void enableIRPrinting(std::unique_ptr<IRPrinterConfig> config);
357 
358  /// Add an instrumentation to print the IR before and after pass execution,
359  /// using the provided fields to generate a default configuration:
360  /// * 'shouldPrintBeforePass' and 'shouldPrintAfterPass' correspond to filter
361  /// functions that take a 'Pass *' and `Operation *`. These function should
362  /// return true if the IR should be printed or not.
363  /// * 'printModuleScope' signals if the module IR should be printed, even
364  /// for non module passes.
365  /// * 'printAfterOnlyOnChange' signals that when printing the IR after a
366  /// pass, in the case of a non-failure, we should first check if any
367  /// potential mutations were made.
368  /// * 'printAfterOnlyOnFailure' signals that when printing the IR after a
369  /// pass, we only print in the case of a failure.
370  /// - This option should *not* be used with the other `printAfter` flags
371  /// above.
372  /// * 'out' corresponds to the stream to output the printed IR to.
373  /// * 'opPrintingFlags' sets up the printing flags to use when printing the
374  /// IR.
375  void enableIRPrinting(
376  std::function<bool(Pass *, Operation *)> shouldPrintBeforePass =
377  [](Pass *, Operation *) { return true; },
378  std::function<bool(Pass *, Operation *)> shouldPrintAfterPass =
379  [](Pass *, Operation *) { return true; },
380  bool printModuleScope = true, bool printAfterOnlyOnChange = true,
381  bool printAfterOnlyOnFailure = false, raw_ostream &out = llvm::errs(),
382  OpPrintingFlags opPrintingFlags = OpPrintingFlags());
383 
384  //===--------------------------------------------------------------------===//
385  // Pass Timing
386 
387  /// Add an instrumentation to time the execution of passes and the computation
388  /// of analyses. Timing will be reported by nesting timers into the provided
389  /// `timingScope`.
390  ///
391  /// Note: Timing should be enabled after all other instrumentations to avoid
392  /// any potential "ghost" timing from other instrumentations being
393  /// unintentionally included in the timing results.
394  void enableTiming(TimingScope &timingScope);
395 
396  /// Add an instrumentation to time the execution of passes and the computation
397  /// of analyses. The pass manager will take ownership of the timing manager
398  /// passed to the function and timing will be reported by nesting timers into
399  /// the timing manager's root scope.
400  ///
401  /// Note: Timing should be enabled after all other instrumentations to avoid
402  /// any potential "ghost" timing from other instrumentations being
403  /// unintentionally included in the timing results.
404  void enableTiming(std::unique_ptr<TimingManager> tm);
405 
406  /// Add an instrumentation to time the execution of passes and the computation
407  /// of analyses. Creates a temporary TimingManager owned by this PassManager
408  /// which will be used to report timing.
409  ///
410  /// Note: Timing should be enabled after all other instrumentations to avoid
411  /// any potential "ghost" timing from other instrumentations being
412  /// unintentionally included in the timing results.
413  void enableTiming();
414 
415  //===--------------------------------------------------------------------===//
416  // Pass Statistics
417 
418  /// Prompts the pass manager to print the statistics collected for each of the
419  /// held passes after each call to 'run'.
420  void
422 
423 private:
424  /// Dump the statistics of the passes within this pass manager.
425  void dumpStatistics();
426 
427  /// Run the pass manager with crash recovery enabled.
428  LogicalResult runWithCrashRecovery(Operation *op, AnalysisManager am);
429 
430  /// Run the passes of the pass manager, and return the result.
431  LogicalResult runPasses(Operation *op, AnalysisManager am);
432 
433  /// Context this PassManager was initialized with.
434  MLIRContext *context;
435 
436  /// Flag that specifies if pass statistics should be dumped.
437  std::optional<PassDisplayMode> passStatisticsMode;
438 
439  /// A manager for pass instrumentations.
440  std::unique_ptr<PassInstrumentor> instrumentor;
441 
442  /// An optional crash reproducer generator, if this pass manager is setup to
443  /// generate reproducers.
444  std::unique_ptr<detail::PassCrashReproducerGenerator> crashReproGenerator;
445 
446  /// A hash key used to detect when reinitialization is necessary.
447  llvm::hash_code initializationKey =
448  DenseMapInfo<llvm::hash_code>::getTombstoneKey();
449 
450  /// Flag that specifies if pass timing is enabled.
451  bool passTiming : 1;
452 
453  /// A flag that indicates if the IR should be verified in between passes.
454  bool verifyPasses : 1;
455 };
456 
457 /// Register a set of useful command-line options that can be used to configure
458 /// a pass manager. The values of these options can be applied via the
459 /// 'applyPassManagerCLOptions' method below.
461 
462 /// Apply any values provided to the pass manager options that were registered
463 /// with 'registerPassManagerOptions'.
464 void applyPassManagerCLOptions(PassManager &pm);
465 
466 /// Apply any values provided to the timing manager options that were registered
467 /// with `registerDefaultTimingManagerOptions`. This is a handy helper function
468 /// if you do not want to bother creating your own timing manager and passing it
469 /// to the pass manager.
470 void applyDefaultTimingPassManagerCLOptions(PassManager &pm);
471 
472 } // namespace mlir
473 
474 #endif // MLIR_PASS_PASSMANAGER_H
The DialectRegistry maps a dialect namespace to a constructor for the matching dialect.
MLIRContext is the top-level object for a collection of MLIR operations.
Definition: MLIRContext.h:56
This class represents a pass manager that runs passes on either a specific operation type,...
Definition: PassManager.h:52
void mergeStatisticsInto(OpPassManager &other)
Merge the pass statistics of this class into 'other'.
OpPassManager & operator=(const OpPassManager &rhs)
Definition: Pass.cpp:299
friend class PassManager
Allow access to the constructor.
Definition: PassManager.h:186
OpPassManager(Nesting nesting=Nesting::Explicit)
Construct a new op-agnostic ("any") pass manager with the given operation type and nesting behavior.
Definition: Pass.cpp:291
OpPassManager & nest()
Definition: PassManager.h:103
iterator_range< const_pass_iterator > getPasses() const
Definition: PassManager.h:91
void printAsTextualPipeline(raw_ostream &os) const
Prints out the passes of the pass manager as the textual representation of pipelines.
Definition: Pass.cpp:365
friend class Pass
Definition: PassManager.h:187
void setNesting(Nesting nesting)
Enable or disable the implicit nesting on this particular PassManager.
Definition: Pass.cpp:392
bool empty() const
Returns true if the pass manager has no passes.
Definition: PassManager.h:96
size_t size() const
Returns the number of passes held by this manager.
Definition: Pass.cpp:343
detail::OpPassManagerImpl & getImpl()
Returns the internal implementation instance.
Definition: Pass.cpp:346
void addPass(std::unique_ptr< Pass > pass)
Add the given pass to this pass manager.
Definition: Pass.cpp:336
Nesting getNesting()
Return the current nesting mode.
Definition: Pass.cpp:394
Nesting
This enum represents the nesting behavior of the pass manager.
Definition: PassManager.h:55
@ Implicit
Implicit nesting behavior.
@ Explicit
Explicit nesting behavior.
void dump()
Raw dump of the pass manager to llvm::errs().
Definition: Pass.cpp:376
llvm::pointee_iterator< MutableArrayRef< std::unique_ptr< Pass > >::iterator > pass_iterator
Iterator over the passes in this pass manager.
Definition: PassManager.h:82
llvm::pointee_iterator< ArrayRef< std::unique_ptr< Pass > >::const_iterator > const_pass_iterator
Definition: PassManager.h:88
void addNestedPass(std::unique_ptr< Pass > pass)
Add the given pass to a nested pass manager for the given operation kind OpT.
Definition: PassManager.h:121
void getDependentDialects(DialectRegistry &dialects) const
Register dependent dialects for the current pass manager.
Definition: Pass.cpp:388
StringRef getOpAnchorName() const
Return the name used to anchor this pass manager.
Definition: Pass.cpp:359
std::optional< StringRef > getOpName() const
Return the operation name that this pass manager operates on, or std::nullopt if this is an op-agnost...
Definition: Pass.cpp:349
OpPassManager & nestAny()
Nest a new op-agnostic ("any") pass manager under this pass manager.
Definition: Pass.cpp:332
iterator_range< pass_iterator > getPasses()
Definition: PassManager.h:85
static StringRef getAnyOpAnchorName()
Return the string name used to anchor op-agnostic pass managers that operate generically on any viabl...
Definition: PassManager.h:143
void clear()
Clear the pipeline, but not the other options set on this OpPassManager.
Definition: Pass.cpp:340
pass_iterator begin()
Definition: Pass.cpp:310
pass_iterator end()
Definition: Pass.cpp:313
Set of flags used to control the behavior of the various IR print methods (e.g.
Operation is the basic unit of execution within MLIR.
Definition: Operation.h:75
A configuration struct provided to the IR printer instrumentation.
Definition: PassManager.h:283
IRPrinterConfig(bool printModuleScope=false, bool printAfterOnlyOnChange=false, bool printAfterOnlyOnFailure=false, OpPrintingFlags opPrintingFlags=OpPrintingFlags())
Initialize the configuration.
Definition: IRPrinting.cpp:132
bool shouldPrintAfterOnlyOnFailure() const
Returns true if the IR should only printed after a pass if the pass "failed".
Definition: PassManager.h:331
virtual void printBeforeIfEnabled(Pass *pass, Operation *operation, PrintCallbackFn printCallback)
A hook that may be overridden by a derived config that checks if the IR of 'operation' should be dump...
Definition: IRPrinting.cpp:146
bool shouldPrintAtModuleScope() const
Returns true if the IR should always be printed at the top-level scope.
Definition: PassManager.h:323
virtual void printAfterIfEnabled(Pass *pass, Operation *operation, PrintCallbackFn printCallback)
A hook that may be overridden by a derived config that checks if the IR of 'operation' should be dump...
Definition: IRPrinting.cpp:155
OpPrintingFlags getOpPrintingFlags() const
Returns the printing flags to be used to print the IR.
Definition: PassManager.h:336
bool shouldPrintAfterOnlyOnChange() const
Returns true if the IR should only printed after a pass if the IR "changed".
Definition: PassManager.h:327
The main pass manager and pipeline builder.
Definition: PassManager.h:211
void enableStatistics(PassDisplayMode displayMode=PassDisplayMode::Pipeline)
Prompts the pass manager to print the statistics collected for each of the held passes after each cal...
MLIRContext * getContext() const
Return an instance of the context.
Definition: PassManager.h:236
void enableTiming()
Add an instrumentation to time the execution of passes and the computation of analyses.
Definition: PassTiming.cpp:164
void enableIRPrinting(std::unique_ptr< IRPrinterConfig > config)
Add an instrumentation to print the IR before and after pass execution, using the provided configurat...
Definition: IRPrinting.cpp:204
LogicalResult run(Operation *op)
Run the passes within this manager on the provided operation.
Definition: Pass.cpp:787
static PassManager on(MLIRContext *ctx, Nesting nesting=Nesting::Explicit)
Create a new pass manager under the given context with a specific nesting style.
Definition: PassManager.h:226
void addInstrumentation(std::unique_ptr< PassInstrumentation > pi)
Add the provided instrumentation to the pass manager.
Definition: Pass.cpp:835
std::function< std::unique_ptr< ReproducerStream >(std::string &error)> ReproducerStreamFactory
Method type for constructing ReproducerStream.
Definition: PassManager.h:259
void enableCrashReproducerGeneration(StringRef outputFile, bool genLocalReproducer=false)
Enable support for the pass manager to generate a reproducer on the event of a crash or a pass failur...
void enableVerifier(bool enabled=true)
Runs the verifier after each individual pass.
Definition: Pass.cpp:784
The abstract base pass class.
Definition: Pass.h:51
An adaptor pass used to run operation passes over nested operations.
Definition: PassDetail.h:23
Include the generated interface declarations.
Definition: CallGraph.h:229
Include the generated interface declarations.
void applyPassManagerCLOptions(PassManager &pm)
Apply any values provided to the pass manager options that were registered with 'registerPassManagerO...
void registerPassManagerCLOptions()
Register a set of useful command-line options that can be used to configure a pass manager.
PassDisplayMode
An enum describing the different display modes for the information within the pass manager.
Definition: PassManager.h:199
void applyDefaultTimingPassManagerCLOptions(PassManager &pm)
Apply any values provided to the timing manager options that were registered with registerDefaultTimi...
This class represents an efficient way to signal success or failure.
Definition: LogicalResult.h:26
Streams on which to output crash reproducer.
Definition: PassManager.h:247
virtual raw_ostream & os()=0
Stream on which to output reproducer.
virtual StringRef description()=0
Description of the reproducer stream.