diff --git a/mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h b/mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h --- a/mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h +++ b/mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h @@ -122,15 +122,6 @@ return success(); } - // Deprecated. - MlirOptMainConfig &preloadDialectsInContext(bool preload) { - preloadDialectsInContextFlag = preload; - return *this; - } - bool shouldPreloadDialectsInContext() const { - return preloadDialectsInContextFlag; - } - /// Show the registered dialects before trying to load the input file. MlirOptMainConfig &showDialects(bool show) { showDialectsFlag = show; @@ -192,9 +183,6 @@ /// The callback to populate the pass manager. std::function passPipelineCallback; - /// Deprecated. - bool preloadDialectsInContextFlag = false; - /// Show the registered dialects before trying to load the input file. bool showDialectsFlag = false; @@ -231,12 +219,8 @@ /// Implementation for tools like `mlir-opt`. /// - toolName is used for the header displayed by `--help`. /// - registry should contain all the dialects that can be parsed in the source. -/// - preloadDialectsInContext will trigger the upfront loading of all -/// dialects from the global registry in the MLIRContext. This option is -/// deprecated and will be removed soon. LogicalResult MlirOptMain(int argc, char **argv, llvm::StringRef toolName, - DialectRegistry ®istry, - bool preloadDialectsInContext = false); + DialectRegistry ®istry); /// Helper wrapper to return the result of MlirOptMain directly from main. /// diff --git a/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp b/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp --- a/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp +++ b/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp @@ -366,8 +366,6 @@ return failure(); // Parse the input file. - if (config.shouldPreloadDialectsInContext()) - context.loadAllAvailableDialects(); context.allowUnregisteredDialects(config.shouldAllowUnregisteredDialects()); if (config.shouldVerifyDiagnostics()) context.printOpOnDiagnostic(false); @@ -428,8 +426,7 @@ } LogicalResult mlir::MlirOptMain(int argc, char **argv, llvm::StringRef toolName, - DialectRegistry ®istry, - bool preloadDialectsInContext) { + DialectRegistry ®istry) { static cl::opt inputFilename( cl::Positional, cl::desc(""), cl::init("-")); @@ -457,7 +454,6 @@ // Parse pass names in main to ensure static initialization completed. cl::ParseCommandLineOptions(argc, argv, helpHeader); MlirOptMainConfig config = MlirOptMainConfig::createFromCLOptions(); - config.preloadDialectsInContext(preloadDialectsInContext); // When reading from stdin and the input is a tty, it is often a user mistake // and the process "appears to be stuck". Print a message to let the user know diff --git a/mlir/tools/mlir-opt/mlir-opt.cpp b/mlir/tools/mlir-opt/mlir-opt.cpp --- a/mlir/tools/mlir-opt/mlir-opt.cpp +++ b/mlir/tools/mlir-opt/mlir-opt.cpp @@ -261,6 +261,5 @@ ::test::registerTestDynDialect(registry); #endif return mlir::asMainReturnCode( - mlir::MlirOptMain(argc, argv, "MLIR modular optimizer driver\n", registry, - /*preloadDialectsInContext=*/false)); + mlir::MlirOptMain(argc, argv, "MLIR modular optimizer driver\n", registry)); }