[Mlir-commits] [mlir] [mlir] Fix op comparisons in extensible dialects (PR #186637)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Sat Mar 14 20:14:29 PDT 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir
Author: Krzysztof Drewniak (krzysz00)
<details>
<summary>Changes</summary>
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.
---
Full diff: https://github.com/llvm/llvm-project/pull/186637.diff
1 Files Affected:
- (modified) mlir/include/mlir/IR/ExtensibleDialect.h (+1-1)
``````````diff
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 {}; }
``````````
</details>
https://github.com/llvm/llvm-project/pull/186637
More information about the Mlir-commits
mailing list