[MLIR][Tosa] Pass encoding through `tosa-to-linalg`
authorrikhuijzer <rikhuijzer@pm.me>
Thu, 15 Jun 2023 16:42:17 +0000 (18:42 +0200)
committerrikhuijzer <rikhuijzer@pm.me>
Thu, 15 Jun 2023 17:44:52 +0000 (19:44 +0200)
commitc8ac14d754088b19c659ca0915229f1f28776831
tree197b7a5021941b0805dc0e7ca40334b5a3f0e0d2
parentb1c683f5c4bcdba18486a3df440db128b3692cca
[MLIR][Tosa] Pass encoding through `tosa-to-linalg`

As pointed out by @Sinclair-Dee in
https://github.com/llvm/llvm-project/issues/62304, the `tosa-to-linalg`
conversion ignored the `encoding` attribute.

Also, this patch avoids an assertion error crash on unranked tensors.
Instead, the conversion now throws a "failed to legalize" error.

Fixes #62304 and fixes #63165.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D152171
mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp
mlir/test/Conversion/TosaToLinalg/tosa-to-linalg-invalid.mlir
mlir/test/Conversion/TosaToLinalg/tosa-to-linalg.mlir