[Mlir-commits] [mlir] [mlir] Skip the promised-interface lookup for an emptied dialect set (NFC) (PR #219545)

David Blaikie llvmlistbot at llvm.org
Tue Sep 1 09:01:55 PDT 2026


================
@@ -228,6 +228,9 @@ class Dialect {
   void handleUseOfUndefinedPromisedInterface(TypeID interfaceRequestorID,
                                              TypeID interfaceID,
                                              StringRef interfaceName = "") {
+    // Most dialects promise nothing; skip hashing a key and probing the set.
+    if (unresolvedPromisedInterfaces.empty())
+      return;
     if (unresolvedPromisedInterfaces.count(
----------------
dwblaikie wrote:

Changing from NumBuckets to NumEntries seems like a simple enough win - in both cases it's accessing a single member, it's just that NumEntries is a tighter bound on the requirement. I'd accept a patch to switch the numBuckets check to a numEntries check.

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


More information about the Mlir-commits mailing list