[Mlir-commits] [mlir] [mlir][python] automatically bundle builtin dialect with core sources (PR #72338)

Maksim Levental llvmlistbot at llvm.org
Tue Nov 14 20:19:32 PST 2023


makslevental wrote:

> Ok. I vote for leaving it as is. It might just be my itchiness about crossing different things in the same name grouping. I don't feel strongly about it.

I buy that but `builtin` is special isn't it? Another alternative is 

```diff
diff --git a/mlir/lib/Bindings/Python/Globals.h b/mlir/lib/Bindings/Python/Globals.h
index a022067f5c7e..b16bf4fd3c46 100644
--- a/mlir/lib/Bindings/Python/Globals.h
+++ b/mlir/lib/Bindings/Python/Globals.h
@@ -124,7 +124,7 @@ private:
   llvm::DenseMap<MlirTypeID, pybind11::object> valueCasterMap;
   /// Set of dialect namespaces that we have attempted to import implementation
   /// modules for.
-  llvm::StringSet<> loadedDialectModules;
+  llvm::StringSet<> loadedDialectModules{"builtin"};
 };
 
 } // namespace python
```

which solves the problem (the check will pass - no early exit) and everything will work, except the `OpView`s generated for `builtin` (`ModuleOp`, `UnrealizedConversionCastOp`) won't be registered. Not a good solution I think...

https://github.com/llvm/llvm-project/pull/72338


More information about the Mlir-commits mailing list