7 Commits

Author SHA1 Message Date
Rob Suderman
cd2d736963 [mlir][tosa] Limit right-shift to 31 bits
Right shift can occur that is a 32-bit right shift. This is undefined behavior.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D117732
2022-01-20 14:39:57 -08:00
Rob Suderman
0763f12213 [mlir][tosa] Handle rescale case where shift > 63
It is possible for the shift value to exceed the number of bits. In these
cases we can just multiply by zero. This is relatively rare occurence but
should be handled.

Reviewed By: not-jenni

Differential Revision: https://reviews.llvm.org/D115779
2021-12-16 15:30:48 -08:00
Rob Suderman
8662a2f208 [mlir][tosa] Relax ranked constraint on quantization builder
TosaOp defintion had an artificial constraint that the input/output types
needed to be ranked to invoke the quantization builder. This is correct as an
unranked tensor could still be quantized.

Reviewed By: NatashaKnk

Differential Revision: https://reviews.llvm.org/D109863
2021-09-16 11:43:47 -07:00
Stella Laurenzo
ac3587f272 NFC: (re-apply) Fix some post-review nits for the Tosa dialect.
This reverts commit 330398052d049f90e6cfac80ab8b765b158a3e61.

Differential Revision: https://reviews.llvm.org/D91006
2020-11-07 10:02:56 -08:00
Stella Laurenzo
330398052d Revert "NFC: Fix some post-review nits for the Tosa dialect."
* Introduced issue in debug builds.

This reverts commit b5fcd06105dec2a7b0e4114d6ad4524fc54498c5.
2020-11-07 09:35:49 -08:00
Stella Laurenzo
b5fcd06105 NFC: Fix some post-review nits for the Tosa dialect.
* Moved various loose functions to either the mlir::tosa namespace or made static
* Fixed an unused variable warning in TosaMakeBroadcastable.cpp.
2020-11-07 08:54:31 -08:00
Suraj Sudhir
b28121133d TOSA MLIR Dialect
This is the TOSA MLIR Dialect described in the following MLIR RFC: https://llvm.discourse.group/t/rfc-tosa-dialect-in-mlir/1971/24

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D90411
2020-11-07 08:38:09 -08:00