This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Handle cases where transfer_read should turn into a scalar load
ClosedPublic

Authored by stephenneuendorffer on May 31 2021, 10:32 PM.

Details

Summary

The existing vector transforms reduce the dimension of transfer_read
ops. However, beyond a certain point, the vector op actually has
to be reduced to a scalar load, since we can't load a zero-dimension
vector. This handles this case.

Note that in the longer term, it may be preferaby to support
zero-dimension vectors. see
https://llvm.discourse.group/t/should-we-have-0-d-vectors/3097.

Diff Detail

Event Timeline

stephenneuendorffer requested review of this revision.May 31 2021, 10:32 PM
nicolasvasilache accepted this revision.Jun 4 2021, 4:21 AM

Thanks @stephenneuendorffer !
Note that this will prob be handled by allowing vector<T> in the longer term https://llvm.discourse.group/t/should-we-have-0-d-vectors/3097.
Could you please add a TODO along those lines ?

This revision is now accepted and ready to land.Jun 4 2021, 4:21 AM
aartbik accepted this revision.Jul 30 2021, 1:23 PM

Minor nit on the title and doc: transform_read -> transfer_read

stephenneuendorffer retitled this revision from [mlir] Handle cases where transform_read should turn into a scalar load to [mlir] Handle cases where transfer_read should turn into a scalar load.
stephenneuendorffer edited the summary of this revision. (Show Details)
This revision was landed with ongoing or failed builds.Aug 3 2021, 11:11 PM
This revision was automatically updated to reflect the committed changes.

Thanks for the reviews!