[Mlir-commits] [mlir] [MLIR][Python] Support IsIsolatedFromAbove trait for python-defined operations (PR #211849)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Jul 24 20:36:11 PDT 2026
PragmaTwice wrote:
> are these traits bound such that I can query traits on non-dynamic dialects and get these to pop out too?
Yes.
In the Python side, `op.has_trait(..)` supports all dialects (C++ defined and Python defined), e.g. `vector_yield_op.has_trait(IsTerminatorTrait)` returns `True`.
In the C++ side, `op->hasTrait<T>()` also supports all dialects (C++ defined and Python defined), e.g. for `class MyOp(.., traits=[IsTerminatorTrait])` in Python, if the op is handled in a C++ pass, `op->hasTrait<IsTerminator>()` will return `true`.
https://github.com/llvm/llvm-project/pull/211849
More information about the Mlir-commits
mailing list