[Mlir-commits] [mlir] [mlir][python] value casting (PR #69644)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Tue Oct 31 02:48:51 PDT 2023


================
@@ -116,6 +127,11 @@ class PyGlobals {
   /// Cache for map of MlirTypeID to custom type caster.
   llvm::DenseMap<MlirTypeID, pybind11::object> typeCasterMapCache;
 
+  /// Map of MlirTypeID to custom value caster.
+  llvm::DenseMap<MlirTypeID, pybind11::object> valueCasterMap;
+  /// Cache for map of MlirTypeID to custom value caster.
----------------
ftynse wrote:

Nit: could you please document more how this cache works and why it improves efficiency? At a glance, the type is exactly the same as `valueCasterMap` so the rationale for having it is unclear.

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


More information about the Mlir-commits mailing list