[Mlir-commits] [mlir] [mlir] Method to iterate over registered operations for a given dialect class. (PR #112344)

River Riddle llvmlistbot at llvm.org
Wed Oct 16 09:38:50 PDT 2024


================
@@ -188,7 +188,15 @@ class MLIRContextImpl {
 
   /// This is a sorted container of registered operations for a deterministic
   /// and efficient `getRegisteredOperations` implementation.
-  SmallVector<RegisteredOperationName, 0> sortedRegisteredOperations;
+  SmallVector<std::pair<StringRef, RegisteredOperationName>, 0>
+      sortedRegisteredOperations;
+
+  /// This stores the transformed operations when calling
+  /// `getRegisteredOperations`.
+  SmallVector<RegisteredOperationName, 0> transformedOperations;
+
+  /// This returns the number of registered operations for a given dialect.
+  llvm::DenseMap<StringRef, size_t> getCountByDialectName;
----------------
River707 wrote:

Why not have this stored in the dialect itself? That'd remove an extra map.

Also, nit: please drop the llvm:: (DenseMap is already exported in the mlir namespace).

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


More information about the Mlir-commits mailing list