This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg] Tiling: Use loop ub in extract_slice size computation if possible
ClosedPublic

Authored by springerm on Sep 4 2021, 12:46 AM.

Details

Summary

When tiling a LinalgOp, extract_slice/insert_slice pairs are inserted. To avoid going out-of-bounds when the tile size does not divide the shape size evenly (at the boundary), AffineMin ops are inserted. Some ops have assumptions regarding the dimensions of inputs/outputs. E.g., in a A * B matmul, dim(A, 1) == dim(B, 0). However, loop bounds use either dim(A, 1) or dim(B, 0).

With this change, AffineMin ops are expressed in terms of loop bounds instead of tensor sizes. (Both have the same runtime value.) This simplifies canonicalizations.

Depends On D108270

Diff Detail

Event Timeline

springerm created this revision.Sep 4 2021, 12:46 AM
springerm requested review of this revision.Sep 4 2021, 12:46 AM
springerm updated this revision to Diff 370711.Sep 4 2021, 1:32 AM

no change

This revision is now accepted and ready to land.Sep 8 2021, 4:24 AM
This revision was landed with ongoing or failed builds.Sep 8 2021, 7:11 PM
This revision was automatically updated to reflect the committed changes.