This is an archive of the discontinued LLVM Phabricator instance.

[mlir][IR] Add optional offset `offset` parameter to shiftDims/shiftSymbols
AbandonedPublic

Authored by springerm on Aug 8 2021, 11:05 PM.

Details

Summary

Dimensions/symbols are shifted, starting from the specified offset. This allows for inserting new dims/syms into an AffineMap at an arbitrary position (not just at the beginning).

Depends On D108185

Diff Detail

Event Timeline

springerm created this revision.Aug 8 2021, 11:05 PM
springerm requested review of this revision.Aug 8 2021, 11:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2021, 11:05 PM
ftynse added a comment.Aug 9 2021, 8:48 AM

It would be nice to fold this into the commit that uses the new functionality so that we don't go with untested code for a long time.

bondhugula added inline comments.Aug 14 2021, 9:10 AM
mlir/include/mlir/IR/AffineMap.h
210–221

This doc comment is now a bit convoluted. Can you please rephrase it simply:

/// Replace dims[offset ... numDims) by dims[offset + shift ... ...
mlir/lib/IR/AffineExpr.cpp
115–120

Likewise.

springerm updated this revision to Diff 366539.Aug 15 2021, 6:05 PM
springerm marked 2 inline comments as done.

address comments

mlir/include/mlir/IR/AffineMap.h
210–221

How about this?

/// Replace dims[offset ... numDims)
/// by dims[offset + shift ... shift + numDims).

Thanks for extracting this to make it super easy to review.
Please fold into the user when landing as per @ftynse 's comment.

mlir/include/mlir/IR/AffineExpr.h
147

nit: can we align dims[ across lines?

nicolasvasilache accepted this revision.Aug 18 2021, 4:56 AM
This revision is now accepted and ready to land.Aug 18 2021, 4:56 AM
springerm abandoned this revision.Aug 19 2021, 1:37 AM

Merged into and committed with D107222