[Mlir-commits] [mlir] [MLIR][Python] Support region in python-defined dialects (PR #179086)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Feb 2 05:58:27 PST 2026
================
@@ -342,6 +366,15 @@ def _generate_attr_properties(cls, attrs: List[AttributeDef]) -> None:
property(lambda self, name=attr.name: self.attributes[name]),
)
+ @classmethod
+ def _generate_region_properties(cls, regions: List[RegionDef]) -> None:
+ for i, region in enumerate(regions):
+ setattr(
+ cls,
+ region.name,
+ property(lambda self, i=i: self.regions[i]),
----------------
PragmaTwice wrote:
hmm here `region` is just a `RegionDef`, we need `self` to get the real regions in the operation instance iirc.
https://github.com/llvm/llvm-project/pull/179086
More information about the Mlir-commits
mailing list