[all-commits] [llvm/llvm-project] 28c4a4: [mlir][IR] Rename `notify*Removed` to `notify*Erased`

Matthias Springer via All-commits all-commits at lists.llvm.org
Mon Feb 19 06:53:16 PST 2024


  Branch: refs/heads/users/matthias-springer/notify_operation_erased
  Home:   https://github.com/llvm/llvm-project
  Commit: 28c4a44041219da30cb2dabd101933dd1ce81ea2
      https://github.com/llvm/llvm-project/commit/28c4a44041219da30cb2dabd101933dd1ce81ea2
  Author: Matthias Springer <springerm at google.com>
  Date:   2024-02-19 (Mon, 19 Feb 2024)

  Changed paths:
    M mlir/include/mlir/Dialect/Transform/IR/TransformInterfaces.h
    M mlir/include/mlir/IR/PatternMatch.h
    M mlir/lib/Dialect/Bufferization/Transforms/Bufferize.cpp
    M mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
    M mlir/lib/Dialect/Transform/IR/TransformInterfaces.cpp
    M mlir/lib/IR/PatternMatch.cpp
    M mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
    M mlir/test/Transforms/test-strict-pattern-driver.mlir
    M mlir/test/lib/Dialect/Test/TestPatterns.cpp
    M mlir/test/lib/Transforms/TestConstantFold.cpp

  Log Message:
  -----------
  [mlir][IR] Rename `notify*Removed` to `notify*Erased`

Rename listener callback names:
* `notifyOperationRemoved` -> `notifyOperationErased`
* `notifyBlockRemoved` -> `notifyBlockErased`

The current callback names are misnomers. The callbacks are triggered when an operation/block is erased, not when it is removed (unlinked).

E.g.:
```c++
/// Notify the listener that the specified operation is about to be erased.
/// At this point, the operation has zero uses.
///
/// Note: This notification is not triggered when unlinking an operation.
virtual void notifyOperationErased(Operation *op) {}
```

This change is in preparation of adding listener support to the dialect conversion. The dialect conversion internally unlinks IR before erasing it at a later point of time. There is an important difference between "remove" and "erase". Lister callback names should be accurate to avoid confusion.



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