Skip to content

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
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