[all-commits] [llvm/llvm-project] f100be: [mlir][linalg] Insert a cast for identity linalg.g...

Benjamin Kramer via All-commits all-commits at lists.llvm.org
Tue Jan 18 14:44:46 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f100bedb036276f6a1c73b6467fe7585c1b20292
      https://github.com/llvm/llvm-project/commit/f100bedb036276f6a1c73b6467fe7585c1b20292
  Author: Benjamin Kramer <benny.kra at googlemail.com>
  Date:   2022-01-18 (Tue, 18 Jan 2022)

  Changed paths:
    M mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
    M mlir/test/Dialect/Linalg/canonicalize.mlir

  Log Message:
  -----------
  [mlir][linalg] Insert a cast for identity linalg.generics when the types don't match

This can happen when the result has different dynamic dimensions than
the input.

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


  Commit: ff5de8a9e0e5cb7f82b945486b784407f6aab8fe
      https://github.com/llvm/llvm-project/commit/ff5de8a9e0e5cb7f82b945486b784407f6aab8fe
  Author: Benjamin Kramer <benny.kra at googlemail.com>
  Date:   2022-01-18 (Tue, 18 Jan 2022)

  Changed paths:
    M mlir/include/mlir/Dialect/Utils/ReshapeOpsUtils.h
    M mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp
    M mlir/lib/Dialect/Utils/ReshapeOpsUtils.cpp
    M mlir/test/Dialect/Linalg/reshape_fusion.mlir

  Log Message:
  -----------
  [linalg][fusion] Disallow fusion when it would create an invalid expand_shape

The input type of a linalg.generic can be less dynamic than its output
type. If this is the case moving a reshape across the generic op would
create invalid IR, as expand_shape cannot expand arbitrary dynamic
dimensions.

Check that the reshape is actually valid before creating the
expand_shape. This exposes the existing verification logic in reshape
utils and removes the incomplete custom implementation in fusion.

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


Compare: https://github.com/llvm/llvm-project/compare/7294d7dae7c0...ff5de8a9e0e5


More information about the All-commits mailing list