[all-commits] [llvm/llvm-project] 53f7fb: [mlir][linalg] Do not fuse shape-only producers.

Tobias Gysi via All-commits all-commits at lists.llvm.org
Thu Mar 24 03:27:30 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 53f7fb0a8703ffcc5ccdb0d8133ca0df494ef68f
      https://github.com/llvm/llvm-project/commit/53f7fb0a8703ffcc5ccdb0d8133ca0df494ef68f
  Author: gysit <gysit at google.com>
  Date:   2022-03-24 (Thu, 24 Mar 2022)

  Changed paths:
    M mlir/lib/Dialect/Linalg/Transforms/FusionOnTensors.cpp
    M mlir/test/Dialect/Linalg/tile-and-fuse-no-fuse.mlir

  Log Message:
  -----------
  [mlir][linalg] Do not fuse shape-only producers.

This revision introduces a heuristic to stop fusion for shape-only tensors. A shape-only tensor only defines the shape of the consumer computation while the data is not used. Pure producer consumer fusion thus shall not fuse the producer of a shape-only tensor. In particular, since the shape-only tensor will have other uses that actually consume the data.

The revision enables fusion for consumers that have two uses of the same tensor. One as input operand and one as shape-only output operand. In these cases, we want to fuse only the input operand and avoid output fusion via iteration argument.

Reviewed By: hanchung

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




More information about the All-commits mailing list