[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
Differential Revision: https://reviews.llvm.org/D97887