[Mlir-commits] [flang] [mlir] [mlir] Support DialectRegistry extension comparison (PR #101119)

Nikhil Kalra llvmlistbot at llvm.org
Thu Aug 1 08:47:14 PDT 2024


================
@@ -255,7 +256,9 @@ class DialectRegistry {
 
 private:
   MapTy registry;
-  std::vector<std::unique_ptr<DialectExtensionBase>> extensions;
+  using KeyExtensionPair =
+      std::pair<TypeID, std::unique_ptr<DialectExtensionBase>>;
+  llvm::SmallVector<KeyExtensionPair> extensions;
----------------
nikalra wrote:

If the overall theme of this change looks good, I'd like to also convert this into a `DenseMap` so we always de-duplicate by key (instead of doing that implicitly in code paths that call `isSubset`).

It'll make `applyExtensions` slightly less efficient since we'll have to track changes in case additional extensions are registered when applying the existing extensions set, but I think the code clarity would probably be worth it.

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


More information about the Mlir-commits mailing list