diff --git a/mlir/lib/Bindings/Python/IRCore.cpp b/mlir/lib/Bindings/Python/IRCore.cpp index 3e927ceec190f5..d6305e7f49ec54 100644 --- a/mlir/lib/Bindings/Python/IRCore.cpp +++ b/mlir/lib/Bindings/Python/IRCore.cpp @@ -2200,6 +2200,12 @@ void mlir::python::populateIRCore(py::module &m) { // Mapping of PyBlock. //---------------------------------------------------------------------------- py::class_(m, "Block") + .def_property_readonly( + "owner", + [](PyBlock &self) { + return self.getParentOperation()->createOpView(); + }, + "Returns the owning operation of this block.") .def_property_readonly( "arguments", [](PyBlock &self) {