[Mlir-commits] [mlir] [mlir] Fix comparisons of extensible dialects (PR #186637)

Krzysztof Drewniak llvmlistbot at llvm.org
Sat Mar 14 20:13:57 PDT 2026


https://github.com/krzysz00 created https://github.com/llvm/llvm-project/pull/186637

The extensible dialect system defined `compareProperties` to false because it doesn't use properties. However, this should have been `true`, as the empty properties are trivially always equal to themselves. Doing otherwise means that no operations in extensible dialects that aren't the exact same operation will ever compare equal for the purposes of operations like CSE.

>From 4ef1aea81fac80061878f1bc3348fdbbb69fc5df Mon Sep 17 00:00:00 2001
From: Krzysztof Drewniak <krzysdrewniak at gmail.com>
Date: Sat, 14 Mar 2026 20:10:31 -0700
Subject: [PATCH] [mlir] Fix comparisons of extensible dialects

The extensible dialect system defined `compareProperties` to false
because it doesn't use properties. However, this should have been
`true`, as the empty properties are trivially always equal to
themselves. Doing otherwise means that no operations in extensible
dialects that aren't the exact same operation will ever compare equal
for the purposes of operations like CSE.
---
 mlir/include/mlir/IR/ExtensibleDialect.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mlir/include/mlir/IR/ExtensibleDialect.h b/mlir/include/mlir/IR/ExtensibleDialect.h
index e52306f79378a..dcbf6813506d5 100644
--- a/mlir/include/mlir/IR/ExtensibleDialect.h
+++ b/mlir/include/mlir/IR/ExtensibleDialect.h
@@ -566,7 +566,7 @@ class DynamicOpDefinition : public OperationName::Impl {
   Attribute getPropertiesAsAttr(Operation *op) final { return {}; }
   void copyProperties(OpaqueProperties lhs, OpaqueProperties rhs) final {}
   bool compareProperties(OpaqueProperties, OpaqueProperties) final {
-    return false;
+    return true;
   }
   llvm::hash_code hashProperties(OpaqueProperties prop) final { return {}; }
 



More information about the Mlir-commits mailing list