This is an archive of the discontinued LLVM Phabricator instance.

[mlir][crunner] fix bug in memref copy for rank 0
ClosedPublic

Authored by aartbik on Jul 14 2021, 9:02 PM.

Details

Summary

While replacing linalg.copy with the more desired memref.copy
I found a bug in the support library for rank 0 memref copying.
The code would loop for something like the following, since there
is code for no-rank and rank > 0, but rank == 0 was unexpected.

memref.copy %0, %1: memref<f32> to memref<f32>

Note that a "regression test" for this will follow using the
sparse compiler migration to memref.copy which exercises this
case many times.

Diff Detail

Event Timeline

aartbik created this revision.Jul 14 2021, 9:02 PM
aartbik requested review of this revision.Jul 14 2021, 9:02 PM
herhut accepted this revision.Jul 15 2021, 12:37 AM

Thanks for fixing this!

Do you need the support for arbitrary strides in your use case? I have also planned to add specialized code generation for the case that the maps are identity maps and one can just use a memcpy. I just did not have a use for that, yet.

This revision is now accepted and ready to land.Jul 15 2021, 12:37 AM

Do you need the support for arbitrary strides in your use case? I have also planned to add specialized code generation for the case that the maps are identity maps and one can just use a memcpy. I just did not have a use for that, yet.

Not right away, but in the long run, probably yes!. Thanks!

This revision was automatically updated to reflect the committed changes.