[mlir][tosa] Add tosa shape inference with InferReturnTypeComponent
authorRob Suderman <rob.suderman@gmail.com>
Thu, 17 Jun 2021 22:58:37 +0000 (15:58 -0700)
committerRob Suderman <rob.suderman@gmail.com>
Thu, 1 Jul 2021 23:04:26 +0000 (16:04 -0700)
commit8dea784b3ed7df3edd9e3b59b1e1b58d2a4ac175
tree7ec15f368ebcd618d116b3a027d7209ec67c21ce
parent0176ac95035eb6508f8f838c7d72afa03d67b5aa
[mlir][tosa] Add tosa shape inference with InferReturnTypeComponent

Added InferReturnTypeComponents for NAry operations, reshape, and reverse.
With the additional tosa-infer-shapes pass, we can infer/propagate shapes
across a set of TOSA operations. Current version does not modify the
FuncOp type by inserting an unrealized conversion cast prior to any new
non-matchin returns.

Differential Revision: https://reviews.llvm.org/D105312
mlir/include/mlir/Dialect/Tosa/IR/TosaOps.h
mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td
mlir/include/mlir/Dialect/Tosa/Transforms/Passes.h
mlir/include/mlir/Dialect/Tosa/Transforms/Passes.td
mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
mlir/lib/Dialect/Tosa/Transforms/CMakeLists.txt
mlir/lib/Dialect/Tosa/Transforms/TosaInferShapes.cpp [new file with mode: 0644]
mlir/lib/Dialect/Tosa/Transforms/TosaMakeBroadcastable.cpp
mlir/test/Conversion/TosaToLinalg/tosa-to-linalg.mlir
mlir/test/Dialect/Tosa/tosa_infer_shapes.mlir [new file with mode: 0644]
mlir/test/lib/Dialect/Tosa/TosaTestPasses.cpp