HomePhabricator

[mlir] Enhance InferShapedTypeOpInterface and move LinalgOps to use them.

Authored by mravishankar on Mar 29 2021, 10:57 AM.

Description

[mlir] Enhance InferShapedTypeOpInterface and move LinalgOps to use them.

A new InterfaceMethod is added to InferShapedTypeOpInterface that
allows an operation to return the Values for each dim of its
results. It is intended for the case where the Value returned for
each dim is computed using the operands and operation attributes. This
interface method is for cases where the result dim of an operation can
be computed independently, and it avoids the need to aggregate all
dims of a result into a single shape value. This also implies that
this is not suitable for cases where the result type is unranked (for
which the existing interface methods is to be used).

Also added is a canonicalization pattern that uses this interface and
resolves the shapes of the output in terms of the shapes of the
inputs. Moving Linalg ops to use this interface, so that many
canonicalization patterns implemented for individual linalg ops to
achieve the same result can be removed in favor of the added
canonicalization pattern.

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

Details

Committed
mravishankarMar 29 2021, 11:39 AM
Differential Revision
D97887: [mlir] Enhance InferShapedTypeOpInterface and move LinalgOps to use them.
Parents
rG742f663705bb: fix comment typo to cycle bots
Branches
Unknown
Tags
Unknown