Skip to content

[mlir][python] expose operation.block #145088

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2025

Conversation

makslevental
Copy link
Contributor

Expose operation-getBlock() in python.

@makslevental makslevental changed the title [mlir][python] bind operation.block [mlir][python] expose operation.block Jun 20, 2025
@makslevental makslevental requested a review from jpienaar June 20, 2025 18:39
@llvmbot llvmbot added the mlir label Jun 20, 2025
@makslevental makslevental requested review from ftynse and rolfmorel June 20, 2025 18:40
@llvmbot
Copy link
Member

llvmbot commented Jun 20, 2025

@llvm/pr-subscribers-mlir

Author: Maksim Levental (makslevental)

Changes

Expose operation-getBlock() in python.


Full diff: https://github.com/llvm/llvm-project/pull/145088.diff

1 Files Affected:

  • (modified) mlir/lib/Bindings/Python/IRCore.cpp (+1)
diff --git a/mlir/lib/Bindings/Python/IRCore.cpp b/mlir/lib/Bindings/Python/IRCore.cpp
index b5720b7ad8b21..cbd35f2974ae9 100644
--- a/mlir/lib/Bindings/Python/IRCore.cpp
+++ b/mlir/lib/Bindings/Python/IRCore.cpp
@@ -3385,6 +3385,7 @@ void mlir::python::populateIRCore(nb::module_ &m) {
       .def(MLIR_PYTHON_CAPI_FACTORY_ATTR, &PyOperation::createFromCapsule)
       .def_prop_ro("operation", [](nb::object self) { return self; })
       .def_prop_ro("opview", &PyOperation::createOpView)
+      .def_prop_ro("block", &PyOperation::getBlock)
       .def_prop_ro(
           "successors",
           [](PyOperationBase &self) {

@makslevental makslevental merged commit 227f759 into llvm:main Jun 20, 2025
9 checks passed
@makslevental makslevental deleted the makslevental/operation-block branch June 20, 2025 19:34
Jaddyen pushed a commit to Jaddyen/llvm-project that referenced this pull request Jun 23, 2025
Expose `operation-getBlock()` in python.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants