[mlir] tosa.concat - Add InferTensorType interface
authorMaya Amrami <maya.amrami@mobileye.com>
Thu, 9 Mar 2023 11:51:27 +0000 (13:51 +0200)
committerMaya Amrami <mayaam88@gmail.com>
Tue, 21 Mar 2023 15:01:08 +0000 (17:01 +0200)
commitfd004a4986eb3ecc14f03a4ff4eef9bc06c78059
tree23d7e7c9acfb917c579bc100cd96ce30f1c59eb0
parentfb409a2822df90e3c63d5e674966f18c8638cdaf
[mlir] tosa.concat - Add InferTensorType interface

When this interface is used, a call to inferReturnTypeComponents()
is generated on creation and verification of the op.
A few changes were required in inferReturnTypeComponents():
- Emit error when it fails.
  The verifier calls this method now, and it is preferable to
  indicate what caused the failure.
- Fix the inferred return shapes so they have a type too.

Reviewed By: rsuderman

Differential Revision: https://reviews.llvm.org/D146132
mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td
mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
mlir/test/Dialect/Tosa/invalid.mlir
mlir/test/Dialect/Tosa/tosa-infer-shapes.mlir