This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Added support for rank reducing subviews
ClosedPublic

Authored by limo1996 on Sep 30 2020, 12:43 AM.

Details

Summary

This commit adds support for subviews which enable to reduce resulting rank
by dropping static dimensions of size 1.

Diff Detail

Event Timeline

limo1996 created this revision.Sep 30 2020, 12:43 AM
Herald added a project: Restricted Project. · View Herald Transcript
limo1996 requested review of this revision.Sep 30 2020, 12:43 AM
nicolasvasilache accepted this revision.Sep 30 2020, 3:30 AM
This revision is now accepted and ready to land.Sep 30 2020, 3:30 AM
This revision was automatically updated to reflect the committed changes.

I missed this commit (cause it was middle of the night in US), but subviews cannot be lowered directly to SPIR-V dialect. This pass (https://github.com/llvm/llvm-project/blob/master/mlir/lib/Conversion/StandardToSPIRV/LegalizeStandardForSPIRV.cpp) folds subviews into loads/stores. Not sure it handles this change, the only ask would be to assert there that the ranks are same and return failure when the rank isnt the same. I can look into fixing this later.