diff --git a/flang/tools/fir-opt/fir-opt.cpp b/flang/tools/fir-opt/fir-opt.cpp --- a/flang/tools/fir-opt/fir-opt.cpp +++ b/flang/tools/fir-opt/fir-opt.cpp @@ -35,5 +35,5 @@ DialectRegistry registry; fir::support::registerDialects(registry); return failed(MlirOptMain(argc, argv, "FIR modular optimizer driver\n", - registry, /*preloadDialectsInContext=*/false)); + registry)); } 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 @@ -107,15 +107,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; @@ -180,9 +171,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; @@ -219,12 +207,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 @@ -300,8 +300,6 @@ return failure(); // Parse the input file. - if (config.shouldPreloadDialectsInContext()) - context.loadAllAvailableDialects(); context.allowUnregisteredDialects(config.shouldAllowUnregisteredDialects()); if (config.shouldVerifyDiagnostics()) context.printOpOnDiagnostic(false); @@ -363,8 +361,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("-")); @@ -392,7 +389,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)); }