Page MenuHomePhabricator

mlir/tosa: move sole slice in TosaToTensor to Linalg

Authored by artagnon on Nov 27 2022, 10:23 AM.



The TosaToTensor pass was born out of a rename from TosaToStandard, in
126e7eaf0 ([tosa] Add option to disable tosa.apply_scale lowering in
TosaToStandard), but having a conversion pass for a sole tosa.slice is
ill-conceived. The idea of lowering the tosa dialect to the tensor
dialect doesn't quite make sense: only a couple of operations can be
converted. Instead, move the SliceConverter to TosaToLinalg, which has a
lot of existing conversions already. While at it, make some minor fixes
to the test.

Signed-off-by: Ramkumar Ramachandra <>

Diff Detail

Event Timeline

artagnon created this revision.Nov 27 2022, 10:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 27 2022, 10:23 AM
artagnon requested review of this revision.Nov 27 2022, 10:23 AM
rsuderman requested changes to this revision.Nov 29 2022, 1:41 PM

While it is true that it is a bit silly the TosaToSlice only contains the lowering for slice, linalg is not expected to be the only backend for execution. Supporting TosaToSlice independent of TosaToLinalg is necessary for any backend that chooses to target a non-Linalg backend.

This revision now requires changes to proceed.Nov 29 2022, 1:41 PM

Okay, I see a TensorToLinalg. However, there is a tosa.pad -> tensor.pad conversion in TosaToLinalg: for consistency, do you recommend moving this to TosaToTensor?

artagnon abandoned this revision.Dec 1 2022, 8:53 AM

Abandoned in favor of D139091.