Skip to content
Commit 2d61628c authored by Ramiro Leal-Cavazos's avatar Ramiro Leal-Cavazos Committed by Robert Suderman
Browse files

[mlir][tosa] Swap reshape at end of reduce op with expand_shape

This commit swaps back the `tosa.reshape` op used at the end of the
lowering for reduce ops with the op `tensor.expand_shape`. This is
needed to properly support dynamically-sized tensors. In such cases,
lowering directly to `tensor.expand_shape` allows us to control which
dimension gets expanded at the end using the knowledge of the
reduction. This would not be possible when using `tosa.reshape`, since
the op does not have a way of knowing that we are only unsqueezing a
single dimension.

Note: this change had previously been performed in
https://reviews.llvm.org/D133877.

Reviewed By: rsuderman

Differential Revision: https://reviews.llvm.org/D145986
parent b8cf7af9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment