[all-commits] [llvm/llvm-project] 9235e5: [mlir][bufferize] Fix missing copies when writing ...

Matthias Springer via All-commits all-commits at lists.llvm.org
Wed Apr 20 02:51:26 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9235e597a40b423a298ce415eb922462e7f0b765
  Author: Matthias Springer <springerm at google.com>
  Date:   2022-04-20 (Wed, 20 Apr 2022)

  Changed paths:
    M mlir/lib/Dialect/Bufferization/Transforms/OneShotAnalysis.cpp
    M mlir/test/Dialect/Linalg/comprehensive-module-bufferize-analysis.mlir

  Log Message:
  [mlir][bufferize] Fix missing copies when writing to a buffer in a loop

Writes into tensors that are definied outside of a repetitive region, but with the write happening inside of the repetitive region were previously not considered conflicts. This was incorrect.

%0 = ... : tensor<?xf32>
scf.for ... {
  "reading_op"(%0) : tensor<?xf32>
  %1 = "writing_op"(%0) : tensor<?xf32> -> tensor<?xf32>

In the above example, "writing_op" should be out-of-place.

This commit fixes the bufferization for any op that declares its repetitive semantics via RegionBranchOpInterface.

More information about the All-commits mailing list