[mlir][tosa] Add broadcasting case for tosa.resize to linalg implementation
authorRob Suderman <suderman@google.com>
Tue, 3 Jan 2023 22:14:43 +0000 (14:14 -0800)
committerRob Suderman <suderman@google.com>
Tue, 3 Jan 2023 22:29:06 +0000 (14:29 -0800)
commitb5a1de9c983d5ddaa6f3d1bf96a0896555844eb2
tree7cde22d2be2f23609cf33a97fd348dd67fead21e
parentec40c8f6fe8477e22b9a1e5a3140dd3f7b247588
[mlir][tosa] Add broadcasting case for tosa.resize to linalg implementation

When lowering tosa.resize it is possible there is an unary input dimension.
Lowering to a new tosa.resize and explicit broadcast simplifies the
tosa.resize operation to avoid recomputing the identical broadcasted values.

This change reworks the broadcast optimization reuse the tosa.resize generic
implementation.

Reviewed By: jpienaar

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