[Mlir-commits] [mlir] Add Python bindings for operation structural equivalence and hashing (PR #216357)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Aug 14 09:59:39 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {darker}-->


:warning: Python code formatter, darker found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
darker --check --diff -r origin/main...HEAD mlir/test/python/ir/operation.py
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from darker here.
</summary>

``````````diff
--- operation.py	2026-08-13 21:48:15.000000 +0000
+++ operation.py	2026-08-14 16:59:09.419352 +0000
@@ -1267,13 +1267,11 @@
         assert c42a.is_structurally_equivalent(c42a, ignore_locations)
         assert sub3.is_structurally_equivalent(sub4, ignore_locations)
         assert not sub3.is_structurally_equivalent(sub5, ignore_locations)
         assert not c42a.is_structurally_equivalent(sub3, ignore_locations)
 
-        discardable_flags = (
-            ignore_locations | flags.IGNORE_DISCARDABLE_ATTRS
-        )
+        discardable_flags = ignore_locations | flags.IGNORE_DISCARDABLE_ATTRS
         assert not sub3.is_structurally_equivalent(sub6, ignore_locations)
         assert sub3.is_structurally_equivalent(sub6, discardable_flags)
 
         assert add7.is_structurally_equivalent(add8, ignore_locations)
         assert not add7.is_structurally_equivalent(

``````````

</details>


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


More information about the Mlir-commits mailing list