[mlir][tensor] Improve size inference in tiling tensor.pack ops.
authorHanhan Wang <hanchung@google.com>
Thu, 23 Feb 2023 00:58:37 +0000 (16:58 -0800)
committerHanhan Wang <hanchung@google.com>
Thu, 23 Feb 2023 18:35:00 +0000 (10:35 -0800)
commit4d0365101f98061dbaf409c0f390778ef66672e7
treebdab6c3db770281b650493d1b93b1b3e17e58f29
parentc083c8974400bcc665d7736cd0e2b653180026ff
[mlir][tensor] Improve size inference in tiling tensor.pack ops.

The sizes of input operands need being clampled only when there are
incomplete tiles, i.e., the padding value is set. The shape input slice
can be folded into constants when they are static shapes and tiling
sizes.

Reviewed By: chelini

Differential Revision: https://reviews.llvm.org/D144604
mlir/lib/Dialect/Tensor/IR/TensorTilingInterfaceImpl.cpp
mlir/test/Dialect/Linalg/generalize-tensor-pack-tile.mlir
mlir/test/Dialect/Tensor/tiling.mlir