[Mlir-commits] [mlir] [mlir] Make MemoryEffectsOpInterface optional. (PR #187427)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Thu Mar 19 12:56:41 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/dialects/memory_effects_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
--- memory_effects_interface.py 2026-03-19 19:54:15.000000 +0000
+++ memory_effects_interface.py 2026-03-19 19:56:13.257991 +0000
@@ -43,13 +43,11 @@
def test_known_no_effects():
"""When 'effects' attribute is present, hasKnownMemoryEffects returns true
and the interface is active."""
with ir.Context() as ctx, ir.Location.unknown():
TestMemEffectsDialect.load(reload=True)
- OptionalMemoryEffectsModel.attach(
- OptionalEffectsOp.OPERATION_NAME, context=ctx
- )
+ OptionalMemoryEffectsModel.attach(OptionalEffectsOp.OPERATION_NAME, context=ctx)
module = ir.Module.create()
with ir.InsertionPoint(module.body):
op = ir.Operation.create("test_mem_effects.optional_effects")
op.attributes["effects"] = ir.UnitAttr.get()
@@ -63,13 +61,11 @@
def test_unknown_effects():
"""When 'effects' attribute is absent, hasKnownMemoryEffects returns false
and the interface is not active (the op pretends not to implement it)."""
with ir.Context() as ctx, ir.Location.unknown():
TestMemEffectsDialect.load(reload=True)
- OptionalMemoryEffectsModel.attach(
- OptionalEffectsOp.OPERATION_NAME, context=ctx
- )
+ OptionalMemoryEffectsModel.attach(OptionalEffectsOp.OPERATION_NAME, context=ctx)
module = ir.Module.create()
with ir.InsertionPoint(module.body):
op = ir.Operation.create("test_mem_effects.optional_effects")
``````````
</details>
https://github.com/llvm/llvm-project/pull/187427
More information about the Mlir-commits
mailing list