[all-commits] [llvm/llvm-project] 59a920: [mlir][IR] Make `replaceOp` / `replaceAllUsesWith`...

Matthias Springer via All-commits all-commits at lists.llvm.org
Wed Mar 6 17:26:45 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 59a92019fbc0a67ec82a903a4f6167ad45545a7f
      https://github.com/llvm/llvm-project/commit/59a92019fbc0a67ec82a903a4f6167ad45545a7f
  Author: Matthias Springer <me at m-sp.org>
  Date:   2024-03-07 (Thu, 07 Mar 2024)

  Changed paths:
    M mlir/include/mlir/IR/PatternMatch.h
    M mlir/include/mlir/Transforms/DialectConversion.h
    M mlir/lib/Dialect/Linalg/Transforms/DecomposeLinalgOps.cpp
    M mlir/lib/Dialect/Linalg/Utils/Utils.cpp
    M mlir/lib/IR/PatternMatch.cpp
    M mlir/lib/Transforms/Utils/DialectConversion.cpp
    M mlir/lib/Transforms/Utils/RegionUtils.cpp
    M mlir/test/lib/Dialect/Test/TestPatterns.cpp

  Log Message:
  -----------
  [mlir][IR] Make `replaceOp` / `replaceAllUsesWith` API consistent (#82629)

* `replaceOp` replaces all uses of the original op and erases the old
op.
* `replaceAllUsesWith` replaces all uses of the original op/value/block.
It does not erase any IR.

This commit renames `replaceOpWithIf` to `replaceUsesWithIf`.
`replaceOpWithIf` was a misnomer because the function never erases the
original op. Similarly, `replaceOpWithinBlock` is renamed to
`replaceUsesWithinBlock`. (No "operation replaced" is sent because the
op is not erased.)

Also improve comments.



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