[all-commits] [llvm/llvm-project] 71d50c: [mlir][IR] Improve listener notifications for ops ...

Matthias Springer via All-commits all-commits at lists.llvm.org
Tue Jun 13 23:51:38 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 71d50c890bad943ab23ee9b32638b2366351f8f8
      https://github.com/llvm/llvm-project/commit/71d50c890bad943ab23ee9b32638b2366351f8f8
  Author: Matthias Springer <me at m-sp.org>
  Date:   2023-06-14 (Wed, 14 Jun 2023)

  Changed paths:
    M mlir/include/mlir/IR/PatternMatch.h
    M mlir/include/mlir/Transforms/DialectConversion.h
    M mlir/lib/Dialect/AMDGPU/Transforms/EmulateAtomics.cpp
    M mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
    M mlir/lib/IR/PatternMatch.cpp
    M mlir/lib/Transforms/Utils/DialectConversion.cpp
    M mlir/test/lib/Dialect/Test/TestPatterns.cpp

  Log Message:
  -----------
  [mlir][IR] Improve listener notifications for ops without results

`RewriterBase::Listener::notifyOperationReplaced` notifies observers that an op is about to be replaced with a range of values. This notification is not very useful for ops without results, because it does not specify the replacement op (and it cannot be deduced from the replacement values). It provides no additional information over the `notifyOperationRemoved` notification.

This revision adds an additional notification when a rewriter replaces an op with another op. By default, this notification triggers the original "op replaced with values" notification, so there is no functional change for existing code.

This new API is useful for the transform dialect, which needs to track op replacements. (Updated in a subsequent revision.)

Also includes minor documentation improvements.

Differential Revision: https://reviews.llvm.org/D152814




More information about the All-commits mailing list