This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][TOSA] Lower tosa.reshape to linalg.reshape
ClosedPublic

Authored by rsuderman on Feb 24 2021, 9:51 PM.

Details

Summary

Lowering from the tosa.reshape op to linalg.reshape. For same-rank or
non-collapsed/expanded cases two linalg.reshapes are inserted.

Diff Detail

Event Timeline

rsuderman created this revision.Feb 24 2021, 9:51 PM
rsuderman requested review of this revision.Feb 24 2021, 9:51 PM

Fixed clang-tidy error

@mravishankar can you review this? I'm not up to date on linalg.reshape (I recall it has some subtleties)

mravishankar requested changes to this revision.Feb 26 2021, 8:58 AM

Looks fine to me. Just a minor comment on some more tests.

mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp
361

rename srcShape to expandedShape (and dstShape to collapsedShape)?

mlir/test/Conversion/TosaToLinalg/tosa-to-linalg.mlir
263

Could you add a test where there are multiple collapsing dimensions. So say 6D to 3D where {0, 1, 2) -> {0} , {3} -> {1} and {4, 5} -> {2} ?

This revision now requires changes to proceed.Feb 26 2021, 8:58 AM
rsuderman updated this revision to Diff 326756.EditedFeb 26 2021, 11:37 AM

Added multiple collapsing dims test and renamed srcShape/dstShape.

mravishankar accepted this revision.Feb 26 2021, 11:44 AM
This revision is now accepted and ready to land.Feb 26 2021, 11:44 AM
This revision was landed with ongoing or failed builds.Feb 26 2021, 1:03 PM
This revision was automatically updated to reflect the committed changes.