[all-commits] [llvm/llvm-project] 42c31d: [mlir][IR] Clean up mergeBlockBefore and mergeBlocks

Matthias Springer via All-commits all-commits at lists.llvm.org
Mon Mar 6 04:53:48 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 42c31d8302ff8f716601df9c276a5cd9ace6b158
      https://github.com/llvm/llvm-project/commit/42c31d8302ff8f716601df9c276a5cd9ace6b158
  Author: Matthias Springer <me at m-sp.org>
  Date:   2023-03-06 (Mon, 06 Mar 2023)

  Changed paths:
    M mlir/include/mlir/IR/PatternMatch.h
    M mlir/include/mlir/Transforms/DialectConversion.h
    M mlir/lib/Conversion/SCFToControlFlow/SCFToControlFlow.cpp
    M mlir/lib/Dialect/Affine/IR/AffineOps.cpp
    M mlir/lib/Dialect/ControlFlow/IR/ControlFlowOps.cpp
    M mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
    M mlir/lib/Dialect/SCF/IR/SCF.cpp
    M mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp
    M mlir/lib/Dialect/SparseTensor/Utils/Merger.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] Clean up mergeBlockBefore and mergeBlocks

* `RewriterBase::mergeBlocks` is simplified: it is implemented in terms of `mergeBlockBefore`.
* The signature of `mergeBlockBefore` is consistent with other API (such as `inlineRegionBefore`): an overload for a `Block::iterator` is added.
* Additional safety checks are added to `mergeBlockBefore`: detect cases where the resulting IR could be invalid (no more `dropAllUses`) or partly unreachable (likely a case of incorrect API usage).
* Rename `mergeBlockBefore` to `inlineBlockBefore`.

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




More information about the All-commits mailing list