[all-commits] [llvm/llvm-project] 67897d: [mlir][py] invalidate nested operations when paren...

ftynse via All-commits all-commits at lists.llvm.org
Thu May 30 01:06:24 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 67897d77eda4c312cfe81b19a20abed43227ecb8
      https://github.com/llvm/llvm-project/commit/67897d77eda4c312cfe81b19a20abed43227ecb8
  Author: Oleksandr "Alex" Zinenko <git at ozinenko.com>
  Date:   2024-05-30 (Thu, 30 May 2024)

  Changed paths:
    M mlir/lib/Bindings/Python/IRCore.cpp
    M mlir/lib/Bindings/Python/IRModule.h
    A mlir/test/python/live_operations.py

  Log Message:
  -----------
  [mlir][py] invalidate nested operations when parent is deleted (#93339)

When an operation is erased in Python, its children may still be in the
"live" list inside Python bindings. After this, if some of the newly
allocated operations happen to reuse the same pointer address, this will
trigger an assertion in the bindings. This assertion would be incorrect
because the operations aren't actually live. Make sure we remove the
children operations from the "live" list when erasing the parent.

This also concentrates responsibility over the removal from the "live"
list and invalidation in a single place.

Note that this requires the IR to be sufficiently structurally valid so
a walk through it can succeed. If this invariant was broken by, e.g, C++
pass called from Python, there isn't much we can do.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list