[all-commits] [llvm/llvm-project] 7c2c06: [MLIR][Python] Add `ConditionallySpeculatable` int...

Twice via All-commits all-commits at lists.llvm.org
Mon May 4 20:22:54 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7c2c06ccfcfd4b7fecbb8fe5e7a4ec0c2eb6645c
      https://github.com/llvm/llvm-project/commit/7c2c06ccfcfd4b7fecbb8fe5e7a4ec0c2eb6645c
  Author: Twice <twice at apache.org>
  Date:   2026-05-05 (Tue, 05 May 2026)

  Changed paths:
    M mlir/include/mlir-c/Interfaces.h
    M mlir/lib/Bindings/Python/IRInterfaces.cpp
    M mlir/lib/CAPI/Interfaces/Interfaces.cpp
    M mlir/python/mlir/dialects/ext.py
    M mlir/test/CAPI/CMakeLists.txt
    M mlir/test/CAPI/ir.c
    M mlir/test/python/dialects/ext.py

  Log Message:
  -----------
  [MLIR][Python] Add `ConditionallySpeculatable` interface and `Pure` specifier (#195505)

This PR brings two features: the `ConditionallySpeculatable` op
interface and the `Pure` specifier for Python-defined ops.

The result is that you can mark an op as pure like:
```python
class PureOp(
    TestPure.Operation,
    name="pure",
    traits=[Pure]  # just like in the ODS!
):
    a: Operand[IntegerType[32]]
    b: Operand[IntegerType[32]]
    res: Result[IntegerType[32]] = infer_result()
```

Then this op is both `NoMemoryEffect` and `AlwaysSpeculatable`.

Assisted-by: Copilot/GPT5.4



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list