[tosa] Improve inferred shapes of TOSA operations
authorSpenser Bauman <sbauman@mathworks.com>
Thu, 25 May 2023 23:06:50 +0000 (16:06 -0700)
committerEric Kunze <eric.kunze@arm.com>
Thu, 25 May 2023 23:27:13 +0000 (16:27 -0700)
commit98aad40806f18cd1d8f248d15efc75fe26840bd4
treec3749f8e42896765652f105a3d2e088564988242
parent0aa7ea4e223fc53b45002f0c4e70b034ea72c057
[tosa] Improve inferred shapes of TOSA operations

The TosaInferShapes pass avoids updating the shapes of tensor operators
when the consumers are not TOSA operations, limiting the efficacy of
TosaInferShapes when the IR is a mix of TOSA and other operations.
This change attempts to update the result shapes when the consumers
themselves have reasonable type/shape inference methods.

Reviewed By: eric-k256

Differential Revision: https://reviews.llvm.org/D151228
mlir/lib/Dialect/Tosa/Transforms/TosaInferShapes.cpp
mlir/test/Dialect/Tosa/tosa-infer-shapes.mlir