[Mlir-commits] [mlir] [mlir] Expose type and attribute names in the MLIRContext and abstract type/attr classes (PR #72189)

Mehdi Amini llvmlistbot at llvm.org
Fri Nov 17 22:58:45 PST 2023


================
@@ -212,6 +212,9 @@ class MLIRContextImpl {
   DenseMap<TypeID, AbstractType *> registeredTypes;
   StorageUniquer typeUniquer;
 
+  /// This is a mapping from type name to the abstract type describing it.
+  llvm::StringMap<AbstractType *> nameToType;
----------------
joker-eph wrote:

Can we use `DenseMap<StringAttr, AbstractType *> nameToType;` (more efficient storage, and more efficient lookup)?

Also when is it useful? (please add to the comment: the "what" is less important than the "why").

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


More information about the Mlir-commits mailing list