[Mlir-commits] [mlir] [mlir][py] invalidate nested operations when parent is deleted (PR #93339)

Stella Laurenzo llvmlistbot at llvm.org
Fri May 24 15:56:34 PDT 2024


stellaraccident wrote:

To do this right, we need weak references to operations. And for that, we need an extra pointer in the c++ operation that can optionally point to a single weak reference object with shared pte semantics of some kind. 

There's nowhere to easily steal such a pointer in Operation, so this would be a new cost. It could probably be made optional based on a context flag to enable weak references -- with the pointer storage itself being dynamically placed in the prefix storage area used for excess op result storage when the feature is enabled.

When disabled, the cost would be a bool check on the context flag at allocation and destruction time.

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


More information about the Mlir-commits mailing list