[all-commits] [llvm/llvm-project] 4317a3: [mlir][Linalg] Disable fusion of reshape with elem...

MaheshRavishankar via All-commits all-commits at lists.llvm.org
Thu Jan 6 10:32:42 PST 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4317a3dfad52ee2830d686c6f3a9ef8011f7e6ad
  Author: MaheshRavishankar <ravishankarm at google.com>
  Date:   2022-01-06 (Thu, 06 Jan 2022)

  Changed paths:
    M mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp
    M mlir/test/Dialect/Linalg/reshape_fusion.mlir

  Log Message:
  [mlir][Linalg] Disable fusion of reshape with elementwise ops for purely dynamic cases.

`tensor.collapse_shape` op when fused with a consumer elementwise
`linalg.generic` operation results in creation of tensor.expand_shape
ops. In purely dynamic cases this can end up with a dynamic dimensions
being expanded to more than one dynamic dimension. This is disallowed
by the semantics of `tensor.expand_shape` operation. (While the
transformation is itself correct, its a gap in the specification of
`tensor.expand_shape` that is the issue). So disallow fusions which
result in such a pattern.

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

More information about the All-commits mailing list