[mlir] Make attributes mutable in Python bindings
Attributes represent additional data about an operation and are intended to be modifiable during the lifetime of the operation. In the dialect-specific Python bindings, attributes are exposed as properties on the operation class. Allow for assigning values to these properties. Also support creating new and deleting existing attributes through the generic "attributes" property of an operation. Any validity checking must be performed by the op verifier after the mutation, similarly to C++. Operations are not invalidated in the process: no dangling pointers can be created as all attributes are owned by the context and will remain live even if they are not used in any operation. Introduce a Python Test dialect by analogy with the Test dialect and to avoid polluting the latter with Python-specific constructs. Use this dialect to implement a test for the attribute access and mutation API. Reviewed By: stellaraccident, mehdi_amini Differential Revision: https://reviews.llvm.org/D91652
Loading
Please register or sign in to comment