[Mlir-commits] [mlir] [mlir][python] Add normalforms to capture preconditions of transforms (PR #79449)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Jan 26 04:49:51 PST 2024


================
@@ -42,6 +44,46 @@ def __init__(
         super().__init__(v)
         self.parent = parent
         self.children = children if children is not None else []
+        self._normalform = Normalform
+
+    @property
+    def normalform(self) -> Type["Normalform"]:
----------------
martin-luecke wrote:

Annotating with `NormalForm` indicates that the function returns an instance of `NormalForm`. 
In this design a _Type_ of normalform is returned, so e.g. `NormalForm`, rather than `NormalForm()`.
To me the normalform of a handle is sort of a type property of that handle and this way it can be modeled closer to that. 
Additionally, having multiple instances of a specific NormalForm does not make sense here.

https://github.com/llvm/llvm-project/pull/79449


More information about the Mlir-commits mailing list