message: Use explicit dialect registration in mlir_graph_optimization_pass.cc (NFC)
diff: @@ -91,16 +91,14 @@ MlirOptimizationPassRegistry& MlirOptimizationPassRegistry::Global() {
  return *global;
  }
  -static void RegisterDialects() {
  - static bool init_once = []() {
  - mlir::registerDialect<mlir::StandardOpsDialect>();
  - mlir::registerDialect<mlir::TF::TensorFlowDialect>();
  - mlir::registerDialect<mlir::shape::ShapeDialect>();
  - mlir::registerDialect<mlir::tf_device::TensorFlowDeviceDialect>();
  - mlir::registerDialect<mlir::tf_executor::TensorFlowExecutorDialect>();
  - return true;
  - }();
  - (void)init_once;
  +static void RegisterDialects(mlir::DialectRegistry& registry) {
  + // clang-format off
  + registry.insert<mlir::StandardOpsDialect,
  + mlir::TF::TensorFlowDialect,
  + mlir::shape::ShapeDialect,
  + mlir::tf_device::TensorFlowDeviceDialect,
  + mlir::tf_executor::TensorFlowExecutorDialect>();
  + // clang-format on
  }
  Status MlirFunctionOptimizationPass::Run(
  @@ -126,9 +124,8 @@ Status MlirFunctionOptimizationPass::Run(
  << " passes)";
  GraphDebugInfo debug_info;
  - RegisterDialects();
  mlir::MLIRContext context;
  - context.loadAllGloballyRegisteredDialects();
  + RegisterDialects(context.getDialectRegistry());
  GraphImportConfig import_config;
  import_config.graph_as_function = true;
  import_config.control_outputs = *control_ret_node_names;
  @@ -207,9 +204,8 @@ Status MlirV1CompatGraphOptimizationPass::Run(
  << " passes)";
  GraphDebugInfo debug_info;
  - RegisterDialects();
  mlir::MLIRContext context;
  - context.loadAllGloballyRegisteredDialects();
  + RegisterDialects(context.getDialectRegistry());
  GraphImportConfig import_config;
  import_config.upgrade_legacy = true;
  // Restrict functionalization to TPU nodes to avoid problems in v1 session
  