This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Linalg] Add pattern to fold linalg.tensor_reshape that add unit extent dims.
ClosedPublic

Authored by mravishankar on Sep 21 2020, 4:40 PM.

Details

Summary

A sequence of two reshapes such that one of them is just adding unit
extent dims can be folded to a single reshape.

Diff Detail

Event Timeline

mravishankar created this revision.Sep 21 2020, 4:40 PM
Herald added a project: Restricted Project. · View Herald Transcript
mravishankar requested review of this revision.Sep 21 2020, 4:40 PM

Removing errant changes and formatting

hanchung accepted this revision.Sep 22 2020, 3:33 AM

Thanks, just few nits!

mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp
449

Can use rewriter.getAffineDimExpr(...).

455

Can use rewriter.getArrayAttr() instead.

This revision is now accepted and ready to land.Sep 22 2020, 3:33 AM

Addressing comments

This revision was landed with ongoing or failed builds.Sep 23 2020, 12:02 AM
This revision was automatically updated to reflect the committed changes.