[all-commits] [llvm/llvm-project] 5cc0f7: [mlir][IR] Add rewriter API for moving operations ...

Matthias Springer via All-commits all-commits at lists.llvm.org
Thu Jan 25 02:01:40 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5cc0f76d34c7d00fa3e4ff01efe24d5de592e82c
      https://github.com/llvm/llvm-project/commit/5cc0f76d34c7d00fa3e4ff01efe24d5de592e82c
  Author: Matthias Springer <me at m-sp.org>
  Date:   2024-01-25 (Thu, 25 Jan 2024)

  Changed paths:
    M flang/include/flang/Optimizer/Builder/FIRBuilder.h
    M flang/lib/Optimizer/HLFIR/Transforms/BufferizeHLFIR.cpp
    M mlir/include/mlir/IR/Builders.h
    M mlir/include/mlir/IR/PatternMatch.h
    M mlir/include/mlir/Transforms/DialectConversion.h
    M mlir/lib/Dialect/Affine/IR/AffineOps.cpp
    M mlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp
    M mlir/lib/Dialect/Bufferization/Transforms/Bufferize.cpp
    M mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
    M mlir/lib/Dialect/SCF/Transforms/ForToWhile.cpp
    M mlir/lib/Dialect/Tensor/Transforms/BufferizableOpInterfaceImpl.cpp
    M mlir/lib/IR/Builders.cpp
    M mlir/lib/IR/PatternMatch.cpp
    M mlir/lib/Transforms/Utils/DialectConversion.cpp
    M mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
    M mlir/lib/Transforms/Utils/LoopInvariantCodeMotionUtils.cpp
    M mlir/test/lib/Dialect/SCF/TestSCFUtils.cpp
    M mlir/test/lib/Dialect/Test/TestPatterns.cpp
    M mlir/test/lib/IR/TestClone.cpp
    M mlir/test/lib/Transforms/TestConstantFold.cpp

  Log Message:
  -----------
  [mlir][IR] Add rewriter API for moving operations (#78988)

The pattern rewriter documentation states that "*all* IR mutations [...]
are required to be performed via the `PatternRewriter`." This commit
adds two functions that were missing from the rewriter API:
`moveOpBefore` and `moveOpAfter`.

After an operation was moved, the `notifyOperationInserted` callback is
triggered. This allows listeners such as the greedy pattern rewrite
driver to react to IR changes.

This commit narrows the discrepancy between the kind of IR modification
that can be performed and the kind of IR modifications that can be
listened to.




More information about the All-commits mailing list