[Mlir-commits] [mlir] [mlir][python] remove various caching mechanism (PR #70831)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Thu Nov 2 02:42:04 PDT 2023


================
@@ -3,7 +3,13 @@
 import gc
 import io
 import itertools
+import sys
+
 from mlir.ir import *
+from mlir.dialects._ods_common import _cext
+
+sys.path.append(".")
+_cext.globals.append_dialect_search_prefix("custom_dialect")
----------------
ftynse wrote:

I suppose this piggy-backs on the test logic below that creates an operation with "custom" dialect namespace, that is supposed to somehow trigger the dialect loading? It's not obvious from the test what would happen if loading doesn't happen, and how to fix it, so I'd much rather have a separate test for the loading mechanism itself. We can add `_private` methods to `PyGlobals` class for testing purposes, there is precedent. Such a method can, for example, tell you if a dialect prefix is present in the set of loaded dialects.

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


More information about the Mlir-commits mailing list