Changeset View
Changeset View
Standalone View
Standalone View
mlir/include/mlir/Pass/PassManager.h
Show First 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | |||||
private: | private: | ||||
OpPassManager(OperationName name, bool disableThreads, bool verifyPasses); | OpPassManager(OperationName name, bool disableThreads, bool verifyPasses); | ||||
/// A pointer to an internal implementation instance. | /// A pointer to an internal implementation instance. | ||||
std::unique_ptr<detail::OpPassManagerImpl> impl; | std::unique_ptr<detail::OpPassManagerImpl> impl; | ||||
/// Allow access to the constructor. | /// Allow access to the constructor. | ||||
friend class PassManager; | friend class PassManager; | ||||
/// Allow access. | |||||
friend detail::OpPassManagerImpl; | |||||
}; | }; | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
// PassManager | // PassManager | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
/// An enum describing the different display modes for the information within | /// An enum describing the different display modes for the information within | ||||
/// the pass manager. | /// the pass manager. | ||||
Show All 23 Lines | public: | ||||
void disableMultithreading(bool disable = true); | void disableMultithreading(bool disable = true); | ||||
/// Return true if the pass manager is configured with multi-threading | /// Return true if the pass manager is configured with multi-threading | ||||
/// enabled. | /// enabled. | ||||
bool isMultithreadingEnabled(); | bool isMultithreadingEnabled(); | ||||
/// Enable support for the pass manager to generate a reproducer on the event | /// Enable support for the pass manager to generate a reproducer on the event | ||||
/// of a crash or a pass failure. `outputFile` is a .mlir filename used to | /// of a crash or a pass failure. `outputFile` is a .mlir filename used to | ||||
/// write the generated reproducer. | /// write the generated reproducer. If `genLocalReproducer` is true, the pass | ||||
void enableCrashReproducerGeneration(StringRef outputFile); | /// manager will attempt to generate a local reproducer that contains the | ||||
/// smallest pipeline. | |||||
void enableCrashReproducerGeneration(StringRef outputFile, | |||||
bool genLocalReproducer = false); | |||||
//===--------------------------------------------------------------------===// | //===--------------------------------------------------------------------===// | ||||
// Instrumentations | // Instrumentations | ||||
//===--------------------------------------------------------------------===// | //===--------------------------------------------------------------------===// | ||||
/// Add the provided instrumentation to the pass manager. | /// Add the provided instrumentation to the pass manager. | ||||
void addInstrumentation(std::unique_ptr<PassInstrumentation> pi); | void addInstrumentation(std::unique_ptr<PassInstrumentation> pi); | ||||
▲ Show 20 Lines • Show All 108 Lines • ▼ Show 20 Lines | public: | ||||
/// held passes after each call to 'run'. | /// held passes after each call to 'run'. | ||||
void | void | ||||
enableStatistics(PassDisplayMode displayMode = PassDisplayMode::Pipeline); | enableStatistics(PassDisplayMode displayMode = PassDisplayMode::Pipeline); | ||||
private: | private: | ||||
/// Dump the statistics of the passes within this pass manager. | /// Dump the statistics of the passes within this pass manager. | ||||
void dumpStatistics(); | void dumpStatistics(); | ||||
/// Flag that specifies if pass timing is enabled. | /// Run the pass manager with crash recover enabled. | ||||
bool passTiming : 1; | LogicalResult runWithCrashRecovery(ModuleOp module, AnalysisManager am); | ||||
/// Run the given passes with crash recover enabled. | |||||
LogicalResult | |||||
runWithCrashRecovery(MutableArrayRef<std::unique_ptr<Pass>> passes, | |||||
ModuleOp module, AnalysisManager am); | |||||
/// Flag that specifies if pass statistics should be dumped. | /// Flag that specifies if pass statistics should be dumped. | ||||
Optional<PassDisplayMode> passStatisticsMode; | Optional<PassDisplayMode> passStatisticsMode; | ||||
/// A manager for pass instrumentations. | /// A manager for pass instrumentations. | ||||
std::unique_ptr<PassInstrumentor> instrumentor; | std::unique_ptr<PassInstrumentor> instrumentor; | ||||
/// An optional filename to use when generating a crash reproducer if valid. | /// An optional filename to use when generating a crash reproducer if valid. | ||||
Optional<std::string> crashReproducerFileName; | Optional<std::string> crashReproducerFileName; | ||||
/// Flag that specifies if pass timing is enabled. | |||||
bool passTiming : 1; | |||||
/// Flag that specifies if the generated crash reproducer should be local. | |||||
bool localReproducer : 1; | |||||
}; | }; | ||||
/// Register a set of useful command-line options that can be used to configure | /// Register a set of useful command-line options that can be used to configure | ||||
/// a pass manager. The values of these options can be applied via the | /// a pass manager. The values of these options can be applied via the | ||||
/// 'applyPassManagerCLOptions' method below. | /// 'applyPassManagerCLOptions' method below. | ||||
void registerPassManagerCLOptions(); | void registerPassManagerCLOptions(); | ||||
/// Apply any values provided to the pass manager options that were registered | /// Apply any values provided to the pass manager options that were registered | ||||
/// with 'registerPassManagerOptions'. | /// with 'registerPassManagerOptions'. | ||||
void applyPassManagerCLOptions(PassManager &pm); | void applyPassManagerCLOptions(PassManager &pm); | ||||
} // end namespace mlir | } // end namespace mlir | ||||
#endif // MLIR_PASS_PASSMANAGER_H | #endif // MLIR_PASS_PASSMANAGER_H |