[Mlir-commits] [mlir] [MLIR][Python] Add effect and speculatability specifiers for Python-defined ops (PR #216773)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Aug 17 10:02: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/python/mlir/dialects/ext.py mlir/test/python/dialects/ext.py mlir/test/python/ir/memory_effects_op_interface.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
--- test/python/dialects/ext.py 2026-08-17 15:33:33.000000 +0000
+++ test/python/dialects/ext.py 2026-08-17 17:02:08.261598 +0000
@@ -1073,13 +1073,11 @@
AlwaysSpeculatableOp()
assert module.operation.verify()
no_effect_iface = ir.MemoryEffectsOpInterface(no_effect)
- always_speculatable_iface = ir.ConditionallySpeculatable(
- always_speculatable
- )
+ always_speculatable_iface = ir.ConditionallySpeculatable(always_speculatable)
recursively_speculatable_iface = ir.ConditionallySpeculatable(
recursively_speculatable
)
# CHECK: public no memory effects: 0
@@ -1147,12 +1145,11 @@
# CHECK: pure memory effects: 0
print("pure memory effects:", len(pure_memory_iface.get_effects()))
# CHECK: pure speculatable: True
print(
"pure speculatable:",
- pure_spec_iface.getSpeculatability()
- == ir.Speculatability.Speculatable,
+ pure_spec_iface.getSpeculatability() == ir.Speculatability.Speculatable,
)
patterns = RewritePatternSet()
apply_patterns_and_fold_greedily(module, patterns.freeze())
# CHECK: module {
``````````
</details>
https://github.com/llvm/llvm-project/pull/216773
More information about the Mlir-commits
mailing list