llvm-project/mlir/lib/Bindings/Python
John Demme 6b0bed7ea5 [MLIR] [Python] Add a method to clear live operations map
Introduce a method on PyMlirContext (and plumb it through to Python) to
invalidate all of the operations in the live operations map and clear
it. Since Python has no notion of private data, an end-developer could
reach into some 3rd party API which uses the MLIR Python API (that is
behaving correctly with regard to holding references) and grab a
reference to an MLIR Python Operation, preventing it from being
deconstructed out of the live operations map. This allows the API
developer to clear the map when it calls C++ code which could delete
operations, protecting itself from its users.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D123895
2022-04-19 15:14:09 -07:00
..
Conversions [mlir] Remove unused namespace alias. 2021-09-30 13:50:31 +02:00
Transforms Fix clang-tidy issues in mlir/ (NFC) 2021-12-20 20:25:01 +00:00
AllPassesRegistration.cpp [mlir][python] Provide "all passes" registration module in Python 2021-05-26 15:14:57 -07:00
AsyncPasses.cpp [mlir][python] Add python support for async dialect and passes. 2021-04-28 14:52:27 +00:00
DialectLinalg.cpp [mlir] Split out Python bindings for dialects into separate libs 2022-01-06 10:31:14 +01:00
DialectPDL.cpp [mlir] Introduce Python bindings for the PDL dialect 2022-01-19 11:19:56 +01:00
DialectQuant.cpp Ensure newlines at the end of files (NFC) 2022-01-06 23:44:02 -08:00
DialectSparseTensor.cpp [mlir] Split out Python bindings for dialects into separate libs 2022-01-06 10:31:14 +01:00
ExecutionEngineModule.cpp Apply clang-tidy fixes for performance-unnecessary-value-param to MLIR (NFC) 2022-01-02 01:45:18 +00:00
GPUPasses.cpp [mlir][python] Add basic python support for GPU dialect and passes 2021-04-28 14:52:28 +00:00
Globals.h [mlir][Python] Return and accept OpView for all functions. 2020-11-03 22:48:34 -08:00
IRAffine.cpp Apply clang-tidy fixes for performance-move-const-arg to MLIR (NFC) 2022-01-02 22:36:56 +00:00
IRAttributes.cpp [MLIR][python binding] Add OpaqueAttribute to python binding. 2022-03-11 10:56:21 +01:00
IRCore.cpp [MLIR] [Python] Add a method to clear live operations map 2022-04-19 15:14:09 -07:00
IRInterfaces.cpp Apply clang-tidy fixes for performance-unnecessary-value-param to MLIR (NFC) 2022-01-02 01:45:18 +00:00
IRModule.cpp Remove misused RAII gil_scoped_release/gil_scoped_acquire: without name they don't have any effect 2022-01-03 06:17:04 +00:00
IRModule.h [MLIR] [Python] Add a method to clear live operations map 2022-04-19 15:14:09 -07:00
IRTypes.cpp [mlir][python] Add pyi stub files to enable auto completion. 2021-11-29 19:58:58 -08:00
LinalgPasses.cpp [mlir] Register Linalg passes in C API and Python Bindings 2021-03-27 09:57:56 +01:00
MainModule.cpp [mlir] Split out Python bindings for dialects into separate libs 2022-01-06 10:31:14 +01:00
Pass.cpp [mlir] Prefix pass manager options with `mlir-` 2022-04-12 09:32:44 +00:00
Pass.h Ensure newlines at the end of files (NFC) 2021-10-23 08:45:29 -07:00
PybindUtils.cpp Fix clang-tidy issues in mlir/ (NFC) 2021-12-20 20:25:01 +00:00
PybindUtils.h [mlir][python] Directly implement sequence protocol on Sliceable. 2022-02-14 09:45:17 -08:00
SparseTensorPasses.cpp [mlir][sparse][capi][python] add sparse tensor passes 2021-05-12 16:40:50 -07:00