[mlir][crunner] fix bug in memref copy for rank 0
authorAart Bik <ajcbik@google.com>
Thu, 15 Jul 2021 04:01:00 +0000 (21:01 -0700)
committerAart Bik <ajcbik@google.com>
Thu, 15 Jul 2021 08:15:07 +0000 (01:15 -0700)
commit04bddb6cc7c405f1a82ee1d94f96596c2cb387d9
tree3b553614370f9aa3227157b3a9016c956b03e7bb
parent9805afdfea7e5cc1c73efcd13c4bb1fc8c8d6765
[mlir][crunner] fix bug in memref copy for rank 0

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.

Reviewed By: herhut

Differential Revision: https://reviews.llvm.org/D106036
mlir/lib/ExecutionEngine/CRunnerUtils.cpp